First, your regext could be
 $var =~ s/[\s\[\]]/\\$1/g;

Next, you should use two arguments style "system" calls:
system("/usr/local/bin/programm", args);

Third, you have to analyze a return code of a "system" command:
my $status = system(...);
print "Error [errno = $status]\n" if($status);

Saurabh Singhvi wrote:

#!/usr/bin/perl -w
use strict;

opendir(DIR,".") or die "Couldn't open $!";
our @names = readdir(DIR) or die "Couldn't open $!";
closedir(DIR);

foreach my $name (@names){
       if ($name =~ /avi$/) {
               my $var = $name;
               $var =~ s/\s/\\ /;
               $var =~ s/\[/\\\[/;
               $var =~ s/\]/\\\]/;
               system("mencoder $var -ovc lavc -oac copy -o $var.avi");
       }
}


in this script i am having a big problem.........the script just ends after the system command and returns to the shell..........what could be the reason???

some1 plz help me

thnx in adv
Saurabh





--
Vladimir D Belousov
HiTech solutions for business
http://businessreklama.ru


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to