Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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.


Comment on Re: use x; equivalent
Download Code
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
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 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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://532043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-09-17 16:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (91 votes), past polls