Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How do you get around the lexical scoping of use pragmas?

by Copper Maiden (Acolyte)
on Aug 27, 2006 at 00:35 UTC ( [id://569846]=note: print w/replies, xml ) Need Help??


in reply to How do you get around the lexical scoping of use pragmas?

>_> Not exactly the answer I was looking for, but thanks anyway.

By the way, could this be considered a bug? It seems like a big, unnecessary inconvenience. Or maybe it's just my irrational hatred of repeating code...

Replies are listed 'Best First'.
Re^2: How do you get around the lexical scoping of use pragmas?
by GrandFather (Saint) on Aug 27, 2006 at 00:40 UTC

    Not a bug, but a very good case can be made for having strictures enabled by default. One has only to notice that about 30% of the "why doesn't this work" questions in SoPW would have been caught by OP if strictures had been included in OP's code to see that that is a good idea.


    DWIM is Perl's answer to Gödel

      There are a number of things I'd like to see done differently by default in Perl, including the strict pragma being on by default (though I'm not so sure about warnings) — and also default lexical scope so that I don't have to use my() all the time, and so that autovivification would create lexically scoped variables.

      print substr("Just another Perl hacker", 0, -2);
      - apotheon
      CopyWrite Chad Perrin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-03-29 04:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found