Associative array explaination...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rohitbasu77
    New Member
    • Feb 2008
    • 89

    Associative array explaination...

    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.
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    You can find out more by reading perltoot which will be a much better explanation than mine.

    --Kevin

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      perlvar also should have some explanation about perls predefined variables

      perldoc: perlvar

      Comment

      • rohitbasu77
        New Member
        • Feb 2008
        • 89

        #4
        Originally posted by eWish
        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.

        Comment

        • rohitbasu77
          New Member
          • Feb 2008
          • 89

          #5
          Let me put a example now:

          Pak1.pm contains:
          [CODE=perl]package pak1;
          use strict;

          @EXPORT = qw (&sub1 &sub2 &sub3); ---- 3 function will be exported

          my $x;

          sub sub1{
          .....
          ......
          }

          sub sub2{
          .....
          ......
          }

          sub sub3{
          .....
          ......
          }

          1;[/CODE]

          pak2.pm contains:
          [CODE=perl]package pak2;
          use Exporter;
          use pak1;
          @ISA = qw (Exporter pak1) ------if some function is not found pak2 then it goes
          ------ to search Exporter and pak1 module.
          --------inheritance property
          $x = 5;
          sub sub4{
          .....
          ......
          }
          1;[/CODE]

          [CODE=perl]#!/usr/bin/perl

          use pak2;
          use strict;

          print " \n the value of x is: $x";[/CODE]
          Last edited by eWish; Feb 26 '08, 01:42 PM. Reason: Please use [CODE][/CODE] tags

          Comment

          Working...