open (FH, "< io.txt") or die $!;
while(<FH>)
{
print $_;
}
close(FH);
or
use Fcntl;
sysopen(FH, "io.txt", O_RDONLY) or die $!;
while(<FH>)
{
print $_;
}
close(FH) || die "Couldn't close file properly.";
or
use IO::File;
my $FH = new IO::File("io.txt", "r") or die "could not open $filename : $!\n";
while ($line = $FH->getline())
{
print $line;
}
$FH->close();
while(<FH>)
{
print $_;
}
close(FH);
or
use Fcntl;
sysopen(FH, "io.txt", O_RDONLY) or die $!;
while(<FH>)
{
print $_;
}
close(FH) || die "Couldn't close file properly.";
or
use IO::File;
my $FH = new IO::File("io.txt", "r") or die "could not open $filename : $!\n";
while ($line = $FH->getline())
{
print $line;
}
$FH->close();
No comments :
Post a Comment