Re: Perl regular expression for implementing infix expression parser?

2016-08-14 Thread Richard Heintze via beginners
like log10, sin, cos etc... See Recursive descent parser - Wikipedia, the free encyclopedia e for expressionf for factorpm for plus or minusmd for multiply divide n for numeric literal here is my attempt so far (that does not work): .! perl -pe 'BEGIN{ $n=qr{\d+}x; $pm=qr{[-\+]}x; $md=qr{

Re: Perl regular expression for implementing infix expression parser?

2016-08-14 Thread David Mertens
hat $np is from the camel book and it is a regular expression that parses > nested sets of parentheses and then my replace command evaluates the > arithmetic expression. > > Since perl accommodates recursive regular expressions, it ought to be > possible to implement a recursive decent parse

Perl regular expression for implementing infix expression parser?

2016-08-13 Thread Richard Heintze via beginners
uot;$4"/ge' That $np is from the camel book and it is a regular expression that parses nested sets of parentheses and then my replace command evaluates the arithmetic expression. Since perl accommodates recursive regular expressions, it ought to be possible to implement a recursive decent

Re: Fast XML parser?

2012-10-31 Thread Octavian Rasnita
Perl and I don't know why. And strange, but I've seen that now it just crashes Perl, but it doesn't return that "Free to wrong pool" error. Octavian That must be something either within your perl or the XML::Parser::Expat. What versions of those two do you ha

Re: Fast XML parser?

2012-10-31 Thread Rob Coops
> > > But it doesn't work with the entire xml file which has more than 200 MB, > because it crashes Perl and I don't know why. > > > > And strange, but I've seen that now it just crashes Perl, but it doesn't > return that "Free to wrong pool"

Re: Fast XML parser?

2012-10-31 Thread Jenda Krynicky
gt; because it crashes Perl and I don't know why. > > And strange, but I've seen that now it just crashes Perl, but it doesn't > return that "Free to wrong pool" error. > > Octavian That must be something either within your perl or the XML::Pars

Re: Fast XML parser?

2012-10-31 Thread Octavian Rasnita
From: "Jenda Krynicky" > From: "Octavian Rasnita" > To: > Subject:Fast XML parser? > Date sent: Thu, 25 Oct 2012 14:33:15 +0300 > >> Hi, >> >> Can you recommend an XML parser which is faster than XML::Tw

Re: Fast XML parser?

2012-10-30 Thread Octavian Rasnita
From: "Jenda Krynicky" > From: "Octavian Rasnita" > To: > Subject:Fast XML parser? > Date sent: Thu, 25 Oct 2012 14:33:15 +0300 > >> Hi, >> >> Can you recommend an XML parser which is faster than XML::Tw

Re: Fast XML parser?

2012-10-30 Thread Jenda Krynicky
From: "Octavian Rasnita" To: Subject: Fast XML parser? Date sent: Thu, 25 Oct 2012 14:33:15 +0300 > Hi, > > Can you recommend an XML parser which is faster than XML::Twig? > > I need to use an XML pars

Re: Fast XML parser?

