Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 12th, 2008, 04:56 AM
Newbie
 
Join Date: Jul 2008
Posts: 13
Default Error message during runtime

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.
Reply
  #2  
Old August 12th, 2008, 05:17 AM
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 837
Default

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
Reply
  #3  
Old August 12th, 2008, 06:38 AM
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Posts: 3,662
Default

Quote:
Originally Posted by eWish
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. :)
Reply
  #4  
Old August 16th, 2008, 09:58 AM
Newbie
 
Join Date: Oct 2007
Posts: 2
Default

Quote:
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;

Last edited by eWish; August 16th, 2008 at 04:41 PM. Reason: Added Quote and Code Tags
Reply
  #5  
Old August 16th, 2008, 12:34 PM
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Posts: 3,662
Default

Quote:
Originally Posted by SUHASbioinfo
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.
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles