Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Creating "Lexical" Symbol Table Aliases (a la "use vars") From The Same Package

by OneTrueDabe (Novice)
on May 08, 2014 at 16:50 UTC ( #1085478=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
       use strict 'vars';
       Variable "@foo" is not imported at line 10.
       Global symbol "@foo" requires explicit package name at line 
    +10. had compilation errors.
  2. or download this
       use strict 'vars';
       package main;
          print "Foo: (@foo)\n";
  3. or download this
       use strict 'vars';
       package pkg;
          print "Foo: (@foo)\n";
  4. or download this
       use strict 'vars';
       package pkg;
          BEGIN { *pkg::foo = \@pkg::foo }
          print "Foo: (@foo)\n";
  5. or download this
        package pkg;
        sub BEGIN {
            *foo = \@foo;
  6. or download this
       use strict 'vars';
       Foo: ()

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1085478]
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2015-07-07 03:05 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (86 votes), past polls