use strict or else;

runrig on 2004-09-14T05:28:57

I'm slightly further along in learning Wx, but was derailed for 15 minutes or so because I broke up my Wx::App and Wx::Frame subclasses into different files, and started using Wx::Panel. The Wx::Frame class no longer had "use strict;" (oops), and I had something like:

$frame->{panel} = Wx::Panel->new(...);
...and then later
$frame->{text_field} = Wx::TextCtrl->new(
  $panel,
  ..other args
);
$panel, of course, was undefined, as I meant to say my $panel = $frame->{panel} = Wx::Panel->new(...); in the first statement, but the program just exited at the second statement with no error (and without doing anything), and so it took awhile to find the where and why (with an abundance of "here I am"-type debug statements).


with pride

jdavidb on 2004-09-14T14:54:37

As I recall, there is a "use strict with pride" joke module that you can use that forces strict to apply everywhere, overriding the lexical scope of the pragma. :)

Re:with pride

Mr. Muskrat on 2004-09-14T16:08:31

Acme::use::strict::with::pride :)