The cause of your output is beyond me; however, I'd suggest a different approach to aquiring the numbers:
#! /usr/bin/perl use strict ; use warnings ; # $|++ ; while ( <DATA> ) { /^Phys.*(\w)-(\w\w)-(\w\w)$/ ; my $match = 'hhh' . $1 . $2 . $3 . 'kk' ; print "The new string is: $match\n" ; last ; } __DATA__ Physical Address. . . . . . . . . : 00-B0-D0-87-52-19 DHCP Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.45.10.166
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche
In reply to Re: I need help with pattern matching
by DamnDirtyApe
in thread I need help with pattern matching
by kirk123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |