Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: use x; equivalent

by chromatic (Archbishop)
on Feb 22, 2006 at 17:52 UTC ( #532043=note: print w/replies, xml ) Need Help??

in reply to use x; equivalent

pack is a Perl keyword, so the parser doesn't know what to do with that construct. I suggest changing the name of your module.

Of course, if the documentation had shown the unbroken way to call class methods, you wouldn't have had this problem:

BEGIN { require pack; pack::->import(); }

Update: fixed the code to use the really unambiguous way.

Replies are listed 'Best First'.
Re^2: use x; equivalent
by unclesmiff (Initiate) on Feb 22, 2006 at 18:13 UTC
    Thank you chromatic et al. I changed the name to packe and it worked.

    I was also wondering how to get debug from the importer, I thought this might work, but no. it doesn't print anything.

    BEGIN { require packe; $Exporter::Verbose=1; import packe; }
Re^2: use x; equivalent
by ikegami (Pope) on Feb 22, 2006 at 18:04 UTC

    Even using your 'unbroken' way, I get

    Not enough arguments for pack at -e line 1, near "pack;" Not enough arguments for pack at -e line 1, near "pack->import" BEGIN not safe after errors--compilation aborted at -e line 1.

    perl v5.6.1

Re^2: use x; equivalent
by vladb (Vicar) on Feb 22, 2006 at 17:57 UTC
    Good catch, chromatic! Gees, however I missed that!..

    (feeling red faced now)
    "We've all heard that a million monkeys banging on a million typewriters will eventually reproduce
    the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." - Robert Wilensky, University of California

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://532043]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (1)
As of 2018-04-25 00:04 GMT
Find Nodes?
    Voting Booth?