I went to run it and as usual perl is telling me it can't do something we both know it can. Tried other ways of dereferencing that should work like ${$_} and no dice. Wasted the next 20 minutes searching and like most internet searches relating to Perl all I can find is pages of long-winded, unasked for answers explaining that is bad and should never be done and and almost nothing in regards to if it can be done. What scant information I can find suggests it's possible only on global variables and only after I've turned of strict referencing which actually sounds really bad but only due to Perl sucking at variables rather than my solution. I'll probably use a hash but just once it would be nice to write some elegant code instead of having to refactor or kludge around autocracy.my($sec,$min,$hour,$day,$month,$year,$wday,$yday,$isdst) = localtime(t +ime); $year += 1900; $month++; my @pad = qw (sec min hour day month); for (@pad) { $$_ = zeropad($$_); }
In reply to What's so wrong with this (dereferencing)code? by Maelstrom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |