in reply to Getting the latest IP after dial-up
I'd fail this in a code review. You've not assured a match on the regex, so the $1 there could be the previous $1, since the dollar vars are not updated on an unsuccessful match./inet\ addr:(\d+\.\d+\.\d+\.\d+)\s+.*$/; ... print MAIL $1;
At the very minimum, put "or die" after the match.
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Don't use $1 without testing! (was Re: Getting the latest IP after dial-up)
by barrd (Canon) on Aug 25, 2002 at 16:50 UTC |