in reply to help using packForget()

These warnings are coming from strict

the idea of local $boom is to give the global $boom a local value so when you speak of $boom, here, it's a package global.

Also, If i recall, you can combine the calls to ->configure and ->new() when creating the widgets when using Tk to get a call somewhat like

$boom->Button((-text=>'Yes',-command=>\&des)->pack()
the trick there being to do it in the right order...

Sun Apr 29 04:30:14 UTC 2007 jonadab, mentions that what I say in relation to local is q{ if not outright wrong, is at least misleading }, I'd rather go with "over simplified". I am happy to stand corrected and point out that Coping with Scoping does a far better job of explaining that I ever will.

@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;

Replies are listed 'Best First'.
Re: help using packForget()
by jonadab (Parson) on Apr 28, 2007 at 15:36 UTC
    the idea of local $boom is to give the global $boom a local value so when you speak of $boom, here, it's a package global.

    This description, if not outright wrong, is at least misleading. The idea of local is to give the global variable a dynamic value for the time being, but allow it to be automagically restored to its former value later (when the current block exits). The distinction is important, because the dynamic value is global in nature, not local in the traditional sense. (Yes, local is misnamed.) Any other code that gets called, even from other packages, will see the dynamic value. Therein lies its value. In fact, you would ordinarily not use local on your own variables. For those you would typically use my or our or place them in a package namespace. local is more useful for dynamically scoping the package variables used by other code that you are calling, in order to adjust its behavior in some way. (In Perl this is most often special variables belonging to built-in code that is part of perl itself, but in principle it could also be global (or package) variables belonging to a module, as is common e.g. in elisp.)

    -- 
    We're working on a six-year set of freely redistributable Vacation Bible School materials.