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.
In reply to Re: Split an array -> store contents into a scalar up till a certain character
by atcroft
in thread Split an array -> store contents into a scalar up till a certain character
by FireBird34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |