This is an embarassingly easy question I'm sure, but I simply dont know why my wee script isnt working properly.
I have a text file that looks like this:
and I want to split the contents of each line on the period so that for:
$nums = 1,
$nums = 2
$nums = 56
Could anyone please point out whatever silly error is in my script? At the moment $nums when printed contains the enire contents of the line e.g. 126.96.36.199 and all the others are (obviously) empty
my $file = shift;
open(FILE, $file) || die "Unable to open $file for reading: $!\n";
my @sf = split;
#print "@sf\n"; print test
my @nums = split(/\\./, $sf);
All help much appreciated!