in reply to Stupid If Question
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..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Stupid If Question
by ikegami (Patriarch) on Aug 19, 2009 at 03:36 UTC | |
by Marshall (Canon) on Aug 19, 2009 at 03:50 UTC | |
by ikegami (Patriarch) on Aug 19, 2009 at 03:59 UTC | |
|
Re^2: Stupid If Question
by Anonymous Monk on Aug 19, 2009 at 07:05 UTC | |
by Marshall (Canon) on Aug 19, 2009 at 08:16 UTC | |
by Anonymous Monk on Aug 19, 2009 at 08:59 UTC | |
by Marshall (Canon) on Aug 19, 2009 at 10:12 UTC |