in reply to Simplify This
I stuck with your overall approach using split and substr. I realize that the regex approaches already given are more elegant, but I am post-happy today. That s// operator returns the number of substitutions, which is what was foiling you. Comma can help, if you like.
$record = " 100.100.100.100 1COMPUTER1 09/13/30828 22:48:05"; @iparray = split(/\./, do{($copy = substr($record,0,17)) =~ s/ //, $co +py}); $" = "."; print "@iparray";
,welchavw
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Simplify This
by ChrisR (Hermit) on Oct 01, 2003 at 00:33 UTC |