Home  |  Linux  | Mysql  | PHP  | XML
From:Steve Bertrand Date:Tue Jun 30 02:56:49 2009
Subject:Rendering data structures using CGI::Application
I've been stuck for the last three hours trying to render the following
data structure into my browser. I'm using CGI::Application, and
CGI::Application::Plugin::PageBuilder.

No matter what I do or try, I can not loop the structure into a template
variable. I'm literally at wits end, and am considering just figuring
out a way to 'print' it out.

Any strong kick to the teeth as a boost would be most appreciated. This
is my data structure, and below shows that the particular module that
produces this data can be queried to produce more human readable output:

$error->dump_all();

$VAR1 = \[
'quantity is undefined, zero or illegal',
'amount is undefined or illegal',
'payment is undefined or illegal'
];
$VAR2 = \[
{
'sub' => undef,
'filename' => 'tests/purchase.pl',
'line' => 43,
'package' => 'main'
},
{
'sub' => 'ISP::Transac::create_transaction',
'filename' => '../ISP/Transac.pm',
'line' => 32,
'package' => 'ISP::Transac'
},
{
'sub' => 'ISP::Sanity::transaction_data',
'filename' => '../ISP/Sanity.pm',
'line' => 55,
'package' => 'ISP::Sanity'
}
];

# I can print it out nicely on the command line, but not in the browser:

my @messages = $error->get_messages();
my @stack = $error->get_stack();

print join ("\n", @messages);

for (@stack) {
while ( my ($key, $value) = each %{$_}) {
print "$key => $value\n"
if defined $key and
defined $value;
}
}
}

Is there an easy way to render this to the browser, while keeping HTML
out of my code?

Steve

Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
RE: Need help with Mail::Sender
Need help with Mail::Sender
Re: Recursively filter an array
Re: script for shutdown remote machine



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants