Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

our variables or subroutines cannot be called from outside scope #2727

Closed
p6rt opened this issue Apr 27, 2012 · 5 comments
Closed

our variables or subroutines cannot be called from outside scope #2727

p6rt opened this issue Apr 27, 2012 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Apr 27, 2012

Migrated from rt.perl.org#112632 (status was 'rejected')

Searchable as RT112632$

@p6rt
Copy link
Author

p6rt commented Apr 27, 2012

From phiroc@free.fr

Perl6 version​: 2012.04.1

{
  our $truc = 'machin';
  our sub eat() {
  say "om nom nom";
  }
}
say $truc;
eat();

[This code comes from the Perl6 Tutorial]

Result​:

===SORRY!===
Variable $truc is not declared

If you remove say $truc, you will get the following error message​:

Undefined routine '&eat' called (line 15)

@p6rt
Copy link
Author

p6rt commented Apr 28, 2012

From @masak

Thank you for bringing this to our attention.

It used to be you could use 'our' like below, but not anymore. Now you
must declare a variable in any scope you use it, including 'our'
variables. This is a change that happened with the nom refactor.

Do you have the URL for "the Perl 6 Tutorial"? It needs updating.

Rejecting ticket.

On Fri Apr 27 06​:56​:04 2012, phiroc@​free.fr wrote​:

Perl6 version​: 2012.04.1

{
our $truc = 'machin';
our sub eat() {
say "om nom nom";
}
}
say $truc;
eat();

[This code comes from the Perl6 Tutorial]

Result​:

===SORRY!===
Variable $truc is not declared

If you remove say $truc, you will get the following error message​:

Undefined routine '&eat' called (line 15)

@p6rt
Copy link
Author

p6rt commented Apr 28, 2012

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 28, 2012

@masak - Status changed from 'open' to 'rejected'

@p6rt p6rt closed this as completed Apr 28, 2012
@p6rt
Copy link
Author

p6rt commented Apr 30, 2012

From phiroc@free.fr

Hi,

sorry, I don't have the URL. However, the PDF is included with the Rakudo source.

Best regards,

Philippe

Le 28 avr. 2012 à 13​:09, Carl Mäsak via RT a écrit :

Thank you for bringing this to our attention.

It used to be you could use 'our' like below, but not anymore. Now you
must declare a variable in any scope you use it, including 'our'
variables. This is a change that happened with the nom refactor.

Do you have the URL for "the Perl 6 Tutorial"? It needs updating.

Rejecting ticket.

On Fri Apr 27 06​:56​:04 2012, phiroc@​free.fr wrote​:

Perl6 version​: 2012.04.1

{
our $truc = 'machin';
our sub eat() {
say "om nom nom";
}
}
say $truc;
eat();

[This code comes from the Perl6 Tutorial]

Result​:

===SORRY!===
Variable $truc is not declared

If you remove say $truc, you will get the following error message​:

Undefined routine '&eat' called (line 15)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant