Hi Deane,

2008/12/12  <[EMAIL PROTECTED]>:
> my ($a, $b, $c, $d, $e, $f) = ('init', 'init', 'init', 'init', 'init', 
> 'init');

I thought "hmm, you want to repeat a value ... what about the
repetition operator?". Just for a lark, I tried:
> perl -e 'my ($a, $b, $c) = ('init') x 3; print "$a:$b:$c\n";'

And it worked! Reading `perlop`, I see this is entirely expected, but
it took me by  surprise. I was just too used to 'x' being a
string-related operator, and IMHO this takes DWIM to new heights.

Ah, well - learn something new every day!

cheers,
Gaurav
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to