$/="//\n";# no need to escape / .. not that it matters open(FILE,$ARGV[0]) or die("Can't open $ARGV[0]: $!\n"); while () { 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"; }