#!/usr/bin/perl -w ####################################################### # class8_05_filehandle_input1 # # demonstrating using an input filehandle for input - ex 1 # # modified by Sharon Tuttle from "Learning Perl", # by Schartz and Phoenix # # last modified: 5-5-03 ####################################################### # let's say that this reads from a previously-created messages file open PREV_MSGS, "< class8_05_msgs" or die "Cannot open class8_05_msgs: $!"; # show the current contents of this file while () { chomp($old_msg = $_); print "old message from file: $old_msg\n"; } close PREV_MSGS; # end of class8_05_filehandle_input1