in reply to hm strange loop for me..
If I create a data file by hand, your code works fine. Perhaps you should print out the records so you can see where it's breaking ?
$/="//\n";# no need to escape / .. not that it matters open(FILE,$ARGV[0]) or die("Can't open $ARGV[0]: $!\n"); while (<FILE>) { chomp; # print the record between square brackets # and add an extra couple of newlines to make # it obvious where the record breaks are print "record #$. contains [$_]\n\n"; }
|
|---|