-- def_macro note my $file = shift or die "Please indicate the note you wish to create/append to"; mkdir 'notes' unless -e 'notes'; open my $fh, ">>", "notes/$file" or die "Couldn't open note for write: $!"; local $/; print $fh $_ while <>; close $fh or die "Trouble closing file: $!"; print "Successfully appended to note $file"; #### -- def_macro recall my $file = shift or die "Please indicate the note you wish to open"; die "Note $file does not exist" unless -f "notes/$file"; open my $fh, "<", "notes/$file" or die "Couldn't open note for read: $!"; local ($/,$\); print <$fh>; close $fh or die "Couldn't close file: $!"; #### -- note example This should be the first line #### -- note example This should be the second line #### -- recall example #### This should be the first line This should be the second line