in reply to Split an array -> store contents into a scalar up till a certain character
The easiest way I can think of would be if the address were in a string, and you split it into the array. Doing that could be as simple as @octets = split(/\D+/, $ipaddress, 4);, with the ', 4' possibly unnecessary, but forcing split() to return only 4 elements.
Hope that helps.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Split an array -> store contents into a scalar up till a certain character
by FireBird34 (Pilgrim) on Oct 19, 2002 at 23:18 UTC | |
by tadman (Prior) on Oct 19, 2002 at 23:47 UTC | |
by FireBird34 (Pilgrim) on Oct 21, 2002 at 02:08 UTC |