FAQ
Just wondering.

After I debug my perl scripts do I still need the strict and warnings
flags?

Does it hurt performance having them?

Does it hurt security removing them?

The scripts are for system admin only, not CGI where I would assume
they should be left in.

Thanx!

-Michael

Search Discussions

  • John W. Krahn at Jun 4, 2003 at 8:45 pm

    Michael Weber wrote:

    Just wondering.

    After I debug my perl scripts do I still need the strict and warnings
    flags? No.
    Does it hurt performance having them? No.
    Does it hurt security removing them? No.
    The scripts are for system admin only, not CGI where I would assume
    they should be left in.
    Having strictures and warnings enabled does not guarantee that the code
    will be correct or robust or secure. They are only provided to help you
    find obvious mistakes.


    John
    --
    use Perl;
    program
    fulfillment
  • James Edward Gray II at Jun 4, 2003 at 8:58 pm

    On Wednesday, June 4, 2003, at 03:45 PM, John W. Krahn wrote:

    Does it hurt performance having them?
    No.
    Are we sure about this? I find it really hard to believe that
    'warnings' isn't affecting performance on some level. I doubt it's a
    big hit, but I would be very surprised if it doesn't cost something.

    James
  • John W. Krahn at Jun 4, 2003 at 9:15 pm

    James Edward Gray II wrote:
    On Wednesday, June 4, 2003, at 03:45 PM, John W. Krahn wrote:

    Does it hurt performance having them?
    No.
    Are we sure about this? I find it really hard to believe that
    'warnings' isn't affecting performance on some level. I doubt it's a
    big hit, but I would be very surprised if it doesn't cost something.
    Well, you could always use the Benchmark module to test your theory.

    :-)

    John
    --
    use Perl;
    program
    fulfillment
  • Paul Johnson at Jun 4, 2003 at 9:16 pm

    On Wed, Jun 04, 2003 at 03:58:44PM -0500, James Edward Gray II wrote:
    On Wednesday, June 4, 2003, at 03:45 PM, John W. Krahn wrote:

    Does it hurt performance having them?
    No.
    Are we sure about this? I find it really hard to believe that
    'warnings' isn't affecting performance on some level. I doubt it's a
    big hit, but I would be very surprised if it doesn't cost something.
    Yep, there's a tiny hit. I would expect the number of applications
    where it is significant to be vanishingly small. Perl, the program, is
    lovingly crafted to ensure that turning on warnings does not cause a
    performance problem.

    Try it and see.

    --
    Paul Johnson - paul@pjcj.net
    http://www.pjcj.net
  • Tassilo von Parseval at Jun 5, 2003 at 5:33 am

    On Wed, Jun 04, 2003 at 03:58:44PM -0500 James Edward Gray II wrote:
    On Wednesday, June 4, 2003, at 03:45 PM, John W. Krahn wrote:

    Does it hurt performance having them?
    No.
    Are we sure about this? I find it really hard to believe that
    'warnings' isn't affecting performance on some level. I doubt it's a
    big hit, but I would be very surprised if it doesn't cost something.
    Perl internally uses a bit-mask to determine when to warn (stored in
    ${^WARNINGS_BITS}). When interpreting a script perl has to check against
    this bitmask regardless of whether warnings are turned on or not,
    therefore there's no change in run-time performance.

    Tassilo
    --
    $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
    pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
    $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
  • Rob Dixon at Jun 5, 2003 at 7:55 am

    James Edward Gray II wrote:
    On Wednesday, June 4, 2003, at 03:45 PM, John W. Krahn wrote:

    Does it hurt performance having them?
    No.
    Are we sure about this? I find it really hard to believe that
    'warnings' isn't affecting performance on some level. I doubt it's
    a big hit, but I would be very surprised if it doesn't cost
    something.
    Hi James.

    I know you weren't suggesting to the contrary, but as I keep saying
    (although nobody seems to agree with me) it's pointless to worry
    about the speed of the program unless it's too slow. It's worth
    noting that we have a lot of questions about whether such-and-such
    a construct has a performance hit, but almost never about
    unnacceptably slow programs that need speeding up. I doubt if
    it's because all of the optimisation tips are taken to heart!

    It's twenty or thirty years since we had to write programs carefully
    so that they would fit in 4KB of RAM and complete before the end of
    the day.

    Cheers,

    Rob
  • R. Joseph Newton at Jun 7, 2003 at 1:48 am

    Rob Dixon wrote:

    It's twenty or thirty years since we had to write programs carefully
    so that they would fit in 4KB of RAM and complete before the end of
    the day.
    OGawd Rob,

    Don't tell me you were around for that! I do remember my first computer
    c. 1984, a closeout score of a Timex-Sinclair 1000. The extra RAM back
    [about 10x20x40 cm and 100 ro so grams] kicked it up to a whopping 16K.

    Things have come a way, huh?

    Joseph
  • Rob Dixon at Jun 7, 2003 at 8:00 am

    R. Joseph Newton wrote:
    Rob Dixon wrote:
    It's twenty or thirty years since we had to write programs carefully
    so that they would fit in 4KB of RAM and complete before the end of
    the day.
    OGawd Rob,

    Don't tell me you were around for that! I do remember my first computer
    c. 1984, a closeout score of a Timex-Sinclair 1000. The extra RAM back
    [about 10x20x40 cm and 100 ro so grams] kicked it up to a whopping 16K.

    Things have come a way, huh?
    So my father tells me ;-)

    Rob
  • Todd Wade at Jun 6, 2003 at 5:11 am
    "Michael Weber" <mweber@alliednational.com> wrote in message
    news:sede0dfb.021@mail-2.alliednational.com...
    Just wondering.

    After I debug my perl scripts do I still need the strict and warnings
    flags?

    Does it hurt performance having them?

    Does it hurt security removing them?

    The scripts are for system admin only, not CGI where I would assume
    they should be left in.
    My large programs usually have a state object. What I like to do is look at
    a warning as an event and set my own handler for $SIG{__WARN__} that emails
    me my state object ala Data::Dumper.

    So at that point I consider warmings a requirement and not a development
    option.

    Todd W.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedJun 4, '03 at 8:19p
activeJun 7, '03 at 8:00a
posts10
users8
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase