XML::LibXML::Reader source specification error

2010-06-12 Thread perl
I tried to use LibXML .. when i never to the correct libXML read file ... when i tried to use the LWP download which is an XML .. how to use it please help me ... /use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $response = $ua->get("http://www.perlmonks.org/?displaytype=xml;node_id=3989";);

Re: XML::LibXML::Reader source specification error

2010-06-12 Thread Shlomi Fish
Hi perlatwork, On Saturday 12 Jun 2010 19:59:55 perl wrote: > I tried to use LibXML .. when i never to the correct libXML read file > ... when i tried to use the LWP download which is an XML .. how to use > it please help me ... > First of all, add "use strict;" and "use warnings;". That would

Re: A subroutine to find every occurrence of a substring in a string?

2010-06-12 Thread Harry Putnam
"Chas. Owens" writes: > A quick reference guide for operators: > http://github.com/cowens/perlopquick/blob/master/perlopquick.pod Is this just a typo, or am I not understanding what is presented at, I think, the 5th occurrence of the term `Example' on the above URL: Example my @a = qw/ a b

how to get XML::LibXML perfect xpath query ?

2010-06-12 Thread perl
i have tried to use the LibXML modules to xpath a document but its getting complicated .. i have seen this example over forum here . use XML::LibXML ; use strict; use warnings; { my $xml = <<'XML'; Hello world! XML my $parser = XML::LibXML->new; my $doc

Re: A subroutine to find every occurrence of a substring in a string?

2010-06-12 Thread John W. Krahn
Harry Putnam wrote: "Chas. Owens" writes: A quick reference guide for operators: http://github.com/cowens/perlopquick/blob/master/perlopquick.pod Is this just a typo, or am I not understanding what is presented at, I think, the 5th occurrence of the term `Example' on the above URL: Example

Re: A subroutine to find every occurrence of a substring in a string?

2010-06-12 Thread Chas. Owens
On Sat, Jun 12, 2010 at 16:29, Harry Putnam wrote: > "Chas. Owens" writes: > >> A quick reference guide for operators: >> http://github.com/cowens/perlopquick/blob/master/perlopquick.pod > > Is this just a typo, or am I not understanding what is presented at, I > think, the 5th occurrence of the

Re: A subroutine to find every occurrence of a substring in a string?

2010-06-12 Thread Chas. Owens
On Sat, Jun 12, 2010 at 18:23, John W. Krahn wrote: snip > Unlike double quoted strings, that is the only escape sequence. > > > The other escape sequence is '\\', as in: > >    my $quote = 'He said \'I like quotes.\\'; snip Yep, that is an error as well. And there are most likely more. I foun

Re: A subroutine to find every occurrence of a substring in a string?

2010-06-12 Thread Chas. Owens
On Sat, Jun 12, 2010 at 21:32, Chas. Owens wrote: > On Sat, Jun 12, 2010 at 18:23, John W. Krahn wrote: > snip >> Unlike double quoted strings, that is the only escape sequence. >> >> >> The other escape sequence is '\\', as in: >> >>    my $quote = 'He said \'I like quotes.\\'; > snip > > Yep,

Re: A subroutine to find every occurrence of a substring in a string?

2010-06-12 Thread Randal L. Schwartz
> "Peng" == Peng Yu writes: Peng> I can't find an existing perl subroutine (in the library) to find Peng> every occurrence of a substring in a string. The following webpage Peng> "Example 3b. How to find every occurrence" uses a loop to do so. But Peng> I'd prefer a subroutine. You had me up

Re: A subroutine to find every occurrence of a substring in a string?

2010-06-12 Thread Chas. Owens
On Sat, Jun 12, 2010 at 22:18, Randal L. Schwartz wrote: >> "Peng" == Peng Yu writes: > > Peng> I can't find an existing perl subroutine (in the library) to find > Peng> every occurrence of a substring in a string. The following webpage > Peng> "Example 3b. How to find every occurrence" uses