in reply to list vs array context: odd error message...
Close, but no cigar. You were assigning an array (the @_) to a scalar, which translates to the number of elements in the array.
You want:
$hash{$1} = [split /,/, $2];
Which creates the anonymous arrayref you were mentioning, which lives quite happily as a scalar
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: list vs array context: odd error message...
by Hot Pastrami (Monk) on Dec 16, 2000 at 04:41 UTC | |
by merlyn (Sage) on Dec 16, 2000 at 04:50 UTC | |
by Hot Pastrami (Monk) on Dec 16, 2000 at 04:52 UTC | |
by swiftone (Curate) on Dec 16, 2000 at 04:51 UTC |