Hi all!
Just tried to process some XML-style data-parsing with HTML::Parser. For
that i created a (derived) class "PostboxParse.pm" with the appropriate
start/end/text methods so that the HTML::Parser could do some useful work.
Calling the Class from a Perl main program works well, calling the class
parses the string "chunk1" (like in the HTML::Parser example) and returns
the proper error codes or confirmations. Doing the same in perl delivers
only a class-generated "End" messsage but it looks like the
"chunk1" string isn't handed to the class-routines anyway :-(
The codepiece in Perl: (Works correct, delivering the correct result-strings)
======================
use PostboxParse;
$chunk1 = "<POSTBOX ACTION=UPDATE>soap\@foo.bar<PASSWORD></PASSWORD><FWADDR>soup\@blo.bli.blub.de</FWADDR></POSTBOX>";
my $p = PostboxParse->new(); # create a new object
$p->parse($chunk1); # parse the string
my $xx = $p->eof; # signal end of document
@aaa = $p->readmsg(); # get back the error-messages
foreach (@aaa){ # ... and print them
print "...>>>$_\n";
}
The codepiece in EmbPerl: (Returning only a hardwired "End"-messages )
========================
No html-Header is required - so everything is in [- ... -]
[.-
use PostboxParse;
$chunk1 = "<POSTBOX ACTION=UPDATE>soap\@foo.bar<PASSWORD></PASSWORD><FWADDR>soup\@blo.bli.blub.de</FWADDR></POSTBOX>";
my $p = PostboxParse->new(); # create a new object
$p->parse($chunk1); # parse the string
$xx = $p->eof; # signal end of document
@aaa = $p->readmsg(); # get back the error-messages
foreach (@aaa){ # ... and print them
print "...>>>$_\n";
}
-]
Perhaps i have overseen some trivial solution...
Thanks in advance
Ulrike
--
* NAMES: Ulrike Schepp Gigabell AG
* PHONE: [+49] [0]69 - 17084-742 D-60325 Frankfurt
* ENCR.: Key 0x5E34C939 B0 B1 ED D0 51 D1 0C 3B 82 23 2C 61 10 38 57 95
* SIGN : Key 0x59AFB1C5 59 5D 53 37 2F 79 A0 2F 27 03 F7 23 58 EE B9 6C
Just tried to process some XML-style data-parsing with HTML::Parser. For
that i created a (derived) class "PostboxParse.pm" with the appropriate
start/end/text methods so that the HTML::Parser could do some useful work.
Calling the Class from a Perl main program works well, calling the class
parses the string "chunk1" (like in the HTML::Parser example) and returns
the proper error codes or confirmations. Doing the same in perl delivers
only a class-generated "End" messsage but it looks like the
"chunk1" string isn't handed to the class-routines anyway :-(
The codepiece in Perl: (Works correct, delivering the correct result-strings)
======================
use PostboxParse;
$chunk1 = "<POSTBOX ACTION=UPDATE>soap\@foo.bar<PASSWORD></PASSWORD><FWADDR>soup\@blo.bli.blub.de</FWADDR></POSTBOX>";
my $p = PostboxParse->new(); # create a new object
$p->parse($chunk1); # parse the string
my $xx = $p->eof; # signal end of document
@aaa = $p->readmsg(); # get back the error-messages
foreach (@aaa){ # ... and print them
print "...>>>$_\n";
}
The codepiece in EmbPerl: (Returning only a hardwired "End"-messages )
========================
No html-Header is required - so everything is in [- ... -]
[.-
use PostboxParse;
$chunk1 = "<POSTBOX ACTION=UPDATE>soap\@foo.bar<PASSWORD></PASSWORD><FWADDR>soup\@blo.bli.blub.de</FWADDR></POSTBOX>";
my $p = PostboxParse->new(); # create a new object
$p->parse($chunk1); # parse the string
$xx = $p->eof; # signal end of document
@aaa = $p->readmsg(); # get back the error-messages
foreach (@aaa){ # ... and print them
print "...>>>$_\n";
}
-]
Perhaps i have overseen some trivial solution...
Thanks in advance
Ulrike
--
* NAMES: Ulrike Schepp Gigabell AG
* PHONE: [+49] [0]69 - 17084-742 D-60325 Frankfurt
* ENCR.: Key 0x5E34C939 B0 B1 ED D0 51 D1 0C 3B 82 23 2C 61 10 38 57 95
* SIGN : Key 0x59AFB1C5 59 5D 53 37 2F 79 A0 2F 27 03 F7 23 58 EE B9 6C