No such thing as a small change | |
PerlMonks |
Populating a vectorby gu (Beadle) |
on Dec 15, 2005 at 17:16 UTC ( [id://517034]=perlquestion: print w/replies, xml ) | Need Help?? |
gu has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks Somewhere in a code, I want to populate a (n+1)-vector with one 1 (at the beginning) and then n 0's, like (1, 0, 0, 0). The first snippet I came with is this ugly unperlish code : Then I became a little more enlightened and wrote Do you see something else/shorter/better ? Update : I'm dumb. Thank you, monks. Gu
Back to
Seekers of Perl Wisdom
|
|