#!/usr/local/bin/perl # # - Prompts for a file to read in. # - Reads the file into an array. # - Writes file to STDOUT with the lines numbered. # print "Please enter the file to read in (e.g., .login): "; $filename = ; chop($filename); # removing the newline character open(IN, "$filename") || die "Could not open $filename...\n"; $i = 0; while () { print ++$i, " : $_"; } close(IN);