zapatafa has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to pass arguments to a function defined in .bashrc. I don't have any control over the contents of the .bashrc.
For the sake of argument: In .bashrc there is a function defined along the lines of:
where the script untouchable.pl is also not something I have any control over:function untouchable { perl ./untouchable.pl $* } export -f untouchable
#!/usr/bin/perl use strict 'vars'; my @people = @ARGV; print "Staring...\n"; foreach my $person ( @people ){ print "Hello $person\n"; } print "done!\n";
I'm trying to make a system call to this function from within a perl script as follows:
But my arguments john mike bill are completely lost. I know I could make a call directly to the untouchable.pl in this particular scenario here. But, I'm actually interested in how to make an interactive call to the bash command.#!/usr/bin/perl system ("bash -ic untouchable john mike bill");
If I run untouchable from the command line, it works as expected. How do I write a perl script to make a system call to untouchable and get this call to also pass my arguments along?
|
|---|