in reply to Re^3: white spaces between the sigil and the variable ( $ x = )
in thread white spaces between the sigil and the variable ( $ x = )

$foo{ three } = $doit->( 1 ); $quux{ two } = get_that( 25 );
There. All better now :) (And (probably?) compatible with Perl 6)
I think it fails in at least three ways:
  1. When accessing a hash element, the sigil in Perl6 is %, not $.
  2. The autoquoting shortcut has been replaced with a construct that requires as many keystrokes as using quotes. I'm not quite sure what %foo{three} does in Perl6, but I think it's the same as %foo{three()}. The Perl5 equivalent of $foo{three} is %foo{'three'} or %foo<<three>>. The latter can also be written using some Latin-1/Unicode character, but I can't be bothered to look up its code. It's a character that isn't on a standard US keyboard. But someone out there who held on to his APL keyboard will be very happy with Perl6.
  3. The arrow is gone. Perl bows its head to Java, and uses a dot. So it's $doit.(1). Or maybe &doit.(1), just as one uses % to access a hash element.

Replies are listed 'Best First'.
Re^5: white spaces between the sigil and the variable ( $ x = )
by BrowserUk (Patriarch) on Oct 27, 2008 at 23:36 UTC

    I meant whitespace-wise. That you don't have to give up (subjectively) good formatting, because Perl 6 doesn't allow spaces between the identifier and the open paren/curly/bracket.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.