sub getLetter { # Let's start the buffer with an empty string to avoid # an "uninitialized" warning message. my $txline = ""; my $letterfile = 'C:\Users\Carl\Documents\NewLetter.txt'; open (INPUT1, $letterfile) or die ("Can't open file"); while (my $line = ) { # Each time we read $line, we want to add it to the # end of $txline $txline = $txline . $line; } # *now* we have all the data we want in $txline, so we # can return it to the caller return $txline; }