Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: white spaces between the sigil and the variable ( $ x = )

by JavaFan (Canon)
on Oct 27, 2008 at 22:57 UTC ( [id://719854]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://719854]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2026-01-15 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.