note
GrandFather
<p>Are you expecting to read multiple lines from the input file or just one? If you intend to read multiple lines and thus (I guess) generate multiple forms put the print lines inside the loop (although there are much better ways to do this).</p>
<p>If you expect to read a single line then replace the loop (and the few lines before it) with:</p>
<c>
my $file = '...';
open my $inFile, '<', $file or die "Can't open $file: $!";
my $line = <$inFile>;
chomp $line;
my ($name1, $name2, $address, $phone) = split("\t");
close($inFile);
</c>
<p>As an aside, notice the use of the three parameter version of [doc://open] and the use of a lexical file handle. Note too the check on the result of the open.</p>
<div class="pmsig"><div class="pmsig-461912">
True laziness is hard work
</div></div>
885187
885187