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
In reply to Re: Simplify This
by welchavw
in thread Simplify This
by ChrisR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |