mohankrishna919
Programmer
his is second perl file code which i am calling first perl file
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
use Win32::SqlServer qw(SCALAR);
GetOptions(
'i=s' => \ my $servername,
'c=s' => \ my $code,
);
system( "start perl $code -i $servername -d msdb ");
I am calling this file as perl filename2.pl -i test -c filename1.pl
It rans fine but if ran like perl filename2.pl -i test -c filename1.pl - TYPE full
its throwing error as unknown option type.
That's because filename2.pl is seeing "-TYPE full" as arguments to it, not arguments to filename1.pl. And since you haven't told filename2.pl about the -TYPE argument in its GetOptions() call, it throws an unknown argument error.
TYPE parameter belongs to filename1.pl
I need to pass TYPE parameter to filename1.pl during execution of filename2.pl
Is that possible?
Please suggest
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
use Win32::SqlServer qw(SCALAR);
GetOptions(
'i=s' => \ my $servername,
'c=s' => \ my $code,
);
system( "start perl $code -i $servername -d msdb ");
I am calling this file as perl filename2.pl -i test -c filename1.pl
It rans fine but if ran like perl filename2.pl -i test -c filename1.pl - TYPE full
its throwing error as unknown option type.
That's because filename2.pl is seeing "-TYPE full" as arguments to it, not arguments to filename1.pl. And since you haven't told filename2.pl about the -TYPE argument in its GetOptions() call, it throws an unknown argument error.
TYPE parameter belongs to filename1.pl
I need to pass TYPE parameter to filename1.pl during execution of filename2.pl
Is that possible?
Please suggest