in reply to Re: Re: Re: Re: Many strings make one variable?
in thread Many strings make one variable?
2 follow-up question if you're up for it:
1.) i turned on strict and was amazed at
all the crap i was doing wrong!
I also tried to incude the library 'warnings'
which failed (my perl is 5.005), is the
shebang -w switch a suitable substitute
for use warnings lib?
use of 'my' instead of local? The strict and -w switch
stopped outputing bad news to my error logs, so am i
okay now? Or is there something else i don't know about
to keep me on the right path to using perl correctly.
program which could open and close millions of times
with no overflow problems.
jtrue
1.) i turned on strict and was amazed at
all the crap i was doing wrong!
I also tried to incude the library 'warnings'
which failed (my perl is 5.005), is the
shebang -w switch a suitable substitute
for use warnings lib?
2.) Do you see anything fundamentally flawed with myWill #!/usr/bin/perl -w work in place of use warnings;
use of 'my' instead of local? The strict and -w switch
stopped outputing bad news to my error logs, so am i
okay now? Or is there something else i don't know about
to keep me on the right path to using perl correctly.
When i say correct use of perl i mean a clean running#!/usr/bin/perl -w # this script outputs a gif # set color, width, and height use strict; &printGIF("FF0000","33","10"); ###################################### sub printGIF{ my $color = $_[0]; my $WH = sprintf("%lX",$_[1]); my $HH = sprintf("%lX",$_[2]); $color =~ s/(..)(..)(..)/$1\|$2\|$3/; my($RH,$GH,$BH)=split(/\|/,$color); print STDOUT "Content-type:image/gif\n\n"; my @gif=( "47", "49", "46", "38", "37", "61", "$WH", "00", "$HH", "00", "A1", "01", "00", "$RH", "$GH", "$BH", "FF", "FF", "FF", "00", "00", "00", "00", "00", "00", "21", "F9", "04", "05", "00", "00", "01", "00", "2C", "00", "00", "00", "00", "$WH", "00", "$HH", "00", "40", "02", "$HH", "84", "8F", "A9", "CB", "ED", "0F", "A3", "9C", "B4", "DA", "8B", "B3", "DE", "9C", "17", "00", "3B" ); binmode (STDOUT); # if needed foreach my $bit(@gif){ my $bita = hex($bit); $bita = pack("C",$bita); print STDOUT $bita; } }#################################### end printGIF
program which could open and close millions of times
with no overflow problems.
jtrue
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Strict, my and warnings
by Aristotle (Chancellor) on Oct 16, 2002 at 11:39 UTC | |
by demerphq (Chancellor) on Oct 16, 2002 at 19:23 UTC | |
by Aristotle (Chancellor) on Oct 17, 2002 at 00:30 UTC | |
by true (Pilgrim) on Oct 16, 2002 at 11:55 UTC | |
by Aristotle (Chancellor) on Oct 16, 2002 at 12:04 UTC | |
Re: Strict, my and warnings
by demerphq (Chancellor) on Oct 16, 2002 at 11:13 UTC | |
by true (Pilgrim) on Oct 16, 2002 at 12:21 UTC | |
by demerphq (Chancellor) on Oct 16, 2002 at 14:17 UTC |
In Section
Seekers of Perl Wisdom