Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Tree in perl

by McA (Priest)
on Nov 17, 2014 at 16:07 UTC ( [id://1107436]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Tree in perl
in thread Tree in perl

You wanted to get a starting point. You got one, no two.

Do you want to win a contest or do you want to learn Perl?

Regards
McA

Replies are listed 'Best First'.
Re^4: Tree in perl
by saurabh2k26 (Initiate) on Nov 17, 2014 at 18:54 UTC
    syntax error at t.pl line 11, near "+ }"

      saurabh2k26:

      I don't see "+ }" in either code example. I suspect that you're cutting and pasting from the screen into your editor, because when formatted code lines wrap, the wrap is indicated with a "+" symbol. You can either remove the unwanted "+" symbols, or use the "download" link, in which case you'll get the code by itself in a web page which you can either right-click and "save as" or cut & paste without the "+" symbols appearing.

      Note: I don't know what your code wrap settings are, but you could always make them wider. (Neither code example wraps with the settings I use.

      Update: I just logged out and looked at the code--McA has two lines that wrap using the default settings, so try the download link. Also, when you're logged out, the plus symbols that indicate wrapping are shown in red, so that'll make the extra "+" symbols easier to find if you just want to delete them in your editor.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

        @saurabh2k26,

        I can't believe it. You are speaking about solving relatively complex graph-exploration problems, and you can't even figure out how to remove a so-called "bug" introduced by a clumsy copy-and-paste which just added a + character to the algorithm proposed to you? Come on, that's an easy one. May be you should start learning Perl, rather than asking other people to do your work or your homework for you.

Re^4: Tree in perl
by saurabh2k26 (Initiate) on Nov 17, 2014 at 18:45 UTC
    I am trying to removing syntax error from your code, but no success. Can you check it.

      Hi,

      just checked it again: My code (McA) doesn't have an syntax error. At least not on my machine. So, show us what your perl version is saying about the code.

      McA

        syntax error at t.pl line 11, near "+ }"

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-19 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found