Skip to content

strict: semicolon, not explicit package name #7571

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

Closed
p5pRT opened this issue Oct 31, 2004 · 7 comments
Closed

strict: semicolon, not explicit package name #7571

p5pRT opened this issue Oct 31, 2004 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 31, 2004

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

Searchable as RT32248$

@p5pRT
Copy link
Author

p5pRT commented Oct 31, 2004

From @jidanni

You might want to tighten up the error messages in​:

$ perl -we 'use strict; my %t=() print %t'
syntax error at -e line 1, near ") print"
Global symbol "%t" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

The problem is just a missing ";".

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2004

From @nwc10

On Sun, Oct 31, 2004 at 10​:50​:15PM -0000, Dan Jacobson wrote​:

# New Ticket Created by Dan Jacobson
# Please include the string​: [perl #32248]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org​:80/rt3/Ticket/Display.html?id=32248 >

You might want to tighten up the error messages in​:

$ perl -we 'use strict; my %t=() print %t'
syntax error at -e line 1, near ") print"
Global symbol "%t" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

The problem is just a missing ";".

Patches welcome.

Have you any idea how hard it is to make the parser realise this?

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2004

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

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2004

From @nwc10

If you'd taken out use strict; you'd've realised that this message has
nothing to do with it.

The quality of your bug reports is consistently dire.

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2004

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

@p5pRT p5pRT closed this as completed Nov 1, 2004
@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2004

From @ysth

On Sun, Oct 31, 2004 at 10​:50​:15PM -0000, Dan Jacobson <perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Dan Jacobson
# Please include the string​: [perl #32248]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org​:80/rt3/Ticket/Display.html?id=32248 >

You might want to tighten up the error messages in​:

$ perl -we 'use strict; my %t=() print %t'
syntax error at -e line 1, near ") print"
Global symbol "%t" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

The problem is just a missing ";".

Compilers in general almost always try to continue after an error; this
enables them to report multiple actual errors in one pass. The usual
way this is accomplished is to discard tokens from the input until
what's left is a valid program. This often does result in more than
one error message per actual error. Taking the other approach, and
sometimes adding tokens until a valid program is achieved is much more
difficult; you have to decide whether to add or discard tokens, and if
adding, decide what and where to add.

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2004

From [email protected]

On Oct 31, Dan Jacobson said​:

# New Ticket Created by Dan Jacobson
# Please include the string​: [perl #32248]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org​:80/rt3/Ticket/Display.html?id=32248 >

$ perl -we 'use strict; my %t=() print %t'
syntax error at -e line 1, near ") print"
Global symbol "%t" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

The problem is just a missing ";".

But it doesn't necessarily know that. The problem Perl sees is that
you're using %t before it has been declared.

  use strict;
  my $x = $x; # yields the "global symbol" error

And anyway, Perl told you about the syntax error in the '() print'
vicinity.

--
Jeff "japhy" Pinyan % How can we ever be the sold short or
RPI Acacia Brother #734 % the cheated, we who for every service
http​://japhy.perlmonk.org/ % have long ago been overpaid?
http​://www.perlmonks.org/ % -- Meister Eckhart

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