Hello there someone pointed me to you for problems
with perl
I am a beginner learning perl on my own.
I wrote this script to read a file 
#!/ncsu/perl56/bin/perl -w

#purspose  reads from a file

use Getopt::Long;

#set up command line to accept file name
my $ret = GetOptions ("f|filename:s");
my $filename = $opt_f || die "Usage: $0 -f filename
\n";

#open file

open (INPUT, "$filename") || die "could not open file
$filename : $!\n";
#start reading from file

while(<INPUT>)
{
   chop;
   print "Line $. = <$_>\n";

}
 #close file

 close (INPUT);

However I get this warning when I run it
Name "main::opt_f" used only once: possible typo at
openfile.pl line 9.
What could be the problem.
I used portions of scripts taken from PERL 5 How-to
second edition.
Hope that you can get back to me on this
Sincerely
KWeku Addae-Mensah

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to