http://qs321.pair.com?node_id=1074555


in reply to How can I write this in a "simpler" way?

YAWTDI...

#!/usr/bin/perl use strict; use warnings; use Tie::File; my $filename = 'data.txt'; tie(my @array, 'Tie::File', $filename) or die "Could not open $filenam +e for reading"; my $total_lines = 0; for (@array) { chomp; $total_lines += $_; } printf "There are %d lines in %s\n", $total_lines, $filename;

*My* tenacity goes to eleven...