> my $localtime;
> @$localtime{qw / second minute hour mday month year weekday yearday isdst /} =
> localtime(time);
> 
> [1] A style nit:

Speaking of nitpicks:
my %localtime;

> If you DO need to iterate across all the indices for an array ( rarely
> necessary if you have designed your data correctly ) do it right:
> 
> my @person = ( qw / Freddy Mary Georgetta Loretta Fred Lawrence / );
> 
> ##
> ## UNBEARABLY LAME C
> ##
> 
> for ( my $index = 0 ; $index < @person ; $index ++ ) {
>     print "unbearably bad $person[$index]\n";
> }
> 
> ##
> ## MERELY BAD PERL
> ##
> 
> for my $index ( 0 .. $#person ) {
>     print "merely bad $person[$index]\n";
> }

This is not Bad Perl. This is a solution to a problem that the
following code will not solve. Sometimes you need $index, sometimes
you don't.

> ##
> ## GETTING INTO THE PERL STATE OF MIND
> ##
> 
> for my $person (@person) {
>     print "Hello $person\n";
> }

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to