S
Sunil
All,
I have a text file which has some metadata, like
----
t1.pl -frwk=perl -mode=1 -args=a,b,c -comments="This is comment 1"
t2.sql -frwk=sql -mode=2 -args=x -comments="This is comment 2"
----
I need to read this file line by line and parse it to get the values of
frwk, -mode and comments, so that I can create another string depending on
the different values for this string and pass it on to the corresponding
perl api I have which will execute it for me.
I am stuck because I am not able to pass spaces as part of comments. Is
there a workaround?
I am doing something like the following.
####################################################
my $eval_string = '@ARGV = qw (' . "$scriptOptions" . ' )' ;
eval $eval_string;
GetOptions("fwk=s" => \$framework,
"mode=s" => \$errMode,
"args=s" => \@arguments,
"comments=s" => \$comments );
####################################################
I am using GetOptions as in future the metadata file may have new or
changed options.
Thanks,
Sunil.
I have a text file which has some metadata, like
----
t1.pl -frwk=perl -mode=1 -args=a,b,c -comments="This is comment 1"
t2.sql -frwk=sql -mode=2 -args=x -comments="This is comment 2"
----
I need to read this file line by line and parse it to get the values of
frwk, -mode and comments, so that I can create another string depending on
the different values for this string and pass it on to the corresponding
perl api I have which will execute it for me.
I am stuck because I am not able to pass spaces as part of comments. Is
there a workaround?
I am doing something like the following.
####################################################
my $eval_string = '@ARGV = qw (' . "$scriptOptions" . ' )' ;
eval $eval_string;
GetOptions("fwk=s" => \$framework,
"mode=s" => \$errMode,
"args=s" => \@arguments,
"comments=s" => \$comments );
####################################################
I am using GetOptions as in future the metadata file may have new or
changed options.
Thanks,
Sunil.