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

Re^2: Data type validation using regular expressions

by naikonta (Curate)
on May 27, 2007 at 16:36 UTC ( [id://617749]=note: print w/replies, xml ) Need Help??


in reply to Re: Data type validation using regular expressions
in thread Data type validation using regular expressions

use warnings; # Already on with -w, but doesn't hurt to be explicit
How is -w less explicit than use warnings;, as far as enabling warning is concerned?

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Replies are listed 'Best First'.
Re^3: Data type validation using regular expressions
by liverpole (Monsignor) on May 27, 2007 at 22:27 UTC
    Maybe it's just me; I feel like it's more explicit when I see it together with strict, spelled out:
    use strict; use warnings;

    But I confess that I still don't trust -w on Windows (even though I now know it works perfectly well), because Windows ignores the first part of the shebang line.  To test this, you can do:

    #!/usr/path/which/does/not/exist/perl

    and it'll still run Perl correctly.  Granted this isn't a reason to stop using -w, which still does work as I mentioned, but it did make me suspicious of the whole top line for quite a while.


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
      Don't get me wrong :-) I always use warnings ever since I knew it instead of -w switch. Being a pragma gives it more power and flexibilities. I don't use Windows but I knew from the start that shebang doesn't work on it, althought Apache seems to honor the switches. However, one should take advantage of the pl2bat converter to keep his/her original switches attached to the shebang.

      Still, whenever I see -w with the shebang I won't bother to change it to use warnings; or recommend to do so (unless one needs more control on warnings), it's still equally explicit, and still perfect for me (with use strict; of course) :-)


      Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found