in reply to Program for Windows and Unix

use if $^O eq 'MSWin32', 'Win32::NetResource';

Update: added semi-colon

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Program for Windows and Unix
by Richi (Initiate) on Feb 27, 2009 at 07:51 UTC
    Error-Message: "use" not allowed in expression at ... syntax error ... near "use if"
      install if , its a module

        Except with ancient Perls, it should not be necessary to install it. corelist says

        $ corelist if if was first released with perl 5.006002

        which perlhist documents to have been released 2003-Nov-15.

        And if the module wasn't found, the error would be "Can't locate if.pm in @INC...". So, I suppose the error here lies elsewhere.