--- Nichole Bialczyk <[EMAIL PROTECTED]> wrote:
> so i've discovered the wonders of use strict; (it wasn't in my
> tutorial) and i'm trying to declare this array:
It'll cause a little headache now, and save you a LOT later. =o)
-w and strict are your friends! lol!
> my @timelog($sec,$min,$hour,$mday,$mon,$year) =
> localtime(time)[0,1,2,3,4,5];
No can do.
Do you need @timelog?
Try this:
my ($sec,$min,$hour,$mday,$mon,$year) = localtime;
also note that it'll just ignore the ones you don't assign.
and time() is the default argument for localtime(), so you don't need
it.
If you need @timelog, try this slight modification (which should save
all the fields in @timelog, btw, including the ones you aren't
explicitly naming).
my @timelog;
my ($sec,$min,$hour,$mday,$mon,$year)
= @timelog = localtime;
It's not pretty, but assigns localtime's output to @timelog, then
assigns the names scalars from the first elements of @timelog.
Does that help? =o)
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/