in reply to Re^6: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20 (demerphq mistaken?)
in thread use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20

The exception would be method calls.

$object->foo() # $-sigil, but does this return a scalar?

Obviously this is bracketed as:

($object)->foo()

... so the sigil does make sense: that particular subexpression returns a scalar. However, the expression as a whole could return a list.

Some people argue that method calls should always return a scalar; if you need to return more than one result, return an arrayref.

use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
  • Comment on Re^7: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20 (demerphq mistaken?)
  • Select or Download Code

Replies are listed 'Best First'.
Re^8: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20 (demerphq mistaken?)
by ikegami (Patriarch) on Dec 01, 2013 at 17:37 UTC

    Some people argue that method calls should always return a scalar; if you need to return more than one result, return an arrayref.

    Ironically, these are the people who would benefit the most from ->@*.