Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl6, modifying @*INC

by moritz (Cardinal)
on Aug 05, 2010 at 15:49 UTC ( #853170=note: print w/ replies, xml ) Need Help??


in reply to Perl6, modifying @*INC

BEGIN{ push @*INC, 'C:\Rakudo\lib';}

Add a space before the opening curly: BEGIN { @*INC.push( 'C:\Rakudo\lib' );}

The reason is that {...} directly after a statement is parsed as a postcircumfix, which is very handy if you want to access hash elements like %hash{$key} (but which is intentionally not special-cased to hashes).

The error message could be improved, though.

Perl 6 - links to (nearly) everything that is Perl 6.


Comment on Re: Perl6, modifying @*INC
Select or Download Code
Re^2: Perl6, modifying @*INC
by molecules (Monk) on Aug 05, 2010 at 16:17 UTC
    Thanks!

    I also noticed that the indirect method syntax for push doesn't work inside the BEGIN block. I wasn't sure if that was a feature or something still to be done.
      It's a well-known bug. Unfortunately we have some roadmap items to complete before we can fix that - we need to have static lexical pads at compile time to make built-in functions available in BEGIN blocks.
      Perl 6 - links to (nearly) everything that is Perl 6.
        Thanks.

        I was just curious. I can't complain because I haven't helped develop Rakudo. :)

        Thanks for all of your work on Rakudo.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-12-27 00:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls