I want to call a perl script(B.pl) which will list the files available in the remote server from the main perl script(A.pl) by passing more than one optional arguments.
Since the arguments were optional, if I use backticks the arguments are getting assigned to wrong variables in B.pl.
If I use @list=system(B.pl, argv0, argv1, argv2);
then though some arguments are undef it is getting correctly assigned in B.pl but the STDOUT is not getting assigned to @list in the calling script.
I am new to perl, please guide in this scenario. Is there any way to pass null arguments with backticks ?
In A.pl:
my @filelist = system( B.pl, $argv0, $argv1, $argv2, $argv3);
my @filelist1 = `B.pl $argv0 $argv1 $argv2 $argv3`;
In B.pl:
my $loc = uc( $ARGV[0] );
my $msk = uc( $ARGV[1] );
my $usr = $ARGV[2];
my $usr1 = $ARGV[3];