in reply to How to run bash file from perl
Method 2:my $afile='dir1/firstfile.txt';<br> my $bfile='dir2/secondfile.txt';<br> my $bash_command='learn.sh '.$afile.' '.$bfile.' |';<br> open(my $output,$bash_command) or die $!;<br> while(my $line=<$output>){<br> print "$line";<br> }
Method 3:my $afile='dir1/firstfile.txt';<br> my $bfile='dir2/secondfile.txt';<br> @args = ("learn.sh", $afile, $bfile); system(@args) == 0 or die "system @args failed: $?"
I tried three different ways as you all have suggested, but I couldn't make my script work. Please help me what is wrong in itmy $output=`learn.sh $afile $bfile`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to run bash file from perl
by ciderpunx (Vicar) on May 18, 2011 at 12:24 UTC | |
|
Re^2: How to run bash file from perl
by anonymized user 468275 (Curate) on May 19, 2011 at 09:13 UTC |