in reply to Re: Iterator to parse multiline string with \\n terminator
in thread Iterator to parse multiline string with \\n terminator
WRT your edit
What do you think about a return instead of an if? e.g.:
sub fh_iterator { my $fh = shift; my $line = $fh->getline(); return $line unless $line; $line .= $fh->getline() while $line =~ m{\\$}; return $line; }
I don't think there's any functional difference, but one may be more readable than the other...
Thanks for your help!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Iterator to parse multiline string with \\n terminator
by tinita (Parson) on Oct 06, 2013 at 12:46 UTC | |
Re^3: Iterator to parse multiline string with \\n terminator
by Athanasius (Archbishop) on Oct 06, 2013 at 16:28 UTC |