in reply to Re: Test if multiple variables are defined
in thread Test if multiple variables are defined
What about a simple grep like this?
s/^\s+|\s+$//g grep {defined $_} for ( $ipaddress, $prefix, $interface, $device, $locati;
That wouldn't work, s/// either works on the string binded to it with =~ (or !~) or on $_ otherwise, not on a list parameter. Look at AnomalousMonk's answer for the correct syntax.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Test if multiple variables are defined
by Laurent_R (Canon) on Jun 26, 2013 at 21:02 UTC | |
by Eily (Monsignor) on Jun 26, 2013 at 22:06 UTC | |
by Laurent_R (Canon) on Jun 28, 2013 at 18:52 UTC |