[SATLUG] Calling Perl wizards

Frank Huddleston fhuddles at yahoo.com
Wed Jul 13 21:59:06 CDT 2005


oops I see that you do not have this gif in a file, but are putting 
actual gif gibberish into the HTML table. What I wrote won't work for 
that.

On Jul 13, 2005, at 8:48 PM, Frank Huddleston wrote:

> Looks like an HTML problem to me. How about just doing:
>
> {
>     print "<tr><td>";
>     print "<img src=\"";
>     print GD::Barcode->new('COOP2of5', $number)->plot->gif;
>     print "\"/>";
>     print "</td></tr>";
> }
>
> On Jul 13, 2005, at 5:16 PM, Jeremy Mann wrote:
>
>> I've come across a problem with Perl. I'm trying to use to
>> content-types inside of my script. The problem is that the first one
>> always overrides the second and I can't figure out how to make it use
>> both.
>>
>> What I'm trying to do is generate a range of numbers, for this case
>> call it 100 to 150. This number will be sent to a Perl module that
>> creates barcodes from numbers. I've got that part working just fine.
>> However, I want to create each barcode inside of a table to be printed
>> out later.
>>
>> My code is:
>>
>> #!/usr/bin/perl
>>
>> use GD::Barcode::UPCA;
>>
>> print "content-type: text/html \n\n";
>> print "<table border='1'>";
>> for (my $number = 100; $number <=150; $number++)
>> {
>>     print "<tr><td>";
>>     print "content-type: image/gif\n\n";
>>     print GD::Barcode->new('COOP2of5', $number)->plot->gif;
>>     print "</td></tr>";
>> }
>> print "</table>";
>>
>> This comes out as a table with the correct amount of rows, but each
>> row contains gibberish representing the GIF image as text. I don't
>> understand why its not using the 2nd specified content-type inside the
>> table.
>>
>> Any ideas?
>>
>>
>>
>> -- 
>> Jeremy
>> _______________________________________________
>> SATLUG mailing list
>> SATLUG at satlug.org
>> http://alamo.satlug.org/mailman/listinfo/satlug
>>
>
> _______________________________________________
> SATLUG mailing list
> SATLUG at satlug.org
> http://alamo.satlug.org/mailman/listinfo/satlug
>



More information about the SATLUG mailing list