Perl: the Markov chain saw | |
PerlMonks |
Re: Array construct and foreach loopby choroba (Cardinal) |
on Apr 04, 2019 at 15:58 UTC ( [id://1232156]=note: print w/replies, xml ) | Need Help?? |
What you've shown is a string, i.e. a scalar, not an array. Using split can turn it into a list; you can populate an array with a list, or you can iterate over it directly:
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|