V
vsmurthy
Hi,
I have just begun to use Perl for CGI programming. I have a
situation where I run a command on the server through my perl script
and try to retrieve the result of the command into a perl variable and
then I try to display it on the web page:
my $var = `property <dataid>`;
print "<td align="middle">$var</td>";
This command (property) sometimes produces an output of size almost
0.5Mb to 1Mb for some values of <dataid>(I checked the size of the
output by executing the "property" command on the web server CLI).
I have 2 problems in capturing this output in the perl variable:
1] Only part of the output of the command is captured in the variable
when the output is large (i.e, when output size is greater than 0.1Mb).
How should I take care of this? Is there any feature in Perl to capture
very large output?
2] The other problem is that the output of the command has some XML in
it and when I capture it in the perl variable, the XML part is lost
(From the example below, all text between and including <List> and
</List> don't appear in the variable). How should one capture such data
since its not completely XML? Should I be using any PERL/XML functions?
Sample output:
Data <dataid> is not empty
Content has xxx entires:
------ similar text -------
------ similar text -------
<List>
<List1>123</List1>
<List2>345</List2>
------------------
------------------
<Listn>23</Listn>
</List>
Loc has 40 files:
filename-1
filename-2
----------
----------
----------
filename-40
Any help is greatly appreciated.
Thanks,
Vinay
I have just begun to use Perl for CGI programming. I have a
situation where I run a command on the server through my perl script
and try to retrieve the result of the command into a perl variable and
then I try to display it on the web page:
my $var = `property <dataid>`;
print "<td align="middle">$var</td>";
This command (property) sometimes produces an output of size almost
0.5Mb to 1Mb for some values of <dataid>(I checked the size of the
output by executing the "property" command on the web server CLI).
I have 2 problems in capturing this output in the perl variable:
1] Only part of the output of the command is captured in the variable
when the output is large (i.e, when output size is greater than 0.1Mb).
How should I take care of this? Is there any feature in Perl to capture
very large output?
2] The other problem is that the output of the command has some XML in
it and when I capture it in the perl variable, the XML part is lost
(From the example below, all text between and including <List> and
</List> don't appear in the variable). How should one capture such data
since its not completely XML? Should I be using any PERL/XML functions?
Sample output:
Data <dataid> is not empty
Content has xxx entires:
------ similar text -------
------ similar text -------
<List>
<List1>123</List1>
<List2>345</List2>
------------------
------------------
<Listn>23</Listn>
</List>
Loc has 40 files:
filename-1
filename-2
----------
----------
----------
filename-40
Any help is greatly appreciated.
Thanks,
Vinay