Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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.

Replies are listed 'Best First'.
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?
[Discipulus]: why github use 'pull request' instead of 'push request'? where is the subject?
[Discipulus]: I'm the subject or is the program? i think i always am the subject
[erix]: it an invite to pull, as I understand it
[Discipulus]: Concave or convex?
[Discipulus]: who make the invitation? the program?!?
[choroba]: it's historical
[erix]: pull requests
[choroba]: originally, you sent a pull request to someone by email, i.e. you asked them to pull from your repo
[Discipulus]: if is the author of a patch, is more like a 'request to push' into rather than a pull request..
[choroba]: as it's considered unpolite to push to someone else's repo

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-05-27 20:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?