perl> print $record
100.100.100.100 1COMPUTER1 09/13/30828 22:48:05
perl> print +($record =~ m[(\d+)]g)[0..3]
100 100 100 100
perl>
The original code place the numeric value of the four octets into the array @iparray -- so does this.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.
| [reply] [d/l] |
I was looking for a value of "100.100.100.100"
Huh? From the code you gave, I assumed you were
looking for a value of (100, 100, 100, 100) (i.e.,
a list of four values).
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
| [reply] [d/l] |