programming-examples/perl/File/Print text to file.pl

12 lines
278 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!usr/bin/perl
use strict;
use warnings;
print "Opening file for output:\n";
open OUTFILE, ">file.txt" or die "Can't find file.txt : $!";
print "Outputting to file.\n";
print OUTFILE "There was an old lady\n";
close OUTFILE or die "Can not close file.txt : $!";