RE: HTML::Parser

2003-10-16 Thread Lynn. Rickards


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of
 Noushad Dawood
 Sent: Thursday, October 16, 2003 10:14 AM
 To: [EMAIL PROTECTED]
 Subject: HTML::Parser
 
 
 I don't know why this error still comes up? I got all these 
 files properly
 installed in my perl lib directory. I'm stuck with this. Can 
 some one help
 me resolve this please?
 
 Thanks and regards,
 /nd
 
 Can't locate loadable object for module HTML::Parser in @INC (@INC
 contains: c:/perl/5.6.1/lib c:/perl/site/5.6.1/lib .) at
 c:/perl/5.6.1/lib/HTML/Entities.pm line 108
 Compilation failed in require at 
 c:/perl/5.6.1/lib/HTML/Entities.pm line
 108.
 Compilation failed in require at 
 c:/perl/5.6.1/lib/HTML/HeadParser.pm line
 70.
 BEGIN failed--compilation aborted at 
 c:/perl/5.6.1/lib/HTML/HeadParser.pm
 line 70.
 Compilation failed in require at 
 c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm
 line 44.
 BEGIN failed--compilation aborted at
 c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm line 44.
 Compilation failed in require at 
 c:/perl/5.6.1/lib/LWP/UserAgent.pm line
 79.
 Compilation failed in require at 
 c:/perl/5.6.1/lib/LWP/Simple.pm line 181.
 
 

Do you have a c:\Perl\5.6.1\site\lib\auto\HTML\Parser
directory with the .dll in it? I could always be wrong, but
I'll guess it's looking for the dll. Also, your @INC looks
to have the .../site/lib trail not quite right, compared
to mine - unless that's a typo. 

c:/perl/site/5.6.1/lib ??
c:/perl/5.6.1/site/lib

HTH - Lynn.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: HTML::Parser

2003-10-16 Thread Noushad Dawood

Lynn,

I've 2 sets of lib. May be it is conflicting. Now I've removed site. Still
not okay with HTML::Parser. Here is the new error message.

Can't locate loadable object for module HTML::Parser in @INC (@INC
contains: c:/perl/5.6.1/lib .) at c:/perl/5.6.1/lib/HTML/Entities.pm line
108
Compilation failed in require at c:/perl/5.6.1/lib/HTML/Entities.pm line
108.Compilation failed in require at c:/perl/5.6.1/lib/HTML/HeadParser.pm
line 70.
BEGIN failed--compilation aborted at c:/perl/5.6.1/lib/HTML/HeadParser.pm
line 70.
Compilation failed in require at c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm
line 44.
BEGIN failed--compilation aborted at
c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm line 44.
Compilation failed in require at c:/perl/5.6.1/lib/LWP/UserAgent.pm line
79.
Compilation failed in require at c:/perl/5.6.1/lib/LWP/Simple.pm line 181.

Any thoughts?

/nd



   

  Lynn. Rickards 

  [EMAIL PROTECTED]To:   Noushad 
Dawood/ITDep/ADIA/[EMAIL PROTECTED],
  .net [EMAIL PROTECTED]

   cc: 

  16/10/2003 06:59 Subject:  RE: HTML::Parser  

  PM   

  Please respond to

  lmricka  

   







 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of
 Noushad Dawood
 Sent: Thursday, October 16, 2003 10:14 AM
 To: [EMAIL PROTECTED]
 Subject: HTML::Parser


 I don't know why this error still comes up? I got all these
 files properly
 installed in my perl lib directory. I'm stuck with this. Can
 some one help
 me resolve this please?

 Thanks and regards,
 /nd

 Can't locate loadable object for module HTML::Parser in @INC (@INC
 contains: c:/perl/5.6.1/lib c:/perl/site/5.6.1/lib .) at
 c:/perl/5.6.1/lib/HTML/Entities.pm line 108
 Compilation failed in require at
 c:/perl/5.6.1/lib/HTML/Entities.pm line
 108.
 Compilation failed in require at
 c:/perl/5.6.1/lib/HTML/HeadParser.pm line
 70.
 BEGIN failed--compilation aborted at
 c:/perl/5.6.1/lib/HTML/HeadParser.pm
 line 70.
 Compilation failed in require at
 c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm
 line 44.
 BEGIN failed--compilation aborted at
 c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm line 44.
 Compilation failed in require at
 c:/perl/5.6.1/lib/LWP/UserAgent.pm line
 79.
 Compilation failed in require at
 c:/perl/5.6.1/lib/LWP/Simple.pm line 181.



Do you have a c:\Perl\5.6.1\site\lib\auto\HTML\Parser
directory with the .dll in it? I could always be wrong, but
I'll guess it's looking for the dll. Also, your @INC looks
to have the .../site/lib trail not quite right, compared
to mine - unless that's a typo.

c:/perl/site/5.6.1/lib ??
c:/perl/5.6.1/site/lib

 HTH - Lynn.





**
The contents of this mail are personal opinions of the Author. 
ADIA disclaims all responsibility and accepts no liability, whatsoever.
**

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: HTML::Parser

2003-10-16 Thread Lynn. Rickards


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of
 Noushad Dawood
 Sent: Thursday, October 16, 2003 11:25 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: RE: HTML::Parser
 
 
 
 Lynn,
 
 I've 2 sets of lib. May be it is conflicting. Now I've 
 removed site. Still
 not okay with HTML::Parser. Here is the new error message.
 
 Can't locate loadable object for module HTML::Parser in @INC (@INC
 contains: c:/perl/5.6.1/lib .) at 
 c:/perl/5.6.1/lib/HTML/Entities.pm line
 108
 Compilation failed in require at 
 c:/perl/5.6.1/lib/HTML/Entities.pm line
 108.Compilation failed in require at 
 c:/perl/5.6.1/lib/HTML/HeadParser.pm
 line 70.
 BEGIN failed--compilation aborted at 
 c:/perl/5.6.1/lib/HTML/HeadParser.pm
 line 70.
 Compilation failed in require at 
 c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm
 line 44.
 BEGIN failed--compilation aborted at
 c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm line 44.
 Compilation failed in require at 
 c:/perl/5.6.1/lib/LWP/UserAgent.pm line
 79.
 Compilation failed in require at 
 c:/perl/5.6.1/lib/LWP/Simple.pm line 181.
 
 Any thoughts?
 
 /nd
 
This is where I would bow to anybody else's superior 
knowledge, but here's my guess.

You didn't say if you found the .dll under site/lib/auto

I hope you didn't physically delete site/lib - it's
needed. Core modules go in lib, add-ons (as installed
from CPAN or PPM) go in site/lib. I believe html::parse
is one of those extras provided out-of-box by Activestate,
and it should live in site/lib.

Given your @INC points to c:/perl/site/5.6.1/lib, I 
suggest first that you check that path actually exists,
and that it contains auto/HTML/Parser/Parser.dll. I 
just can't help thinking that's where your problem is.

Did you manually relocate your installation? 

Lynn.

 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Behalf Of
  Noushad Dawood
  Sent: Thursday, October 16, 2003 10:14 AM
  To: [EMAIL PROTECTED]
  Subject: HTML::Parser
 
 
  I don't know why this error still comes up? I got all these
  files properly
  installed in my perl lib directory. I'm stuck with this. Can
  some one help
  me resolve this please?
 
  Thanks and regards,
  /nd
 
  Can't locate loadable object for module HTML::Parser in @INC (@INC
  contains: c:/perl/5.6.1/lib c:/perl/site/5.6.1/lib .) at
  c:/perl/5.6.1/lib/HTML/Entities.pm line 108
  Compilation failed in require at
  c:/perl/5.6.1/lib/HTML/Entities.pm line
  108.
  Compilation failed in require at
  c:/perl/5.6.1/lib/HTML/HeadParser.pm line
  70.
  BEGIN failed--compilation aborted at
  c:/perl/5.6.1/lib/HTML/HeadParser.pm
  line 70.
  Compilation failed in require at
  c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm
  line 44.
  BEGIN failed--compilation aborted at
  c:/perl/5.6.1/lib/LWP/Parallel/Protocol.pm line 44.
  Compilation failed in require at
  c:/perl/5.6.1/lib/LWP/UserAgent.pm line
  79.
  Compilation failed in require at
  c:/perl/5.6.1/lib/LWP/Simple.pm line 181.
 
 
 
 Do you have a c:\Perl\5.6.1\site\lib\auto\HTML\Parser
 directory with the .dll in it? I could always be wrong, but
 I'll guess it's looking for the dll. Also, your @INC looks
 to have the .../site/lib trail not quite right, compared
 to mine - unless that's a typo.
 
 c:/perl/site/5.6.1/lib ??
 c:/perl/5.6.1/site/lib
 
  HTH - Lynn.
 
 
 
 
 
 **
 The contents of this mail are personal opinions of the Author. 
 ADIA disclaims all responsibility and accepts no liability, 
 whatsoever.
 **
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: HTML::Parser

2003-10-16 Thread michael higgins
[EMAIL PROTECTED] wrote:

I don't know why this error still comes up? I got all these files properly
installed in my perl lib directory. I'm stuck with this. Can some one help
me resolve this please?


Maybe you need to check for the missing 'loadable objects'. Look for 
loadable objects under 'auto'
  -- ||| --
C:/Perl/site/lib/auto/HTML/Parser/Parser.exp
C:/Perl/site/lib/auto/HTML/Parser/Parser.bs
C:/Perl/site/lib/auto/HTML/Parser/Parser.dll
C:/Perl/site/lib/auto/HTML/Parser/.packlist
C:/Perl/site/lib/auto/HTML/Parser/Parser.lib

... if they are where they should be, I'd guess the problem is perhaps 
something other than a botched ppm installation (which I've never had 
happen, really). Did you compile htmlparser, or perl, yourself? Did you 
use ppm with an AS perl?

-- mike higgins



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: HTML::Parser question

2002-09-26 Thread Ron Grabowski

 use strict;
 use HTML::Parser 3.00 ();

Thank you for posting some HTML::Parser code. For as long as I've been
doing Perl I've only seen real HTML::Parser code a handful of times.
People are quick to say just use HTML::Parser. If most people are
anything like me, I just end up using some regexs and a few substr()s to
hack out what I want. Its good to see people actually using such a
talked about module.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: HTML::Parser question

2002-09-25 Thread Frederic Bournival

Hello,

i will answer myself, may be it will help someone:


Here is my question:


i want to convert ul, ol and li elements to ascii text

ul
  liOne/li
  liTwo/li
/ul
...will become:
* One
* Two

ol
  liOne/li
  liTwo/li
/ol
...will become:
1. One
2. Two

Did somebody already have fun with this ?
#


And here is my answer:

#!/usr/bin/perl

use strict;
use HTML::Parser 3.00 ();


#// Repeat a character
sub repStr {
my $car = shift;
my $number = shift;
my $str;
for (my $ctr = 1; $ctr = $number; $ctr++) {
$str .= $car;
}
return $str;
}


my %inside;

my $level = 0;
my $ctrOl = 0;
my %levels;
my %OlNumbers;

sub tag
{
my($tag, $num) = @_;
$inside{$tag} += $num;

#// LI
if ( ($tag eq 'li')  ($num eq '+1') ) {
if ($levels{$level} eq 'ol') {
$OlNumbers{$level}++;
print repStr(' ', 4 * $level) . $OlNumbers{$level} . .;
} else {
#// LI normal
print repStr(' ', 4 * $level) . '•';
}
#// UL OPEN
} elsif ( ($tag eq 'ul')  ($num eq '+1') ) {
$level++;
$levels{$level} = 'ul';
#// UL CLOSE
} elsif ( ($tag eq 'ul')  ($num eq '-1') ) {
$level--;
#// OL OPEN
} elsif ( ($tag eq 'ol')  ($num eq '+1') ) {
$level++;
$levels{$level} = 'ol';
$OlNumbers{$level} = 0;
#// OL CLOSE
} elsif ( ($tag eq 'ol')  ($num eq '-1') ) {
$level--;
} else {
print ;  # not for all tags
}
}

sub text
{
return if $inside{script} || $inside{style};

print $_[0];
}

HTML::Parser-new(api_version = 3,
  handlers= [start = [\tag, tagname, '+1'],
  end   = [\tag, tagname, '-1'],
  text  = [\text, dtext],
 ],
  marked_sections = 1,
)-parse_file(shift) || die Can't open file: $!\n;;

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: HTML::Parser question

2002-09-25 Thread Joseph P. Discenza

Frederic Bournival wrote, on Wednesday, September 25, 2002 11:14 AM
: i will answer myself, may be it will help someone:

I'm sure it'll help someone; but I've got something that'll help you.

: #// Repeat a character
: sub repStr {
:   my $car = shift;
:   my $number = shift;
:   my $str;
:   for (my $ctr = 1; $ctr = $number; $ctr++) {
:   $str .= $car;
:   }
:   return $str;
: }

Check out the 'x' operator (perldoc perlop); it does exactly
what you're trying to do with this.

Joe

==
  Joseph P. Discenza, Sr. Programmer/Analyst
   mailto:[EMAIL PROTECTED]
 
  Carleton Inc.   http://www.carletoninc.com
  574.243.6040 ext. 300fax: 574.243.6060
 
Providing Financial Solutions and Compliance for over 30 Years
* Please note that our Area Code has changed to 574! * 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs