in reply to Re: vec and array parameters
in thread vec and array parameters

I thought of that too, but if you try to use my_vec on the left side of an assignment, you get:
Can't modify non-lvalue subroutine call at testvec.pl line 10.

Replies are listed 'Best First'.
Re: Re: Re: vec and array parameters
by duff (Parson) on Jan 07, 2004 at 17:44 UTC

    Oh, then just make your sub an lvalue sub like so:

    sub my_vec : lvalue { vec($_[0],$_[1],$_[2]) }

    Caveat scriptor, I didn't test this at all and I'm sure you need a modernish perl for it to work.