-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Did you ever have any luck with this?

        This is the first I've ever seen this. When did you send the
original message? I don't remember seeing this perl script on the list
before. Did you send it to one of the lists?

> > opendir(IDIR,"d:/dev/taa/install/")
> >    || die "NO SUCH Directory";
> > chdir("d:/dev/taa/install/");
> > @files = readdir IDIR;
> > print "Installing: @files \n";
> > exec 'pinstall', @files;
> >
> > foreach $file (@files) {
> >     unlink $file;
> > }
> > closedir(IDIR);

        The modified script below works (and is a bit faster, since you
don't have to opendir/readdir/closedir). I tested this on Windows2000 and
the latest ActiveState perl here, and it seems to work perfectly.

        Your code should read something like:

__SNIP__
#!/usr/bin/perl

use strict;     # using strict always helps, good habit
my $workpath    = "h:\\News\\Pan\\pdb\\";

# No need for opendir(), readdir(), closedir()
my @files       = glob "$workpath\\*.pdb";

if (@files) {   # check that there are pdb files to install
        print "Installing: @files\n\n";

        # ALWAYS use full path with system() in list-mode
        system("c:\\temp\\pinstall", @files);

        # Delete only if the files were found and installed
        print "Deleting @files\n\n";
        unlink for @files;

} else {        # print error, no .pdb found
        print "No matching .pdb files found..\n";
}
__SNIP__



d.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+FYowkRQERnB1rkoRAhd7AJwJmwVAkQNNzNKQO3WBNs+m80pnuwCaA3fX
QJwIhlD/xLCuHt5EOt5qKu4=
=my0I
-----END PGP SIGNATURE-----

_______________________________________________
plucker-dev mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev

Reply via email to