![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: A little (formatted) vanityby briac (Sexton) |
on Oct 02, 2001 at 03:59 UTC ( #116026=note: print w/replies, xml ) | Need Help?? |
Here are some experiments with format. It behaves in a rather weird fashion when eval'ed. It seems to replace all the 'template variables' in the format by their actual values when the evaluation is called. The (kludgy) workaround I found is to eval on each iteration of the for $i(0..9) The use of the eval is to be able to get the longest name of the list and construct the format according to it
(I think that there should be a better way to do the above though) The most straightforward approach of using format in this script would be the following:
But in a nicer and more obfuscation prone style, one could prefer
Eeek! Cheers,
In Section
Cool Uses for Perl
|
|