in reply to Spot the Bug
use strict; use warnings; # my $file = shift || die "No file, dummy!"; # open FH, "<", $file or die "Could not open ($file) for reading: $ +!"; local $/ = "\n.\n"; while (defined (my $record = <DATA>)) { chomp $record; print $record; # <STDIN>; } __DATA__ sdjh sfhg srig srgsrigh . . . asdigf wsergh
This gives:
sdjh sfhg srig srgsrigh.asdigf wsergh
A . was left there unremoved, if that's the bug you are looking for (As it cannot handle empty record.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Spot the Bug
by Mr. Muskrat (Canon) on Sep 09, 2005 at 02:02 UTC | |
by pg (Canon) on Sep 09, 2005 at 02:08 UTC | |
|
Re^2: Spot the Bug
by Ovid (Cardinal) on Sep 09, 2005 at 02:13 UTC |