Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Parsing a Tree to a Table.

by Athanasius (Abbot)
on Dec 05, 2013 at 11:17 UTC ( #1065745=note: print w/ replies, xml ) Need Help??


in reply to Re: Parsing a Tree to a Table.
in thread Parsing a Tree to a Table.

The behaviour here has nothing to do with when the increment operation is applied. $deep + 1 evaluates to 1 more than the current value of $deep, but leaves that value unchanged. ++$deep (or $deep++) changes the variable’s value by incrementing it, so that on the next iteration of the foreach loop, $deep is larger (by 1) than it was before. ++$deep is equivalent to $deep += 1 — the latter form makes the change to the variable explicit via the presence of an assignment operator.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


Comment on Re^2: Parsing a Tree to a Table.
Select or Download Code
Replies are listed 'Best First'.
Re^3: Parsing a Tree to a Table.
by Discipulus (Priest) on Dec 05, 2013 at 11:22 UTC
    OMG what a stupid's moment passed to me!!
    thanks
    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2015-07-31 09:07 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 (276 votes), past polls