I've a feeling it should be something along the lines of @hash{@keys} = @values; which I've seen on another thread, but I can't quite get there.
...but you were near!
What do you think of:
sub new { my $class_name = shift; my %self ; @self{qw(sec min hour mday mon year wday yday isdst)} = localtime(); bless \%self,$class_name ; }
Ciao!
--bronto
# Another Perl edition of a song:
# The End, by The Beatles
END {
$you->take($love) eq $you->made($love) ;
}
In reply to Re: adding an array of instance variables and an array of values
by bronto
in thread adding an array of instance variables and an array of values
by postman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |