Windows does NOT care about the path to Perl, BUT it does care about the -w (use warnings). This standard header will work on both Unix and Windows.#!/usr/bin/perl -w use strict;
Second, This "back-slash" versus "forward-slash" stuff can be a mess! The ANSWER is that Perl has fixed this! Always use Unix "/" for all path names known to Perl. $root = "C:/xyzzy", NOT "C:\\xyzzy"! Perl will translate the "/" to back slash when needed, which relieves you of the problem of having to code "\\path" vs "/path". This "escape char" stuff is a HUGE source of errors and its not needed.
Third, using characters that could have meaning within a print statement (like < or >) can potentially get you into trouble. This is the time for "\", or just using commas to separate tokens:
I've seen code before that uses the "." concatenation op instead of just a simple comma. In Perl this is just not necessary. Use "," when you can do so.print "zip_exe = "<",$zipexe,">\n"; #"<$zipexe>$x" might not parse "right" in the #general case although usage in above code appears ok..
In reply to Re: Stupid If Question
by Marshall
in thread Stupid If Question
by Lrdtalon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |