[LA.pm] Spam:***, Re: little help??

terry mcintyre terrymcintyre at yahoo.com
Thu Sep 29 15:26:10 PDT 2005


I often use a similar method, but to avoid the warning
messages about unused variables, the following twist:

#
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
my (undef,undef,$hour) = localtime(time);

--- Peter Benjamin <pete at peterbenjamin.com> wrote:

> At 08:00 PM 9/28/2005, Mike Dillon wrote:
> >> my $hour = (split, localtime)[2];
> 
> I've read a lot of code that uses perl shortcuts.
> It's obtuse.  Not a new argument regarding perl.
> my
>
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
> = localtime(time);
> 
> is a copy and paste from
> Perl/html/lib/Pod/perlfunc.html#item_localtime
> and I just use it, over and over, rather than try to
> recall what
> subscript is the hour.
> 
> When more than just the hour is needed, I know
> exactly what variables to use.
> 
> Yes, do read shortcut code, and understand that
> shortcut is there
> and how the shortcut works for it's scope and
> context, as that
> can lead to very advance use of perl, and in one
> line do something
> that would otherwise take 10 lines.  But when first
> starting to use
> perl... I advise to learn the easy way, where the
> perl Help copy
> and paste method is quite clear, and debugging is
> non-existent,
> resulting in faster time to working code, and moving
> on to the
> next perl project.
> 
> 
> _______________________________________________
> Losangeles-pm mailing list
> Losangeles-pm at pm.org
> http://mail.pm.org/mailman/listinfo/losangeles-pm
> 


Terry McIntyre
UNIX for hire
software development / systems administration / security

213-291-5169 or 2132915169 at tmomail.com ( text )
terrymcintyre at yahoo.com


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


More information about the Losangeles-pm mailing list