Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: Little Perl Mysteries: what's your answer?

by Juerd (Abbot)
on Oct 31, 2002 at 19:13 UTC ( [id://209484]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Little Perl Mysteries: what's your answer?
in thread Little Perl Mysteries: what's your answer?

I don't believe this is a bug.

I think it is a bug because Deparse's output is not executable.

1;1 juerd@ouranos:~$ perl -e'sub foo () { 42 } print foo(), "-\n"' 42- 1;0 juerd@ouranos:~$ perl -MO=Deparse -e'sub foo () { 42 } print foo() +, "-\n"' print 42, "-\n"; -e syntax OK 1;0 juerd@ouranos:~$ perl -MO=Deparse -e'sub foo () { 42 } print foo() +, "-\n"' | perl -e syntax OK 42- 1;0 juerd@ouranos:~$ perl -e'sub foo () { 42 } print *foo{CODE}(), "-\ +n"' 42- 1;0 juerd@ouranos:~$ perl -MO=Deparse -e'sub foo () { 42 } print *foo{ +CODE}(), "-\n"' print *foo{'CODE'}(), "-\n"; -e syntax OK 1;0 juerd@ouranos:~$ perl -MO=Deparse -e'sub foo () { 42 } print *foo{ +CODE}(), "-\n"' | perl -e syntax OK Undefined subroutine &main:: called at - line 1. 1;255 juerd@ouranos:~$
(In the last example, *foo{CODE} is undef, and undef->() gives an 'Undefined subroutine &main:: called' error.)

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-16 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found