in reply to Re^2: Tk warning using curselection() with ActiveState 5.8.4
in thread Tk warning using curselection() with ActiveState 5.8.4
How come this no longer works?
Because you changed your code and added a wantarray perhaps? You are assigning SCALAR context to the return value of your curselection function by using it as an array index. According to Perl it is returning an array ref. This is not a valid index. In your working example you assign ARRAY context to the function call, then that array is evaluated in SCALAR context in the index. Your issue would occur as you say if you had:
sub curselection { # # was return @array; return wantarray ? @array : \@array; }
The @$ and $$ issues relate to their precedence being higher than -> so you need @{$a->blah}
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Tk warning using curselection() with ActiveState 5.8.4
by pg (Canon) on Sep 30, 2004 at 04:00 UTC |