Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: Test if multiple variables are defined

by stroke (Acolyte)
on Jun 25, 2013 at 14:51 UTC ( #1040611=note: print w/replies, xml ) Need Help??


in reply to Re^3: Test if multiple variables are defined
in thread Test if multiple variables are defined

Thanks, that's what I was trying to say - run it on each element, not the array as a whole. Words failed me at the time though. And a simple solution - I went for:

for ( $ipaddress, $prefix, $interface, $device, $location, $comment ) +{ s/^\s+|\s+$//g if defined; }

Thanks for your wisdom!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040611]
help
Chatterbox?
Discipulus Good day bros?!? oh tempora oh mores!
[amitkumarj441]: Hey everyone
[amitkumarj441]: I need to ask a question, where can I post my problem?
[Discipulus]: everyone is me
[Discipulus]: Seekers of Perl Wisdom is the for asking question
[Discipulus]: be sure to use code tags for code and data

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-04-26 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (488 votes). Check out past polls.