in reply to pattern matching difficulties, in two cases
It would be a lot more accurate to write two different expressions, one for each OS and then just have your script check which OS it is running on and use the appropriate regex.
$sunifconfig=qr/blahblahblah/; $linuxifconfig=qr/blahblahblah/; if ($^O eq "linux"){ $ifconfigoutput=~/$linuxifconfig/; } else { $ifconfigoutput=~/$sunifconfig/; }
*That code is untested.
Fellow monks, I don't know if using the $^O ($OSNAME) variable is the right way to go here. Feel free to comment.
HTH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: patern matching difficulties, in two cases
by waswas-fng (Curate) on Jun 24, 2003 at 18:58 UTC | |
by jcpunk (Friar) on Jun 24, 2003 at 19:14 UTC | |
|
Re: Re: patern matching difficulties, in two cases
by jcpunk (Friar) on Jun 24, 2003 at 19:15 UTC |