On Dec 11, 2003, at 3:27 AM, Ajey Kulkarni wrote:

perl t.pl
Name "main::FH" used only once: possible typo at t.pl line 6.

cat t.pl

#!/usr/bin/perl

use strict;
use warnings;

open FH, "out.dat";


Why am i getting this warning? When i remove the warnings,this goes off?
Is there any problem if i not include "use warnings" line?

As the warning say, you used FH only once. You open() a file and do nothing with it. Perl's just making sure you are aware of the issue. Once you start using the file Perl will be quite about it.


While you're at it, don't forget to check that the file opened properly:

open FH, 'out.dat' or die "File error: $!\n";

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to