in reply to Turn 2 lines into 1

$current_board[$x] = \@{split('-',$current_board[$x])};
-Mark

Replies are listed 'Best First'.
Re^2: Turn 2 lines into 1
by Aristotle (Chancellor) on Jul 19, 2002 at 18:55 UTC

    Nope, that doesn't work. @{} dereferences an array ref; but split returns an array, not a reference.

    The solution we are looking for here is $current_board[$x] = [ split('-',$current_board[$x]) ]; Similarly to [ ] that builds an anonymous array, { } builds an anonymous hash and returns a reference to it. Of interest: perlref/perlreftut (=references + ref tutorial), perldsc (= data structures cookbook) and perllol (= lists of lists).

    Makeshifts last the longest.