in reply to Script Issues

at the top of your script ALWAYS:
use strict; use warnings;

Replies are listed 'Best First'.
Re^2: Script Issues
by Anonymous Monk on Apr 08, 2016 at 01:15 UTC
    How would that help with this script?

      From the OP:

      I am not a Perl guru, so I am looking for some assistance. I have been through numerous trouble shooters ... This script was given to me ... I appreciate anybody's help ... I would like to learn Perl ...
      Iowachaser is a Perl tyro and needs to change a Perl script, perhaps radically. warnings are already enabled globally with the  -w switch (assuming the shebang line is being interpreted — a big assumption), but are better used in a smaller scope. Enabling strictures with strict will enforce a number of syntactic requirements that will make a novice's life much easier. Use of these two modules in the revised script (and future scripts) will enable Perl to give Iowachaser some assistance and help even when all the trouble shooters have gone home (or off-line).


      Give a man a fish:  <%-{-{-{-<

        :D

        That still doesn't explain how strict/warnings is relevant to this OPs script specifically

        If the advice is going to be very generic, might be as well always suggest reading Tutorials and Modern Perl and google

      It helps us, if the OP does at least some rudimentary checking by himself before posting.

      It helps him, because "clean" questions (this includes indentation) attract more and better support.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

        It helps us, if the OP does at least some rudimentary checking by himself before posting. It helps him, because "clean" questions (this includes indentation) attract more and better support.

        This is a requirement for posting? And if the OP doesn't know to do any of this checking?

        Compare to this answer Re: Script Issues, which answers the OPs question directly -- and politely reminds about strict -- doesn't demand anything and has something more to offer than generic RTFM

      Global symbol "@show" requires explicit package name at H:\Users\James +\Dropbox\perl\scripts\header\New folder\lwp.pl line 5. Global symbol "$x" requires explicit package name at H:\Users\James\Dr +opbox\perl\scripts\header\New folder\lwp.pl line 22. Global symbol "$x" requires explicit package name at H:\Users\James\Dr +opbox\perl\scripts\header\New folder\lwp.pl line 23. Global symbol "@show" requires explicit package name at H:\Users\James +\Dropbox\perl\scripts\header\New folder\lwp.pl line 30.
      Those are all errors, which the script does run, it still has errors which can come back and bite you on the ass. The script runs fine for me though, just thought I would point out to always use strict and use warnings since he is a "beginner"

        Don't feed the trolls!

        Don't reply to anonymous posters!

        They just want attention.


        The way forward always starts with a minimal test.