in reply to Re^2: find element in array, then advance to next element
in thread find element in array, then advance to next element
You need list context to assign the capture(s) — note the parentheses around $ports:
my ($ports) = $args =~ m/-p\s+([-\d]+)/;
Otherwise (in scalar context), you'd get whether the regex matched (thus the 1).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: find element in array, then advance to next element
by kathys39 (Acolyte) on Dec 09, 2008 at 19:19 UTC | |
|
Re^4: find element in array, then advance to next element
by CountZero (Bishop) on Dec 09, 2008 at 20:24 UTC |