RosettaCodeData/Task/Take-notes-on-the-command-line/Perl/take-notes-on-the-command-line.pl
2023-07-01 13:44:08 -04:00

9 lines
255 B
Perl

my $file = 'notes.txt';
if ( @ARGV ) {
open NOTES, '>>', $file or die "Can't append to file $file: $!";
print NOTES scalar localtime, "\n\t@ARGV\n";
} else {
open NOTES, '<', $file or die "Can't read file $file: $!";
print <NOTES>;
}
close NOTES;