Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re (tilly) 1: Silly Roommate Tricks

by tilly (Archbishop)
on May 26, 2001 at 20:45 UTC ( [id://83510]=note: print w/replies, xml ) Need Help??


in reply to Silly Roommate Tricks

Did you actually try running a test of what happens if you require strict and then try to do something that strict will block?

You will find that the declaration is utterly useless.

The reason is that all of the magic of strict is buried in what the import method of strict does to the parsing of your code at compile time. A simple require loads strict too late (ie at runtime) and does not call the import method.

See Re (tilly) 1: How does strict work? for a longer explanation of how exactly strict works.

Oh, and let this be a lesson. As one Alexander Pope said:

A little learning is a dangerous thing;
Drink deep, or taste not the Pierian spring:
There shallow draughts intoxicate the brain,
And drinking largely sobers us again.
But as Aldous Huxley observed:
If a little knowledge is dangerous, where is the man who has so much as to be out of danger?
Certainly I don't! Which is why before I told you that what you were doing was useless I ran the following test of knowledge I imagine I have:
perl -e 'require strict; print $foo = "Hello\n"'
And only armed with this verification did I write this post...

Replies are listed 'Best First'.
Re: Re (tilly) 1: Silly Roommate Tricks
by mpolo (Chaplain) on May 26, 2001 at 21:22 UTC
    I think wombat understands completely that "require strict" is useless. After all, he says, "Therefore you can say 'require strict;' at the top of your code, and then still use the sloppy regular code conventions". I.e., it is useless -- it doesn't prevent sloppy variables, it doesn't hit you up for barewords, etc. It's just a "Silly Roommate Trick".

    wombat's point, it seems, is that while useless, "require strict;" is not "masochistic".

      wombat's point, it seems, is that while useless, "require strict;" is not "masochistic".

      No, it is "sadistic". Something to torture your roomate with :)

Log In?
Username:
Password:

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

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

    No recent polls found