Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Perl complains

Like that?

/tmp>cat at.pl #!/usr/bin/perl use strict; use warnings; use feature 'say'; say '@foo!'; say "\@bar!"; say "@bang!"; /tmp>perl at.pl Possible unintended interpolation of @bang in string at at.pl line 9. Global symbol "@bang" requires explicit package name (did you forget t +o declare "my @bang"?) at at.pl line 9. Execution of at.pl aborted due to compilation errors. /tmp>

Read the error messages. They are not just decoration. Think about what perl is trying to tell you. Hint: Search for the error messages in perldiag.

Update:

You can have perl do the lookup for you:

/tmp>cat at.pl #!/usr/bin/perl use strict; use warnings; use diagnostics; use feature 'say'; say '@foo!'; say "\@bar!"; say "@bang!"; /tmp>perl at.pl Possible unintended interpolation of @bang in string at at.pl line 10 +(#1) (W ambiguous) You said something like '@foo' in a double-quoted st +ring but there was no array @foo in scope at the time. If you wanted a literal @foo, then write it as \@foo; otherwise find out what happ +ened to the array you apparently lost track of. Global symbol "@bang" requires explicit package name (did you forget t +o declare "my @bang"?) at at.pl line 10. Execution of at.pl aborted due to compilation errors (#2) (F) You've said "use strict" or "use strict vars", which indicates that all variables must either be lexically scoped (using "my" or +"state"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::"). Uncaught exception from user code: Global symbol "@bang" requires explicit package name (did you +forget to declare "my @bang"?) at at.pl line 10. Execution of at.pl aborted due to compilation errors. /tmp>

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^5: Recalcitrant placeholders by afoken
in thread Recalcitrant placeholders by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-26 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found