[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Fun with lvalue subs



In article <Xqbk5gzkga/G092yn@efn.org>, I wrote:
> sub my_substr ( $$;$$ ) : lvalue {
>     my $tiedval;
>     tie $tiedval, 'Lval', \ $_[0], @_[1,2] or die;
> 
>     if (@_ >= 4) {
> 	$tiedval = $_[3];
> 	my $retval = $tiedval; # someday, we'll be able to say my $x:const = $y
> 	"$retval";  de-lvalue it
>     } else {
> 	$tiedval;
>     }
> }
> 
> It also correctly returns the previous value of the substr range when
> there are 4 args.

Or did before I somehow switched the $tiedval= and =$tiedval lines around.
Oh well.

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe