http://qs1969.pair.com?node_id=1150165


in reply to Re^3: Declaring with my, assigning, and testing in same line (attributes)
in thread Declaring with my, assigning, and testing in same line

> I'm fine with using tie as long as I can untie when I'm done. Otherwise the penalty for this syntactic sugar would be to huge.

At second thought this is a too limited technique... consider

while(1) { my $x :check = some_call(); }

The check would be done only once, so in this case I'd clearly prefer a functional approach

while(1) { check {RULE} my $x = some_call(); }

Using attributes is a pretty way to apply ties, but most use cases I can think of combining this with untie are limited to debugging.

> > > And for completeness , I'm sure you could also use variable :attributes for such checks.

Wrong I was, young padawan. ;-)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!