in reply to Problems using Tk::ExecuteCommand
G'day marbu,
Welcome to the Monastery.
The code you posted was not the code that generated that error message. Please don't do that.
Most (if not all) of Tk's option/value pairs have a '-' before the option (e.g. -option => $value).
Your problem, in your real code, stems from writing pady, instead of -pady, in pack() (see Tk::pack).
Here's a working example:
$ perl -e 'use Tk; MainWindow->new()->Button(-text => "?")->pack(-pady + => 2); MainLoop'
Here's your error replicated:
$ perl -e 'use Tk; MainWindow->new()->Button(-text => "?")->pack(pady +=> 2); MainLoop' bad option "pady": must be -after, -anchor, -before, -expand, -fill, - +in, -ipadx, -ipady, -padx, -pady, or -side at /long/path/to/Tk/Widget +.pm line 1217. at -e line 1.
Here's another example (with '-' omitted from the -text option in Button()):
$ perl -e 'use Tk; MainWindow->new()->Button(text => "?")->pack(-pady +=> 2); MainLoop' unknown option "text" at /long/path/to/Tk/Widget.pm line 205. at -e line 1.
See also Tk::options.
By the way, you can completely ignore the first answer you got which talked about "unixisms" and suggested threads would fix the problem. This looks like trollage to me: I downvoted it.
Update: Linkified the "the first answer you got" text. It now points to the actual node referenced.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problems using Tk::ExecuteCommand
by Anonymous Monk on Jul 09, 2021 at 03:21 UTC | |
by kcott (Archbishop) on Jul 09, 2021 at 06:14 UTC |