K
Ken Soon
I have got a main script to run 2 scripts inside. I will be passing the same
directories into both of the script
Main.pl
print "Please enter the directory path: ";
$directory =<>;
chomp($directory);
print "Please enter the directory for the summary file to be stored : ";
$dump =<>;
chomp($dump);
print "Please enter the directory of the files: ";
$ftc = "C:\\PERL";
chomp($ftc);
system "side1.pl '$directory' $dump $ftc";
system "side2.pl $directory $dump $ftc";
Side1.pl
($directory, $dump, $ftc) = @ARGV;
print "$directory\n";
print "$dump\n";
print "$ftc\n";
Let's say $directory is C:\documents and settings\csoon\file
However, what was printed is
C:\documents
and
settings\csoon\file
and the $dump and $ftc were not printed.
So yah understand that @ARGV separate by the space.
Is there anyway to circumvent this problem?
Also is there any other related kind of problem that I should be aware of
when dealing passing variables into another script?
directories into both of the script
Main.pl
print "Please enter the directory path: ";
$directory =<>;
chomp($directory);
print "Please enter the directory for the summary file to be stored : ";
$dump =<>;
chomp($dump);
print "Please enter the directory of the files: ";
$ftc = "C:\\PERL";
chomp($ftc);
system "side1.pl '$directory' $dump $ftc";
system "side2.pl $directory $dump $ftc";
Side1.pl
($directory, $dump, $ftc) = @ARGV;
print "$directory\n";
print "$dump\n";
print "$ftc\n";
Let's say $directory is C:\documents and settings\csoon\file
However, what was printed is
C:\documents
and
settings\csoon\file
and the $dump and $ftc were not printed.
So yah understand that @ARGV separate by the space.
Is there anyway to circumvent this problem?
Also is there any other related kind of problem that I should be aware of
when dealing passing variables into another script?