Hi,

On 03/04/2013 17:00, Steve Cookson wrote:

Question 1: Does it really need two "use strict"s, clearly you can never
have enough, but doesn't the first one have a greater scope than the
second is not necessary.

I imagine in is just template code for a package that gets you the extra strict.

Question 2: on "use Wx", again, doesn't the first "use Wx" just cause a
crash if you have wxWidgets less than 0.15, which is unlikely these
days, but "use Wx qw[:everything];" should be enough?

It's a wiki entry:

http://wiki.wxperl.nl/WxEXPORTS

Also,

use Wx qw[ :everything ];

imports everything into the current namespace - which in your wxGlade example is 'package appointments'.

Let's imagine for a moment that instead of use Wx qw[ :allclasses]; at the top of the script it had use Wx qw[ :everything ]; there too.

Consider the exported constant wxBORDER_NONE.

You would have two instances of this:

main::wxBORDER_NONE
appointments::wxBORDER_NONE

and which, if any, got used when your code contained the bare wxBORDER_NONE would depend on package scope.

So in default package main, main::wxBORDER_NONE would get used, in package appointments, appointments::wxBORDER_NONE would get used. Anywhere else, bare wxBORDER_NONE is an error.


Cheers

Mark


















Reply via email to