Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Packages and symbol tables

by Joost (Canon)
on Dec 01, 2007 at 14:16 UTC ( #654321=note: print w/replies, xml ) Need Help??

in reply to Packages and symbol tables

BEGIN { print "$_ => $Foo::{$_}\n" foreach keys %Foo::; }
is probably better in your specific case.

Anyway, my guess at what's going wrong is that base is trying to be clever in a way that you don't expect.

Since you're defining the packages in the same file, just drop the use base and do:

package Foo::Bar; our @ISA = 'Foo';

Replies are listed 'Best First'.
Re^2: Packages and symbol tables
by johnnywang (Priest) on Dec 01, 2007 at 18:17 UTC
    Thanks Joost, your suggested change to use @ISA solved the problem (although I'm now on to the next one!) care to explain the thinking in your message?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://654321]
[jdporter]: one prog I have has a UI which allows to input a bit mask
[jdporter]: currently it expects the bitmask to be in the form of a hex number, e.g. 0x0101
[jdporter]: but I'd like to let the user specify it as individual bits, i.e. 0b0000000100000001
[jdporter]: there is no bit/binary equivalent of hex, right?
[jdporter]: I guess that the most direct way of doing it is with some magical incantation involving unpack or whatever

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2018-02-20 16:25 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (272 votes). Check out past polls.