Please send questions to
st10@humboldt.edu .
#!/usr/bin/perl -w
#######################################################
# lect06_die1
#
# using die (and opening a file!)
#
# modified by Sharon Tuttle from "Learning Perl",
# by Schartz and Phoenix
#
# last modified: 9-28-04
#######################################################
print "enter a file where log comments should be appended:\n";
chomp ($logname = <STDIN>);
if (! open LOG, ">> $logname")
{
die "Cannot create log file $logname: $!";
}
# if you get here --- $logname WAS opened for appending,
# and you could now perform that appending using
# filehandle LOG;
close LOG;
# end of lect06_die1