in reply to Re^2: $1 not "freezing" in an addition
in thread $1 not "freezing" in an addition
update: after tobyinks 3rd update I see that order of operations plays a role, I still think you should perlbug it, because at least the perlop, and warnings, need to warn more about this ...
Documenting Auto-increment and Auto-decrement is great, but needs to warn about MORE, like this case, or foo($1,$2) <c>foo("$1","$2")
Even B::Lint doesn't warn about it
B::Concise shows no difference between the two
|
|
Even the mighty perlcritic doesn't warn about undefined behaviour
But I actually knew about this and forgot
warnings/lint/critic need to recognize and warn me cause I'll probably forget :)
It ought to be easy to recognize an unquoted $1 as a function argument and issue a warning , at least for perlcritic -- if that concise output is any indication, lint might be slightly harder
Maybe perltrap/Common Perl Pitfalls could also use some updating
you should definitely perlbug that, and point out that 7 + 6 is 13 and not 12
This part below written before your butterjunkeffect update, on the approach to solving this problem
Ick :) Um, do you really want to find the cause, or do you want a better way to write it?
I'm not inclined to try debugging a program that hacks a tree as a string, I'm inclined to create a tree first (say an array of array or Tree ) and then navigate (calculate distance)
update: tobyink is probably right as to cause
Those rosalind newick trees could be drawn with ascii Dumping trees to a console.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: $1 not "freezing" in an addition
by tobyink (Canon) on Dec 14, 2012 at 14:57 UTC | |
by grondilu (Friar) on Dec 14, 2012 at 15:36 UTC | |
by tobyink (Canon) on Dec 14, 2012 at 16:03 UTC | |
by Anonymous Monk on Dec 14, 2012 at 16:14 UTC | |
by chromatic (Archbishop) on Dec 14, 2012 at 18:10 UTC | |
by Anonymous Monk on Dec 15, 2012 at 08:40 UTC | |
by chromatic (Archbishop) on Dec 15, 2012 at 20:25 UTC | |
|