in reply to Need a quick file check/checkout script if anyone has a moment. :)

hello
The first part (checking for the existance) is easy:
if (-e $path) { print "$path exists\n"; }

as for the checkout ... I hope someone else can help.
si_lence
  • Comment on Re: Need a quick file check/checkout script if anyone has a moment. :)
  • Download Code

Replies are listed 'Best First'.
Re^2: Need a quick file check/checkout script if anyone has a moment. :)
by Seventh (Beadle) on Sep 30, 2004 at 15:48 UTC
    Hm, here's what I have: ---
    use perl::net::Utils;

    if (-e $path) {
    print "$path exists\n";
    }

    my $time = Dtg( time() );
    print "The DTG time is $time\n";


    (dtg is a module from utils.pm)

    I get a 'use of uninitialized value in -e' error.

    Thanks very much for the quick response, really appreciate it. =)
      you need to set the $path variable to the path of the file you want to test. So in your case:
      use strict; use warnings; use perl::net::Utils; my $path ='\perl\net\Utils.pm'; if (-e $path) { print "$path exists\n"; } #more code here
      si_lence
        Aha! That worked, thank you very much!

        Now if I can figure out how to check the file itself and how to check it out, I'm in business! :)