Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Recalcitrant placeholders

by choroba (Cardinal)
on Jul 05, 2021 at 22:40 UTC ( [id://11134686]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Recalcitrant placeholders
in thread Recalcitrant placeholders

Who complains? Perl or the database?

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: Recalcitrant placeholders
by Bod (Parson) on Jul 05, 2021 at 22:53 UTC

    Perl complains

      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". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-03-28 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found