Le jeu 11/12/2003 à 10:27, Ajey Kulkarni a écrit :
> 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
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?
Because the compiler thinks that you are probably doing something
pointless.
EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 4:28 AM
To: [EMAIL PROTECTED]
Subject: 1 doubt.
perl t.pl
Name "main::FH" used only once: possible typo at t.pl line 6.
On Thu, Dec 11, 2003 at 09:27:48AM +, Ajey Kulkarni wrote:
> perl t.pl
> Name "main::FH" used only once: possible typo at t.pl line 6.
You opened a file, but you do not read from the file. Just opened
it. This doesn't make much sense. So you get a warning.
> cat t.pl
>
> #!/usr/bin/perl
>
>
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 no
> Name "main::FH" used only once: possible typo at t.pl line 6.
It's because it's used only once ;o) . If you just declare something (variable,
filehandle etc.) but don't use it, something's probably wrong with your code (such as
a typo). If you try reading or writing using that filehandle the e
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?
Quick reply is hi