Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm creating an app using wxperl and would like to use scalars to define my styles which are constants. For instance if creating a TextCtrl the code would look something like this:
I'm unable to use a scalar in place of wxTE_MULTILINEWx::TextCtrl->new( $self, -1, "", [5, 10], [-1, -1], wxTE_MULTILINE );
I've tried the following:
Is this even possible? If so what am I doing wrong?use vars qw($constantstring); my $style = 'wxTE_MULTILINE'; *constantstring=\"$style"; Wx::TextCtrl->new( $self, -1, "", [5, 10], [-1, -1], $style );
Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Using a scalar as a constant?
by Corion (Patriarch) on Oct 15, 2008 at 12:54 UTC | |
by Anonymous Monk on Oct 15, 2008 at 13:26 UTC | |
by Corion (Patriarch) on Oct 15, 2008 at 13:29 UTC | |
by JavaFan (Canon) on Oct 15, 2008 at 14:10 UTC | |
by suaveant (Parson) on Oct 15, 2008 at 14:22 UTC | |
| |
by Anonymous Monk on Oct 15, 2008 at 13:56 UTC | |
by Anonymous Monk on Oct 15, 2008 at 13:46 UTC | |
by Anonymous Monk on Oct 15, 2008 at 14:00 UTC | |
Re: Using a scalar as a constant?
by JavaFan (Canon) on Oct 15, 2008 at 13:21 UTC | |
by Anonymous Monk on Oct 15, 2008 at 13:35 UTC | |
by gone2015 (Deacon) on Oct 15, 2008 at 15:42 UTC |
Back to
Seekers of Perl Wisdom