Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: How can one input a textfile from desktop just created?

by Laurent_R (Canon)
on Mar 08, 2014 at 17:03 UTC ( [id://1077529]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How can one input a textfile from desktop just created?
in thread How can one input a textfile from desktop just created?

I avoid using "use strict;" in the script because "my" has to placed before every scalar and array variable. Moreover, I have noticed that "use strict;" sometimes does not give me the correct result from my script and the cmd shows a large number of warnings. Without the "use strict;" line in my script, I often get the desired result. That is why I avoid "use strict;" although I know that it detects the flaws in a script.

This is a tragic mistake. Any sane Perl programmer is always using use strict; for any program which is more than two lines. And your post is just a perfect example of it: with the use strict; pragma turned on, you would have known of your problem at compile time, even before your program started to run. And having to use my is really not a nuisance, but an excellent opportunity: to start with, the compiler will tell you about many of your mistakes (including simple typos) which might otherwise take you hours to track down. When you will know more Perl, you will also appreciate the capability of mastering the scope of a variable. And, no, using strictures will not change the result of your program, it will abort your program if it does not respect rules that you should really follow. Very seasoned programmers sometimes (rarely) turn off one of the strictures for a very limited part of the program to enable the use of a very special construct (magics), but it is usually (hopefully) when they really know what they are doing. Don't try to do it until you are really an expert. For the time being, always enable strictures, you will save a considerable amount od debugging time.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found