Timeline for Tree traversal: Depth-first search
Current License: CC BY-SA 2.5
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 6, 2011 at 17:00 | history | edited | J B | CC BY-SA 2.5 |
Perl version
|
| Feb 6, 2011 at 15:55 | comment | added | Yasir Arsanukayev | Yep, it works. I hurry voted your question twice. You may edit your answer to add notes about Perl version, or even shorter variant of your code in the future, so that I'll be able to vote up ;-) | |
| Feb 6, 2011 at 15:32 | comment | added | J B |
For older Perl, replace say with print"$_\n". Soooo longer.
|
|
| Feb 6, 2011 at 15:26 | comment | added | J B | @Yasir I read the comment (now), but do consider it more convenient to me to print the result instead of returning it. | |
| Feb 6, 2011 at 15:24 | comment | added | J B |
It's Perl 5.10 (and I should have put it in the answer as I usually do), you can either add -M5.010 to the command line, run as -E 'code here', or insert a use 5.010; header do the .pl file.
|
|
| Feb 6, 2011 at 14:48 | history | answered | J B | CC BY-SA 2.5 |