Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Data Dumper Japh

by muba (Priest)
on Jan 16, 2007 at 02:32 UTC ( [id://594840]=note: print w/replies, xml ) Need Help??


in reply to Data Dumper Japh

Heh, nifty!

Also, it took a good second look to see the distinction between Ox and 0x.

Replies are listed 'Best First'.
Re^2: Data Dumper Japh
by sgt (Deacon) on Jan 16, 2007 at 10:30 UTC

    update: sorry about not using a spoiler tag...

    sub Oxff cannot start with a number...(without symbolic refs tricks like

    % stephan@armen (/home/stephan) % % perl -we ' *{"11abc"} = sub { print q[ok] }; *{"11abc"}{CODE}->()' ok % stephan@armen (/home/stephan) % % perl -we ' *{"11abc"} = sub { print q[ok] }; &{*{"11abc"}}()' ok

    actually I think the second form could work with less braces ...humm

    cheers --stephan

      You can't just omit the braces, but you can do this instead:

      *{"11abc"}->(); or &{"11abc"}();

      The first one works because you can dereference the glob like any of a scalar, array, hash, code, io, or glob reference. That is, when you do this, you don't explicitly need to take the right part of the glob with the *foo{THING} notation.

      The second should be obvious.

        ambrus++

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-25 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found