Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Is this code correct

by choroba (Cardinal)
on Mar 22, 2021 at 17:36 UTC ( [id://11130149]=note: print w/replies, xml ) Need Help??


in reply to Is this code correct

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

$variable //= $default_value;

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]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130149]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found