Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Seemingly odd behavior of sequence

by Kenosis (Priest)
on Dec 04, 2013 at 17:27 UTC ( #1065620=note: print w/ replies, xml ) Need Help??


in reply to Seemingly odd behavior of sequence

If you're curious how Perl parses an expression--perhaps for debugging purposes or just for the pure joy of it on a rainy afternoon--you can use the module B::Deparse at the command line as follows:

perl -MO=Deparse,-p -e 'print 0..9 x 2, "\n";'

Output:

print((0 .. (9 x 2)), "\n"); -e syntax OK

Note that the output echoes oiskuu's spot-on assessment of your expression's evaluation.


Comment on Re: Seemingly odd behavior of sequence
Select or Download Code
Re^2: Seemingly odd behavior of sequence
by jar00n (Novice) on Dec 05, 2013 at 09:44 UTC
    And many thanks to you for showing me this debugger.

      You're most welcome, jar00n!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2015-07-07 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls