Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Code Review Time!

by thundergnat (Deacon)
on Mar 15, 2012 at 16:01 UTC ( #959806=note: print w/replies, xml ) Need Help??

in reply to Code Review Time!

Umm. wow. You've got some problems here. Ok, to very narrowly answer your question; the error:

No -label at C:/strawberry/perl/site/lib/Tk/ line 256.

is caused by your menu commands not having any -label parameter. -text (or in this case, text) is not a valid parameter name for a Tk menu command. Look up valid parameters in perldoc Tk::Menu under $menu->add(type, ?option, value, option, value, ...?)

Some other problems that jumped out after a brief perusal:

There's no menu method seperator, it is spelled separator. Weird since you have it spelled correctly in some places, not in others.

The array and value being pushed are reversed in several push operations. push @list, $id; not push $id, @list;

You are missing a sigil on $key in line 237: $conf->{$key} = $value; not $conf->{key} = $value;

Seriously, activate the warnings and strict pragmas and fix or at least investigate everything that they report. If you are a fairly new Perl programmer it is worth it. Yes, turning them on will make perl complain about things that are not necessarily "wrong", but it will reduce the effort you need to spend debugging by orders of magnitude.

Replies are listed 'Best First'.
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2019-04-20 04:11 GMT
Find Nodes?
    Voting Booth?
    I am most likely to install a new module from CPAN if:

    Results (108 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!