in reply to Re^2: Test if multiple variables are defined
in thread Test if multiple variables are defined
Yes, you are right and I definitely know it. As noted in my update above, I really meant to write:
s/^\s+|\s+$//g for grep {defined $_} ( $ipaddress, $prefix, $interface, $device, $location);But, as I also said in my update, that does not work as I expected, the "for" does not seem to deliver to the s/// statement the elements supplied by the grep. I got it working quite easily using a map instead of a for, but it no longer has the relative cleverness I was looking for.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Test if multiple variables are defined
by Eily (Monsignor) on Jun 26, 2013 at 22:06 UTC | |
|
Re^4: Test if multiple variables are defined
by Laurent_R (Canon) on Jun 28, 2013 at 18:52 UTC |