in reply to Re^5: Splitting array into two with a regex
in thread Splitting array into two with a regex

You're just looking at it sideways. {grin}

The method needs to return an arrayref, which is then dereferenced by the @, and can thus be used in an lvalue context.

my $rec = bless {}; # main is the package my @sideeffected = qw(a b c); sub vals { return \@sideeffected } @{$rec->vals()} = qw(d e f); print "$_\n" for @sideeffected;
That prints d\ne\nf\n. Maybe you thought I was talking about the inner part? I was talking about the whole string of text from the "@" to the "}".

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^7: Splitting array into two with a regex
by ikegami (Patriarch) on Nov 08, 2005 at 19:52 UTC
    ah yes! My eyes must have been crossed ;)