Hi All,

Could you help me to solve following problem:

I need to execute tkl script with two arguments (input file and output file) 
within my Perl script:

#!/usr/bin/perl -w
use strict;
use File::Basename;

my @gdflist = `find . -name *.gdf`;
my $gdf_number = scalar(@gdflist);
my $counter = 0;

 foreach my $gdf (@gdflist){
   my $base = basename $gdf;
   my $path = dirname $gdf;
   $base =~ s/(.*)(\.)/$1$2/;
 
    chomp($gdf);
    my $arg1 = $gdf;
    my $arg2 = "$path/$1_patched.gdf";
 
     system "patch_teleatlas_gdf.tcl $arg1 $arg2" or die 
"patch_teleatlas_gdf.tcl is not working properly";
     $counter ++;
     print "\{$gdf\}:PATCHED($counter of $gdf_number)";
}

The problem that I'm receiving the die message "patch_teleatlas_gdf.tcl is not 
working properly" but then I manually assign arguments, 
Tcl script works with no problem.

my arg1 = "./CSK/cansk47.gdf";
my arg2 = "./CSK/cansk47_patched.gdf";
system "patch_teleatlas_gdf.tcl $arg1 $arg2" or die "patch_teleatlas_gdf.tcl is 
not working properly";

Any ideas? Should i use execvp(3) instead?

Thanks in advance,
Valdimir 







Reply via email to