Accessing Perl array in bash : <p>I have a perl code where I execute some bash commands using backticks. I want to read a perl array in that bash command. My array has some strings and I want to read them in a for loop of bash.</p>

<pre><code>my @aArray = (1,2,3,4);
my $command = 'for i in $@aArray; do xxxxx $i; done;';
`$command`
</code></pre>

<p>I also want to catch error if any part of the loop fails. Thanks</p>
