kirk123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi all:
I am trying to match on physical address (below) and get the last five numbers 75219.
Physical Address. . . . . . . . . : 00-B0-D0-87-52-19 DHCP Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.45.10.166
My snippet:
open(I,'ipconfig /all |'); while(<I>){ next unless /Physical Address/; /:/; chomp; tr/-//d; $new_string = substr($_, -6); print " new string is : hhh" . $new_string . "kk" . "\n"; last; }
output:
kkew string is : hhh75219
Should'nt output be hhh75219kk.
Can somebody tell me what is wrong here.
--thanx kirk
Edited 2002-08-15 by Ovid
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I need help with pattern matching
by DamnDirtyApe (Curate) on Aug 15, 2002 at 21:54 UTC | |
by kirk123 (Beadle) on Aug 15, 2002 at 22:16 UTC | |
|
Re: I need help with pattern matching
by Abigail-II (Bishop) on Aug 16, 2002 at 08:30 UTC | |
|
Re: I need help with pattern matching
by converter (Priest) on Aug 16, 2002 at 07:10 UTC | |
|
Re: I need help with pattern matching
by Anonymous Monk on Aug 15, 2002 at 22:14 UTC |