in reply to Re: Re: finding different linebreaks with <>
in thread finding different linebreaks with <>
Otherwise, open the file and read a bunch of characters (e.g. by setting $/=\1024; see perldoc perlvar) and check for \n or \r (e.g. with $/ = $1 if $buffer=~/([\r\n])/;)and set $/ appropriately; then seek to the beginning of the file and start the read loop.open my $fh, "filename" or die $!; while (my $line = <$fh>) { local $/ = "\r"; open my $fh, "<", \$line or die $!; while (my $line = <$fh>) { # process $line here } }
|
|---|