On Tue, Nov 24, 2009 at 07:51:41AM -0500, Steve Tolkin wrote:

> Is it possible to use dot notation in Perl 5, possibly by installing a
> module etc.?
> 
> If so, please send a link to  a moderately small working example.
> 
> Can the parentheses be omitted when there are no arguments?
> 
> e.g.   if ($s.er)  # where er() is a method

Maybe you could use overload to achieve this.  Of course, you then have
to decide what to do with the . (concatenation) operator, which is maybe
why I've never seen it done.

> Can it be mixed this with regular function notation?
> 
> e.g.  w($s.er)

*If* it can be done with use overload, then I don't see why not.

> Can the dot notation be used of the LHS of an assignment to actually store a
> value?
> 
> e.g.  $s.er = "foo";

If er() is an lvalue subroutine then maybe.

> If so, would the following be valid, or do I need to use something like
> memoization instead?
> 
> e.g.  $s.er = $s.er;

I don't see why it couldn't work.  I also don't see what this has to do
with memoizing.  Perhaps you need to explain more what you're trying to
do.

-- 
David Cantrell | Nth greatest programmer in the world

  For every vengeance, there is an equal and opposite revengeance.
                                            -- Cartoon Law X

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to