Goksie schreef:

> #!perl
>  use warnings ;
>  use strict ;
>  my $fl = "c:/Perl/CDR_MSC_DAT/00016363.DAT";

That is probably not a line-oriented file.

I would change that line to the more robust:
  my $fl = q{c:/Perl/CDR_MSC_DAT/00016363.DAT} ;
because filenames can contain sigils etc.

>  { local ($\) = ("\n") ;
>    open my $fh, '<', $fl or die "open '$fl': $!" ;

You'll probably want to do a binmode-call here.

>    while (<$fh>)
>    {
>      print $_ ;

That will print an extra "\n" after each "line", because you set up $\
for that, so the output file will be bigger than the input file.

>    }
>  }

<quote source="perlvar">
Setting $/ to a reference to an integer, scalar containing an
integer, or scalar that's convertible to an integer will
attempt to read records instead of lines, with the maximum
record size being the referenced integer.
</quote>

See also `perldoc -f read`, specifically LENGTH.

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to