By Rashid Khan
I am trying to Create an array for storing all file names. After that create the directory (use absolute path). Then for each file name in that array, copy the file name to to scratch.
I am new to perl script and trying to develop a script as follows.
#!/usr/bin/perl
use File::Copy;
#use Archive::Zip qw( :ERROR_CODES );
$my_file = "makefile";
open(HANDLE,"<$my_file");
#$output_file = "libs.txt";
#open (OUTPUT, ">$output_file");
while()
{
if(/check_geomtools.exe:/./.lib$/)
{
@libs = split(/: /);
@nlibs = $libs[1];
mkdir "Scratch";
foreach $my_libs(@nlibs)
{
copy($my_libs, Scratch)
}
}
}
close HANDLE;
Please suggest…
…read more
Source: FULL ARTICLE at The UNIX and Linux Forums