Jan 29, 2001, 12:49 PM
Post #1 of 6
I'm currently coding a program, and I want it to have the best code that I can produce. So I have some very assorted questions.
This over that (Misc. perl questions)?
Which is better, or . What's the difference between them?
I've heard it's always better to code with in there. Everytime I put that in my programs I get a complication error. What limitations does strict put on your code, why is it better, and how to I get my scripts to function right with this on? Are there any documents explaining this?
When I open a file for just reading, should I always have it be , or is it fine to just leave it as ? Does the < do anything to it?
When I open a file, which is better, this:
, or this:
open (FILE, ">file.txt") || die $!;
? What is the difference between using ||, or using 'or'.
open (FILE, ">file.txt") or die $!;
When I'm opening a file just for reading, is it really neccessary to lock it? Also, I always skip unlocking files because when you close it, it gets unlocked anyway, so why add in the code and extra time to the user?
Any other general things you guys do when creating scripts?
Thanks guys, I appreciate it all. :)