Hi.
i am trying to read in a file at command line with a perl script.
It then executes another perl script using backtick,with the read data.
But something strange happens in this sequence.
The file which is read in contains certain entries having quote encapsulated data - a typical example being:
<value>#Obj ClassName="Application" RepositoryName="Agent"@#Obj ClassName="PageTabs" RepositoryName="PageTabs"/@#/Obj@;GotoScreen;"Shopping Screen"</value>
Though this data is read in properly,when it passed in within backtick,the quotes disappear.
Heres the code sample
use strict;
my $holdTerminator = $/;
undef $/;
my $buf = <STDIN>;
my @lines = split /$holdTerminator/, $buf;
$buf = "init";
$buf = join "", @lines;
$buf =~ s/\s+/~/g;#replacing space with ~
my $transaction="'${buf}'";
my $commandline="perl service_test.pl -txnDetails $transaction ";
print "$commandline";
my $returnargs=`$commandline`;
print $returnargs;
In the service_test.pl,printing out the parameter sows that quotes have vanished.How can i pass the parameter in ,with the quotes intact?
i am trying to read in a file at command line with a perl script.
It then executes another perl script using backtick,with the read data.
But something strange happens in this sequence.
The file which is read in contains certain entries having quote encapsulated data - a typical example being:
<value>#Obj ClassName="Application" RepositoryName="Agent"@#Obj ClassName="PageTabs" RepositoryName="PageTabs"/@#/Obj@;GotoScreen;"Shopping Screen"</value>
Though this data is read in properly,when it passed in within backtick,the quotes disappear.
Heres the code sample
use strict;
my $holdTerminator = $/;
undef $/;
my $buf = <STDIN>;
my @lines = split /$holdTerminator/, $buf;
$buf = "init";
$buf = join "", @lines;
$buf =~ s/\s+/~/g;#replacing space with ~
my $transaction="'${buf}'";
my $commandline="perl service_test.pl -txnDetails $transaction ";
print "$commandline";
my $returnargs=`$commandline`;
print $returnargs;
In the service_test.pl,printing out the parameter sows that quotes have vanished.How can i pass the parameter in ,with the quotes intact?