juo has asked for the wisdom of the Perl Monks concerning the following question:
If I use : use strict; my script will fail with the following error : Can't use string ("L0") as a SCALAR ref while "strict refs" in use at compgui2.pl line 109. If I declare my $$lentry I got the following error : Can't declare scalar deref in my at compgui2.pl line 29, near "$lentry =" BEGIN not safe after errors--compilation aborted at compgui2.pl line 60. If I don't use strict it works fine. Anybody knows how to get around it and still use strict.
for($i=0;$i<$size;$i++) { if ($size <= 10) { use integer; my $val = $hash{dataParams}->{$keys[$i]}->{val}; my $lentry ='L'.$count; my $$lentry = $W->Label( -text => "$keys[$i]".": $val ", -width => 20, -background => 'white', -foreground => 'black'); Tk::grid($$lentry, -row => $i, -column => 0, -sticky => 'w', -padx => 10, -pady => 10, ); my $closeButton = $W->Button( -text => 'close', -command => [\&exit], -width => 7, -height => 1, ); my $brow = $size + 1; Tk::grid($closeButton, -row => $brow, -column => 0, -sticky => 'w', -padx => 10, -pady => 10, ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems to use strict with dynamic $$variable
by japhy (Canon) on Jun 06, 2001 at 18:05 UTC | |
|
Re: Problems to use strict with dynamic $$variable
by davorg (Chancellor) on Jun 06, 2001 at 18:14 UTC | |
|
Re: Problems to use strict with dynamic $$variable
by mirod (Canon) on Jun 06, 2001 at 18:09 UTC | |
|
Re: Problems to use strict with dynamic $$variable
by clintp (Curate) on Jun 06, 2001 at 18:25 UTC | |
|
Re: Problems to use strict with dynamic $$variable
by tachyon (Chancellor) on Jun 06, 2001 at 18:41 UTC | |
|
(tye)Re: Problems to use strict with dynamic $$variable
by tye (Sage) on Jun 06, 2001 at 20:36 UTC |