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.
In reply to Re^2: Test if multiple variables are defined
by Eily
in thread Test if multiple variables are defined
by stroke
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |