in reply to union, intersection, and difference

@{ ... } is a dereferencing operation. It's useful to note that the { ... } is just a normal code block and can contain any code you want, as long as it returns an array reference.

For instance, you could call a subroutine which returns an array reference:

foreach my $case ( $justice_wheels->spin() ) { my $verdict = Conviction::Felony->new( $case->defendant() ); push @{ $case->defendant()->get_felony_convictions() }, $verdict; push @{ $case->judge()->get_felony_convictions() }, $verdict; }

Yep, definitely feeling silly today...

Chris
M-x auto-bs-mode

Replies are listed 'Best First'.
Re: Re: union, intersection, and difference
by trowa (Acolyte) on May 02, 2002 at 22:20 UTC
    Ahhh... pretty cool, I'll be using ? definitely more in the future. Thanks!