By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,809 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,809 IT Pros & Developers. It's quick & easy.

Error message during runtime

P: 13
When I tried to run my application, it says

Global symbol "%files" requires explicit package name at c:\codes\testing2.pl line 9.

Can anybody tell me what does this means and how to I solve this? I googled it but I still dont get it.
Aug 12 '08 #1
Share this Question
Share on Google+
4 Replies


eWish
Expert 100+
P: 971
When you are using the strict pragma you have to declare your variables first. This is done using the my function.

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2.  
  3. my %hash;
  4.  
------------------------------------------------------------
Pragmas (perl 5.8.8) used :
  • strict - Perl pragma to restrict unsafe constructs



--Kevin
Aug 12 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
When you are using the strict pragma you have to declare your variables first. This is done using the my function.

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2.  
  3. my %hash;
  4.  
------------------------------------------------------------
Pragmas (perl 5.8.8) used :
  • strict - Perl pragma to restrict unsafe constructs



--Kevin
The code converter is no longer a virgin. :)
Aug 12 '08 #3

P: 2
When I tried to run my application, it says

Global symbol "%files" requires explicit package name at c:\codes\testing2.pl line 9.

Can anybody tell me what does this means and how to I solve this? I googled it but I still dont get it.
try below code.

Remember whenever u r using use strict pragma u should declare all variables with my.

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2.  
  3. my %files;
Aug 16 '08 #4

KevinADC
Expert 2.5K+
P: 4,059
When I tried to run my application, it says

Global symbol "%files" requires explicit package name at c:\codes\testing2.pl line 9.

Can anybody tell me what does this means and how to I solve this? I googled it but I still dont get it.

try below code.

Remember whenever u r using use strict pragma u should declare all variables with my.

use strict;

my %files;
post your code perl, use code tags.
Aug 16 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.