in reply to Perl Program works on local machine, not over network?

A couple of suggestions to help you get more help from perl itself:

  1.)  Add use strict; and use warnings; at the start of your scripts. Of course, this will cause you to need to use my the first time that you use a variable.

  2.)  Modify you line of code where you open the file to print out a more useful error message by changing it to:

open(MYFILE, "$loc") or print "Didn't Open $loc: $!\n";

With more useful warning and error messages, it will be easier for you (and others) to debug the issue(s).

Replies are listed 'Best First'.
Re^2: Perl Program works on local machine, not over network?
by GrandFather (Saint) on Jan 31, 2012 at 19:23 UTC

    Even better with the open is to use the three parameter variant and lexical file handles:

    open my $inFile, '<', $sloc or die "Can't open $loc: $!\n";

    which makes the open mode explicit (and avoids a potential injection attack), and gives all the strictly goodness advantages from using the lexical file handle.

    Oh, and don't interpolate a single variable ("$loc") - there is no need and clutters the code.

    True laziness is hard work