in reply to Re: Getting VBA code to run a Perl script in a network drive
in thread Getting VBA code to run a Perl script in a network drive

Would it be suitable to have a Perl program running in the background that looks for submitted requests to the network drive, acting accordingly when it finds them? Can anyone point me to the best approach to doing this (if it is feasible)?
  • Comment on Re^2: Getting VBA code to run a Perl script in a network drive

Replies are listed 'Best First'.
Re^3: Getting VBA code to run a Perl script in a network drive
by PreferredUserName (Pilgrim) on Dec 09, 2004 at 15:07 UTC
    Sure, you could do something like this on the machine you want the job processes to actually run on:
    use File::Slurp; chdir '/path/to/shared/directory/jobs/dropoff' or die $!; for (;;) { foreach my $job (read_dir(".")) { next unless $job =~ /\.pl$/; system "perl -w $job > $job.output"; rename $job, "$job.ran" or warn $!; } sleep 5; }
    You probably want to do something fancier with giving jobs unique names and so on, but that's the idea.

    Make sure the dropoff area has appropriate permissions.

    As for the dynamic IP thing, get your sysadmin to set up DNS properly so you can refer to the machine by name.

    If that's not possible, an easy fix would be to do whatever the windows equivalent of HEAD http://machine-you-control/here-i-am-`hostname` is in a DHCP client script, and then look in the logs on machine-you-control.