Please send questions to
st10@humboldt.edu .
#!/usr/bin/perl -w
#######################################################
# lect06_filehandle_input1
#
# demonstrating using an input filehandle for input - ex 1
#
# modified by Sharon Tuttle from "Learning Perl",
# by Schartz and Phoenix
#
# last modified: 9-28-04
#######################################################
# let's say that this reads from a previously-created messages file
open PREV_MSGS, "< lect06_05_msgs"
or die "Cannot open lect06_05_msgs: $!";
# show the current contents of this file
while (<PREV_MSGS>)
{
chomp($old_msg = $_);
print "old message from file: $old_msg\n";
}
close PREV_MSGS;
# end of lect06_filehandle_input1