Just another Perl shrine | |
PerlMonks |
Re: Is this code correctby choroba (Cardinal) |
on Mar 22, 2021 at 17:36 UTC ( [id://11130149]=note: print w/replies, xml ) | Need Help?? |
We don't know what the proper value is, you didn't tell us. In your example, the uninitialised variable is $sixth, but you seem to be using it as if it held the proper value. If your Perl is recent enough (5.10+), you can use
which uses the defined-or assignment operator that only assigns the value if the variable doesn't have a defined value.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|