2012-10-29 Thread Octavian Rasnita
> > > > Hi Shlomi, > > > > I tried to use XML::LibXML::Reader which uses the pool parser, and I read > > that: > > > > "" > > However, it is also possible to mix Reader with DOM. At every point the > > user may copy the current node (

Re: Fast XML parser?

2012-10-29 Thread Octavian Rasnita
> -- > - > Shlomi Fish http://www.shlomifish.org/ > A little late I know but still... Unfortunately it is not so late. :-) > LibXML was my saviour and using XPath was the fastest solution. Though it is > possible

Re: Fast XML parser?

2012-10-29 Thread Rob Coops
sh" > > > > > > Hi Octavian, > > > > > > > > > > > > Hi Shlomi, > > > > > > I tried to use XML::LibXML::Reader which uses the pool parser, and I > read > > > that: > > > > > > "" > &

Re: Fast XML parser?

2012-10-29 Thread Shlomi Fish
On Mon, 29 Oct 2012 10:09:53 +0200 Shlomi Fish wrote: > Hi Octavian, > > On Sun, 28 Oct 2012 17:45:15 +0200 > "Octavian Rasnita" wrote: > > > From: "Shlomi Fish" > > > > Hi Octavian, > > > > > > > > Hi Shlomi,

Re: Fast XML parser?

2012-10-29 Thread Shlomi Fish
Hi Octavian, On Sun, 28 Oct 2012 17:45:15 +0200 "Octavian Rasnita" wrote: > From: "Shlomi Fish" > > Hi Octavian, > > > > Hi Shlomi, > > I tried to use XML::LibXML::Reader which uses the pool parser, and I read > that: > > &quo

Re: Fast XML parser?

2012-10-28 Thread Octavian Rasnita
From: "Shlomi Fish" Hi Octavian, On Thu, 25 Oct 2012 14:33:15 +0300 "Octavian Rasnita" wrote: Hi, Can you recommend an XML parser which is faster than XML::Twig? I need to use an XML parser that can parse the XML files chunk by chunk and which works faster (much fa

Re: Fast XML parser?

2012-10-25 Thread Michiel Beijen
I'm sorry, I did not see Shlomi's reply, it was in my spam folder for some reason. On Thu, Oct 25, 2012 at 5:30 PM, Michiel Beijen wrote: > Hi Octavian, > > On Thu, Oct 25, 2012 at 1:33 PM, Octavian Rasnita wrote: > >> Can you recommend an XML parser which is faster

Re: Fast XML parser?

2012-10-25 Thread Michiel Beijen
Hi Octavian, On Thu, Oct 25, 2012 at 1:33 PM, Octavian Rasnita wrote: > Can you recommend an XML parser which is faster than XML::Twig? Did you try XML::LibXML ? https://www.metacpan.org/module/XML::LibXML -- Michiel -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additio

Re: Fast XML parser?

2012-10-25 Thread Shlomi Fish
Hi Octavian, On Thu, 25 Oct 2012 14:33:15 +0300 "Octavian Rasnita" wrote: > Hi, > > Can you recommend an XML parser which is faster than XML::Twig? > > I need to use an XML parser that can parse the XML files chunk by chunk and > which works faster (much faste

Fast XML parser?

2012-10-25 Thread Octavian Rasnita
Hi, Can you recommend an XML parser which is faster than XML::Twig? I need to use an XML parser that can parse the XML files chunk by chunk and which works faster (much faster) than XML::Twig, because I tried using this module but it is very slow. I tried something like the code below, but I

NEVERMIND! (was: What the... ?? (question about MIME::Parser))

2012-09-28 Thread Ronald F. Guilmette
... #!/usr/local/bin/perl -w use strict; use MIME::Parser; use MIME::Decoder; my $parser = new MIME::Parser; my $entire = $parser->parse(\*STDIN) or die "parse failed\n"; my $etype = $entire->effective_type(); print STDERR ($etype, &

Re: What the... ?? (question about MIME::Parser)

2012-09-28 Thread Jim Gibson
TF-8 >Content-Transfer-Encoding: quoted-printable > > Ok, so forget about the content type and encoding for the moment. I just > want to print out the content of that one MIME part... really, _just_ the > body of just that one MIME part. > > I don't think I ever used

What the... ?? (question about MIME::Parser)

2012-09-28 Thread Ronald F. Guilmette
moment. I just want to print out the content of that one MIME part... really, _just_ the body of just that one MIME part. I don't think I ever used MIME Tools or MIME::Parser before, so I'm not really familiar with these particular pac

Re: form POST string parser

2011-09-07 Thread Shlomi Fish
other Catalyst apps that use FormFu. Regards, Shlomi Fish >   >   > > From: Rajeev Prasad > To: > Cc: Perl Beginners > Sent: Wednesday, September 7, 2011 11:34 AM > Subject: Re: form POST string parser > > > Uri, >   > thx. I like that suggest

Re: form POST string parser

2011-09-07 Thread Rajeev Prasad
POST string parser Uri,   thx. I like that suggestion, i totally missed that earlier. I will explore cgi module.     From: Uri Guttman To: Rajeev Prasad Cc: Perl Beginners Sent: Tuesday, September 6, 2011 7:24 PM Subject: Re: form POST string parser >>>>> "RP" == Raj

Re: form POST string parser

2011-09-07 Thread Rajeev Prasad
Uri,   thx. I like that suggestion, i totally missed that earlier. I will explore cgi module.     From: Uri Guttman To: Rajeev Prasad Cc: Perl Beginners Sent: Tuesday, September 6, 2011 7:24 PM Subject: Re: form POST string parser >>>>> "RP" == Rajeev Prasad writes

Re: form POST string parser

2011-09-07 Thread Rob Dixon
On 07/09/2011 01:15, Rajeev Prasad wrote: which of the two is better? thx. $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; or $value =~ s/%(..)/chr(hex($1))/ge; in both cases if the input string has \ in it, it is being converted to \\ i read... chr = function is used to conve

Re: form POST string parser

2011-09-06 Thread Uri Guttman
> "RP" == Rajeev Prasad writes: RP> hi, RP>   RP> which of the two is better? thx. RP>   RP> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; RP>   RP> or RP> $value =~ s/%(..)/chr(hex($1))/ge; both are bad because parsing your own http data is a bad thing. it has

form POST string parser

2011-09-06 Thread Rajeev Prasad
hi,   which of the two is better? thx.   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;   or $value =~ s/%(..)/chr(hex($1))/ge; in both cases if the input string has \ in it, it is being converted to \\     i read... chr =  function is used to convert ASCII or Unicode values into the

RE: A problem while using XML::Parser::PerlSAX

2010-07-01 Thread Jason Feng
2010 18:09:01 -0500 Subject: Re: A problem while using XML::Parser::PerlSAX From: greg.jar...@gmail.com To: q15...@hotmail.com Jason, I have not worked with PerlSAX, however I played around with SAX in Java and have an idea you can try out. I'm not sure if you can do this in PerlSAX, but in J

RE: A problem while using XML::Parser::PerlSAX

2010-07-01 Thread Jason Feng
1 Jul 2010 08:09:20 +0200 > Subject: Re: A problem while using XML::Parser::PerlSAX > > From: Jason Feng > > I am using XML::Parser::PerlSAX > > to parse a 300M XML file. I meet a strange issue with handler characters. > > This handler is supposed to return > >

Re: A problem while using XML::Parser::PerlSAX

2010-06-30 Thread Jenda Krynicky
From: Jason Feng > I am using XML::Parser::PerlSAX > to parse a 300M XML file. I meet a strange issue with handler characters. > This handler is supposed to return > all the contents between start markup and end markup. But sometimes it just > returns one part of the whole c

A problem while using XML::Parser::PerlSAX

2010-06-30 Thread Jason Feng
Hi there, I am using XML::Parser::PerlSAX to parse a 300M XML file. I meet a strange issue with handler characters. This handler is supposed to return all the contents between start markup and end markup. But sometimes it just returns one part of the whole contents. On the second call

Re: How to use the module: XML::Parser

2010-05-11 Thread Shlomi Fish
Hi Parag, On Tuesday 11 May 2010 08:50:21 Parag Kalra wrote: > Hey All, > > I am trying to design some scripts using the module - XML::Parser > > To start learning I have a very basic scenario. Suppose I have following > XML file: > > > My Tag1 > My Tag2 > M

Re: How to use the module: XML::Parser

2010-05-11 Thread Jeff Pang
2010/5/11 Parag Kalra : > Hey All, > > I am trying to design some scripts using the module - XML::Parser > > To start  learning I have a very basic scenario. Suppose I have following > XML file: > > > My Tag1 > My Tag2 > My Tag3 > > > I want to s

How to use the module: XML::Parser

2010-05-10 Thread Parag Kalra
Hey All, I am trying to design some scripts using the module - XML::Parser To start learning I have a very basic scenario. Suppose I have following XML file: My Tag1 My Tag2 My Tag3 I want to save the the tags as the keys of a Hash and respective content as the value of that hash So for

Re: XML Parser Error

2010-04-16 Thread Open Source
> - Original Message - > From: Brad Baxter > Sent: 04/16/10 01:31 AM > To: beginners@perl.org > Subject: Re: XML Parser Error > On 4/15/2010 1:40 PM, Open Source wrote: > I'm getting this error: > > Undefined subroutine&XML::Simple::XMLin called at ./

Re: XML Parser Error

2010-04-16 Thread Brad Baxter
On 4/15/2010 1:40 PM, Open Source wrote: I'm getting this error: Undefined subroutine&XML::Simple::XMLin called at ./sample.pl line 3. Here's my code and input file: use XML::Simple; use Data::Dumper; $data = XMLin("sample.xml"); print Dumper($data); John 43 M Operations There mu

RE: XML Parser Error

2010-04-16 Thread Wagner, David --- Senior Programmer Analyst --- CFS
>-Original Message- >From: Open Source [mailto:open.sou...@gmx.com] >Sent: Thursday, April 15, 2010 11:41 >To: Beginners, Perl >Subject: XML Parser Error > >I'm getting this error: > >Undefined subroutine &XML::Simple::XMLin called at ./sample.pl line

XML Parser Error

2010-04-15 Thread Open Source
I'm getting this error: Undefined subroutine &XML::Simple::XMLin called at ./sample.pl line 3. Here's my code and input file: use XML::Simple; use Data::Dumper; $data = XMLin("sample.xml"); print Dumper($data); John 43 M Operations -- To unsubscribe, e-mail: beginners-unsubscr...@perl.

Re: Can't locate HTML::Parser in @INC

2009-06-05 Thread Peter Nikolaidis
>> Any suggestions? > > What about file permissions? Does the user the test script was run as > have read access to > /usr/local/lib/perl5/site_perl/5.10.0/x86_64-linux/HTML/Parser.pm ? Hello, I just tried running the test script as root and got the same results, so I do not think it is a permis

Re: Can't locate HTML::Parser in @INC

2009-06-04 Thread Gunnar Hjalmarsson
Peter Nikolaidis wrote: I wrote a test script, which does nothing more than require HTML::Parser, and it fails with the following: catu...@www2:~$ perl test.plx Can't locate HTML::Parser in @INC (@INC contains: /usr/local/lib/perl5/5.10.0/x86_64-linux /usr/local/lib/perl5/5.10.0 /usr/

Can't locate HTML::Parser in @INC

2009-06-04 Thread Peter Nikolaidis
Hello, We're running a Debian 5 (AMD64) server, with Perl 5.10 compiled from source because we require a non-threaded Perl for an e-commerce app. It fails to load, complaining that several modules were not found, including, for instance, HTML::Parser. I installed this via /usr/local/bin

Re: parser with perl

2009-03-26 Thread dev_null
Thanks for the references. I will check them. > On Thu, Mar 26, 2009 at 09:51, wrote: > > How to achieve a parser with Perl? > > I mean I want to put some logic (if...else, loop etc) in config file and > > let perl to parse them, like TCL for iRules. >

Re: parser with perl

2009-03-26 Thread Rodrick Brown
On Thu, Mar 26, 2009 at 9:51 AM, wrote: > How to  achieve a parser with Perl? > I mean I want to put some logic (if...else, loop etc) in config file and let > perl to parse them, like TCL for iRules. > > thanks. > I've used the following in the past and i

parser with perl

2009-03-26 Thread dev_null
How to achieve a parser with Perl? I mean I want to put some logic (if...else, loop etc) in config file and let perl to parse them, like TCL for iRules. thanks. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http

Re: trying to parse out the simple xml file from the book with XML::Parser and I get not well-formed error

2008-11-02 Thread Richard Lee
/Parser.pm line 187 Partly Cloudy<\OUTLOOK> 12 use strict; use warnings; use XML::Parser; my %forecast; my @curr; my $type; my $p1 = new XML::Parser(Style => 'Stream'); my $yahoo = shift; $p1->parsefile($yahoo); print "Outlook: $forecast{outlook}\n

trying to parse out the simple xml file from the book with XML::Parser and I get not well-formed error

2008-11-02 Thread Richard Lee
Partly Cloudy<\OUTLOOK> 12 use strict; use warnings; use XML::Parser; my %forecast; my @curr; my $type; my $p1 = new XML::Parser(Style => 'Stream'); my $yahoo = shift; $p1->parsefile($yahoo); print "Outlook: $forecast{outlook}\n"; foreach (keys

Re: XML::Parser::Expat example

2008-09-02 Thread Mr. Shawn H. Corey
On Tue, 2008-09-02 at 11:53 +0300, Vyacheslav Karamov wrote: > Hi All! > > Could someone give me some examples how to use XML::Parser::Expat? You should use XML::Parser instead. Most Perl Mongers prefer to use XML::Twig or XML::SAX or XML::DOM. All are available at CPAN <http://sea

XML::Parser::Expat example

2008-09-02 Thread Vyacheslav Karamov
Hi All! Could someone give me some examples how to use XML::Parser::Expat? --- WBR, Vyacheslav. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Limiting Toke::Parser

2008-06-29 Thread Clinton JAmes
Thank you for the response Rob and I apologise for my lack of clarity. Thank you Gunnar the last line in your snippet is what I was looking for. Rgds CCJ __ Not happy with your email address?. Get the one you really want - million

Re: Limiting Toke::Parser

2008-06-28 Thread Gunnar Hjalmarsson
Rob Dixon wrote: Gunnar Hjalmarsson wrote: Rob Dixon wrote: Clinton JAmes wrote: How do I stop the parser when I reach "pears". You are presumably using HTML::TokeParser, and not Toke::Parse, Toke::Parse or toke paser. This should do what you want. while (my $tag = $stream->

Re: Limiting Toke::Parser

2008-06-28 Thread Rob Dixon
Gunnar Hjalmarsson wrote: > Rob Dixon wrote: >> Clinton JAmes wrote: >>> How do I stop the parser when I reach "pears". >> You are presumably using HTML::TokeParser, and not Toke::Parse, Toke::Parse >> or >> toke paser. >> >> This should

Re: Limiting Toke::Parser

2008-06-28 Thread Gunnar Hjalmarsson
Rob Dixon wrote: Clinton JAmes wrote: How do I stop the parser when I reach "pears". You are presumably using HTML::TokeParser, and not Toke::Parse, Toke::Parse or toke paser. This should do what you want. while (my $tag = $stream->get_tag('div')) { next unles

Re: Limiting Toke::Parser

2008-06-28 Thread Rob Dixon
http://www.fat.gov/disclaim.html";>Disclaimer > http://www.fat.gov/privacy.html";>Privacy > > > > > > my toke paser snippet > > while ( $tag = $stream->get_tag("div") ) { > if ($tag->[1]{id} and $tag->[1]{id}

Limiting Toke::Parser

2008-06-27 Thread Clinton JAmes
= $stream->get_tag("div") ) {     if ($tag->[1]{id} and $tag->[1]{id} eq 'mainbody') {         while ($tag = $stream->get_tag('a')){             print Dumper $tag;         }     } } my prob

Re: parser using perl

2008-03-31 Thread Chas. Owens
On Mon, Mar 31, 2008 at 2:43 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Chas. Owens wrote: > > > > In general, it doesn't matter if you want to work with a small piece > > of a language or the whole language, you still need to implement a > > parser

Re: parser using perl

2008-03-31 Thread Rob Dixon
Chas. Owens wrote: > > In general, it doesn't matter if you want to work with a small piece > of a language or the whole language, you still need to implement a > parser for the whole language. You can get an eighty or ninety > percent solution without a full parser, but

Re: parser using perl

2008-03-31 Thread Randal L. Schwartz
> ""Chas" == "Chas Owens" <[EMAIL PROTECTED]> writes: "Chas> Take a look at Parse::RecDescent*. Also, look at Parse::Marpa if you have Perl 5.10 (requires 5.10), which not only parses text like P::RD, but can also tell you if there are *multiple* *ambiguous* parsings, rather efficiently. Ver

Re: parser using perl

2008-03-31 Thread Chas. Owens
On Mon, Mar 31, 2008 at 11:05 AM, Sharan Basappa <[EMAIL PROTECTED]> wrote: > true, I have the grammar in the form of BNF. But I am not interested > in converting > the BNF to parser rules, when I know that these productions are not > useful to me. > I am planning to write

Re: parser using perl

2008-03-31 Thread Sharan Basappa
true, I have the grammar in the form of BNF. But I am not interested in converting the BNF to parser rules, when I know that these productions are not useful to me. I am planning to write 8-10 rules and rules for pertaining tokens only. Of course, I might have to write additional rules to catch

Re: parser using perl

2008-03-31 Thread Chas. Owens
he rest. As I said, I am not a > compiler expert. > So, I could be understating the problem .. > > I will have a look at the parser library. Thanks ... > > Regards snip That assumes you have a grammar already, in which case generating a full parser is easy. The problem comes

Re: parser using perl

2008-03-31 Thread Sharan Basappa
look at the parser library. Thanks ... Regards On Mon, Mar 31, 2008 at 8:16 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > > On Mon, Mar 31, 2008 at 10:36 AM, Sharan Basappa > <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I am trying to extract informat

Re: parser using perl

2008-03-31 Thread Chas. Owens
> recursion that languages support. The other option I have is to use a > public domain parser like Bison and parse > the input, build some data structure that perl can lookup and do the > processing. > > I would like to know experience of people on this forum ... > >

parser using perl

2008-03-31 Thread Sharan Basappa
modules are available within perl that makes this job easier. I feel it is possible to do the complete work in perl, but I might be wrong. Especially around the recursion that languages support. The other option I have is to use a public domain parser like Bison and parse the input, build some data

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread Tim Bowden
I need to find a way to get HTML::Parser return the text between the tag caught by the start_h handler and the related closing tag. Could someone please point me in the right direction? Cut down code thus far: #!/usr/bin/perl -wT use strict; use HTML::Parser; my %choices; my $file

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread Tim Bowden
Thanks Chas, most useful. Regards, Tim Bowden On Mon, 2008-02-25 at 09:55 -0500, Chas. Owens wrote: > On Mon, Feb 25, 2008 at 9:01 AM, Tim Bowden <[EMAIL PROTECTED]> wrote: > > Making progress. Needed to understand hash references, and how to > > de-reference them. > snip > > Quick cheat sheet:

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread MK
On Mon, 2008-02-25 at 14:54 +0900, Tim Bowden wrote: -> > Hi all, -> > -> > I'm using HTML::Parser to process files containing snippets of html -> > looking like: -> > First optionAnother -> > choicepick me -> > -> > I'm wanting to create a hash

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread Chas. Owens
On Mon, Feb 25, 2008 at 9:01 AM, Tim Bowden <[EMAIL PROTECTED]> wrote: > Making progress. Needed to understand hash references, and how to > de-reference them. snip Quick cheat sheet: #make a hash reference my $ref = \%hash; my $ref = { key1 => "val1", key2 => "val2" }; my $ref = { %hash }; #

Re: scalar / hash problem in HTML::Parser

2008-02-25 Thread Tim Bowden
Making progress. Needed to understand hash references, and how to de-reference them. Tim Bowden On Mon, 2008-02-25 at 14:54 +0900, Tim Bowden wrote: > Hi all, > > I'm using HTML::Parser to process files containing snippets of html > looking like: > First optionAnother >

scalar / hash problem in HTML::Parser

2008-02-24 Thread Tim Bowden
Hi all, I'm using HTML::Parser to process files containing snippets of html looking like: First optionAnother choicepick me I'm wanting to create a hash of option value, name pairs. Ie, 1 => "First option",2=>"Another choice" and so on. Problem is, I don&#x

Re: HTML::Parser does give any result of its "sub text{...}".

2007-10-16 Thread Patrik Hasibuan
> wrote: > > > Please tell me my mistake. > > I'll catch enough to give you something to do, and leave the rest for > you and others to find. :-) > > > use HTML::Parser; > > It looks as if you're not subclassing HTML::Parser. Isn't that > ob

Re: HTML::Parser does give any result of its "sub text{...}".

2007-10-16 Thread Patrik Hasibuan
with "LWP::UserAgent". For the > > parsing I use "HTML::Parser". > > But the parsing process does not give any result. I still do not understand > > the documentation those I get from > > - http://www.foo.be/docs/tpj/issues/vol5_1/tpj0501-0003.html ; >

Re: HTML::Parser does give any result of its "sub text{...}".

2007-10-12 Thread Tom Phoenix
On 10/12/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote: > Please tell me my mistake. I'll catch enough to give you something to do, and leave the rest for you and others to find. :-) > use HTML::Parser; It looks as if you're not subclassing HTML::Parser. Isn't tha

Re: HTML::Parser does give any result of its "sub text{...}".

2007-10-12 Thread Patrik Hasibuan
Dear Jenda and friends... I modified the code but the result is still empty. Please tell me my mistake. === Here is my current code: #!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTML::Parser; my @result=''; my @judul=''; my @bodi=''; my $tekshslparse=

Re: HTML::Parser does give any result of its "sub text{...}".

2007-10-12 Thread Jenda Krynicky
From: Patrik Hasibuan <[EMAIL PROTECTED]> > I want to parse HTML files those I retrieve with "LWP::UserAgent". For the > parsing I use "HTML::Parser". > But the parsing process does not give any result. I still do not understand > the d

HTML::Parser does give any result of its "sub text{...}".

2007-10-12 Thread Patrik Hasibuan
Dear my friends... I want to parse HTML files those I retrieve with "LWP::UserAgent". For the parsing I use "HTML::Parser". But the parsing process does not give any result. I still do not understand the documentation those I get from - http://www.foo.be/docs/tpj/issues/vol5

Re: Outlook CSV Parser

2007-08-10 Thread Laxminarayan G Kamath A
On Wed, 30 May 2007 12:14:52 -0400, "Chas Owens" <[EMAIL PROTECTED]> wrote: ... > http://www.perl.com/pub/a/2004/06/25/profiling.html > http://search.cpan.org/~nwclark/perl-5.8.8/utils/dprofpp.PL > The following code seems to speed up the parsing by two orders of > magnitude (2.214 seconds

Re: Howto strip html from a $calar with HTML::Parser

2007-08-03 Thread Alan C
Thanks for the replies. I've added them to my searchable data. My forgetfullness worsens as I get older. I'd totally forgotten that I'd once done this with HTML::Strip And I began reinventing the wheel the other day. Lynx too, forgot about that (Slackware 12.0 right now). Anyways, here's a mo

Re: Howto strip html from a $calar with HTML::Parser

2007-08-03 Thread Mumia W.
On 08/03/2007 03:30 AM, Alan C wrote: [...] I do not need to print to STDOUT Is the print @ line in the sub doing this? [...] Yes. Why not append the text to $string instead of printing the text? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Howto strip html from a $calar with HTML::Parser

2007-08-03 Thread Alan C
Hi, I saw the doc for HTML::Parser. I looked at its hstrip program in the eg folder but dunno how to strip a scalar instead of a file. I can strip a file. But I want to strip a scalar. Any help appreciated. As my code is currently, when ran, it prints text to STDOUT and the $source scalar

Re: Outlook CSV Parser

2007-05-31 Thread Dr.Ruud
"Mumia W." schreef: > Laxminarayan G Kamath A: >> http://download.deeproot.in/~kamathln/outlook-encrtypted-sample.csv > > Well I asked for it. :-) > > It's impossible to tell where one record ends and another record > begins with that file. Maybe not, because the rule was that it ends at newline,

Re: Outlook CSV Parser

2007-05-31 Thread Dr.Ruud
Laxminarayan G Kamath A: > Ruud: >> You forgot to supply a link to such a file. Or show a __DATA__ >> section for testing. > > http://download.deeproot.in/~kamathln/outlook-encrtypted-sample.csv OK, lets check how wellformed it is: perl -we' local $/; $_ = <>; s/"[^"]*"//g; s/(?<=,)[^",

Re: Outlook CSV Parser

2007-05-31 Thread Mumia W.
On 05/31/2007 02:32 AM, Laxminarayan G Kamath A wrote: http://download.deeproot.in/~kamathln/outlook-encrtypted-sample.csv Well I asked for it. :-) It's impossible to tell where one record ends and another record begins with that file. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: Outlook CSV Parser

2007-05-31 Thread Laxminarayan G Kamath A
On Wed, 30 May 2007 10:38:40 +0200, "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > You forgot to supply a link to such a file. Or show a __DATA__ section > for testing. http://download.deeproot.in/~kamathln/outlook-encrtypted-sample.csv -- Cheers, Laxminarayan G Kamath A e-mail: [EMAIL PROTECTED] Work

Re: Outlook CSV Parser

2007-05-30 Thread Chas Owens
On 5/30/07, Ken Foskey <[EMAIL PROTECTED]> wrote: snip CSV is a horrible format. Far too unreliable, we have exported CSV from excel that imported differently into excel. snip Just pedantic nitpick, but CSV is an incredibly reliable format, the problem is find programs that actually use CSV r

Re: Outlook CSV Parser

2007-05-30 Thread Chas Owens
On 5/30/07, Laxminarayan G Kamath A <[EMAIL PROTECTED]> wrote: snip Any ways of optimising it further? snip Premature optimization is the root of all evil. Have you profiled the code yet? If not then here is some documentation that will point you in the right direction http://www.perl.com/pu

Re: Outlook CSV Parser

2007-05-30 Thread Ken Foskey
On Wed, 2007-05-30 at 13:34 +0530, Laxminarayan G Kamath A wrote: > What I am expecting is help with the variant of the regex I used as the > condition for while loop. I am sure If we modify that regexp a little > bit, then we can just use it on the record like this : > > $_ = $record; > @fields

Re: Outlook CSV Parser

2007-05-30 Thread Mumia W.
On 05/30/2007 03:04 AM, Laxminarayan G Kamath A wrote: [...] I tried a lot of different ways but just could not get the right regexp :-(. I reiterate what the eminent Dr. Ruud said. I need some data to play with before I play with the code you posted. -- To unsubscribe, e-mail: [EMAIL P

Re: Outlook CSV Parser

2007-05-30 Thread Dr.Ruud
Laxminarayan G Kamath A schreef: > The stubling blocks : there are several types of problems in > Outlook's CSV .. You forgot to supply a link to such a file. Or show a __DATA__ section for testing. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For add

Re: Outlook CSV Parser

2007-05-30 Thread Laxminarayan G Kamath A
On Wed, 30 May 2007 01:26:30 -0500, "Mumia W." wrote: > The Perl module Text::CSV_XS would make your work much simpler, and > it might execute a little faster. Thank you for pointing out .. but we have already tried it! Unfortunately, it failed to seperate the records in the right fashion. We h

Re: Outlook CSV Parser

2007-05-30 Thread Mumia W.
On 05/30/2007 12:40 AM, Laxminarayan G Kamath A wrote: Hi PERLers, We here at DeepRoot Linux were trying to parse Outlook's csv so that I can add them to ldap addressbook.. [...] The Perl module Text::CSV_XS would make your work much simpler, and it might execute a little faster. -- To

Re: Outlook CSV Parser

2007-05-29 Thread Laxminarayan G Kamath A
On Wed, 30 May 2007 11:10:00 +0530, Laxminarayan G Kamath A <[EMAIL PROTECTED]> wrote: > The attached file is what I have > come up to.. but it still takes more ... Had forgotten to attach the file.. -- Cheers, Laxminarayan G Kamath A e-mail: [EMAIL PROTECTED] Work URL: http://deeproot.in #!/

Outlook CSV Parser

2007-05-29 Thread Laxminarayan G Kamath A
Hi PERLers, We here at DeepRoot Linux were trying to parse Outlook's csv so that I can add them to ldap addressbook.. After several futile tries around with lots of built in packages, we decided it was up to us to device an algorithm. As time was of importance , we wrote a "well it works!

Re: help on log parser

2007-01-05 Thread Mumia W.
On 01/04/2007 09:48 PM, beast wrote: Hi all, I have text file which has these following format: username1:10.0.0.1 username2:10.0.0.3 Basically, it has username with at least 1 IP address. I would like to parse log which contains IP address but might not contains the username, ie: 10.0.0.

help on log parser

2007-01-04 Thread beast
Hi all, I have text file which has these following format: username1:10.0.0.1 username2:10.0.0.3 Basically, it has username with at least 1 IP address. I would like to parse log which contains IP address but might not contains the username, ie: 10.0.0.1 username1 10.0.0.2 - etc... --- whi

mms email parser

2006-11-28 Thread Perlguru
hi, How to parse mms file and save it to a file? In this sample is only beginning of the picture what is read by pop3 client. /Raimo Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-Location: Picture.jpg Content-Disposition: inline /9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABALDA4MCh

Re: Regex...HTML::Parser...Getting webpage data?

2006-08-05 Thread Rob Dixon
Wesley Bresson wrote: > > Thanks for your example script using HTML::Treebuilder, however I'm > trying to figure out why it appears to grab some items but not others. > I've removed the $20-100 limitation (I didn't need it, I really just > need to poll one item) but am still missing some of the it

Re: Regex...HTML::Parser...Getting webpage data?

2006-08-05 Thread Mumia W.
On 08/04/2006 02:25 PM, Wesley Bresson wrote: Thanks for your example script using HTML::Treebuilder, however I'm trying to figure out why it appears to grab some items but not others. [...] What appears to grab some items but not others? You didn't show anyone your program, so how can they

Re: Regex...HTML::Parser...Getting webpage data?

2006-08-05 Thread Wesley Bresson
... Two Web questions in one day! It's hard to know exactly how you're going to your code Wesley, but the stuff below should be a good starter. It pulls in the web site and parses it using HTML::TreeBuilder. It looks for all table row elements that contain exactly five table data elements, wh

Re: Regex...HTML::Parser...Getting webpage data?

2006-08-04 Thread Mumia W.
I am trying to retrieve data from a webpage, say http://www.apmex.com/shop/buy/Silver_American_Eagles.asp?orderid=0 for example, the price of a 2006 1oz Silver American Eagle in the 20-99 price break quantity. Should I use Regex to do that or would I be better off with HTML::Parser ? I've attemped R

  1   2   3   >