[Alug] Perl split function...

Simon simon at sparksy.co.uk
Mon Sep 23 15:11:02 BST 2002


OK, I've got an IP address in a variable $address, I know because 

print qq($ipaddress);  gives me the address

trying to split it into it's singular octets like so... (As usernames on the 
system are derived from the last 2 octets of the address)

@octets = split(/./, $ipaddress);

Now from what I understand the elements in the array @octets
should be accessable by $octets[0] etc..


while (@octets)
	print qq(Octet = $_);

But it doesn't...   Or am I way off mark...

Please help....



More information about the main mailing list