Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: require and use strict vars

by LanX (Saint)
on Dec 02, 2021 at 18:09 UTC ( [id://11139325]=note: print w/replies, xml ) Need Help??


in reply to require and use strict vars

$Data::Dumper::Indent is fully qualified , you don't need resp. can't declare it.

Workarounds:

  • you can disable the specific warning
  • eval the use and your settings
D:\tmp>perl use strict; use warnings; eval <<'__CODE__'; use Data::Dumper; $Data::Dumper::Indent = 0; __CODE__ __END__ D:\tmp>

update

Full demo:

NB: in order to use Dumper w/o parens or leading '&'-sigil you will need to declare it at compile time with subs

D:\tmp>perl use strict; use warnings; #use subs qw/Dumper/; eval <<'__CODE__'; use Data::Dumper; $Data::Dumper::Indent = 0; __CODE__ print Dumper( [map {{$_=>$a++}} "a".."d"] ); __END__ $VAR1 = [{'a' => 0},{'b' => 1},{'c' => 2},{'d' => 3}]; D:\tmp>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: require and use strict vars
by karlberry (Sexton) on Dec 02, 2021 at 18:44 UTC
    wow. would not have come up with that. thanks.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found