Chas. Owens wrote:
#!/usr/bin/perl

use strict;
use warnings;

my $fakefile = "6754\r\n7890\r\n6543\r\n";

open my $fh, "<", \$fakefile
        or die "could not open the fake file: $!";

open my $fh, '<:crlf', \$fakefile
        or die "could not open the fake file: $!";


my @array;
while (my $line = <$fh>) {
        $line =~ s/[\r\n]//g;

        chomp( $line );

        push @array, $line;
}

print "@array\n";

For further details, see `perldoc -f binode` and search for /crlf/.


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

Regardless of how small the crowd is, there is always one in
it who has to find out the hard way that the laws of physics
apply to them too.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to