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

Associative array explaination...

P: 89
There are some predefine associative array, like

%ENV, %INC, %SIG...
@ARGV, @INC...

Can any one explain the use on @ISA and @EXPORT, @EXPORT_OK, %EXPORT_TAGS.
Feb 25 '08 #1
Share this Question
Share on Google+
4 Replies


eWish
Expert 100+
P: 971
You can find out more by reading perltoot which will be a much better explanation than mine.

--Kevin
Feb 25 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
perlvar also should have some explanation about perls predefined variables

perldoc: perlvar
Feb 25 '08 #3

P: 89
You can find out more by reading perltoot which will be a much better explanation than mine.

--Kevin

Thanks... The documentation is big, but i have a silent read upto Multiple class inheritence.
Feb 26 '08 #4

P: 89
Let me put a example now:

Pak1.pm contains:
Expand|Select|Wrap|Line Numbers
  1. package pak1;
  2. use strict;
  3.  
  4. @EXPORT = qw (&sub1 &sub2 &sub3); ---- 3 function will be exported
  5.  
  6. my $x;
  7.  
  8. sub sub1{
  9.                .....
  10.               ......
  11.               }
  12.  
  13. sub sub2{
  14.                .....
  15.               ......
  16.               }
  17.  
  18. sub sub3{
  19.                .....
  20.               ......
  21.               }
  22.  
  23. 1;
pak2.pm contains:
Expand|Select|Wrap|Line Numbers
  1. package pak2;
  2. use Exporter;
  3. use pak1;
  4. @ISA = qw (Exporter pak1) ------if some function is not found pak2 then it goes 
  5.                                         ------ to search Exporter and pak1 module.
  6.                                        --------inheritance property
  7. $x = 5;
  8. sub sub4{
  9.                .....
  10.               ......
  11.               }
  12. 1;
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. use pak2;
  4. use strict;
  5.  
  6. print " \n the value of x is: $x";
Feb 26 '08 #5

Post your reply

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