programming-examples/perl/File/Print message in case of file open failure.pl

4 lines
114 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
open (FILEHANDLE, ">hello.txt") or die "Cannot open hello.txt";
print FILEHANDLE "Hello!";
close (FILEHANDLE);