[29833] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1076 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 28 21:09:47 2007

Date: Wed, 28 Nov 2007 18:09:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 28 Nov 2007     Volume: 11 Number: 1076

Today's topics:
        Can't locate Digest/SHA.pm cannot install Digest/SHA <myalog@gmail.com>
    Re: Can't locate Digest/SHA.pm cannot install Digest/SH <1usa@llenroc.ude.invalid>
    Re: Can't locate Digest/SHA.pm cannot install Digest/SH <smallpond@juno.com>
    Re: Can't locate Digest/SHA.pm cannot install Digest/SH <myalog@gmail.com>
    Re: Can't locate Digest/SHA.pm cannot install Digest/SH <1usa@llenroc.ude.invalid>
    Re: Close function blocks forever when reading from pip <google@markginsburg.com>
    Re: Close function blocks forever when reading from pip xhoster@gmail.com
    Re: named pipe and "Text file busy" <ben@morrow.me.uk>
    Re: out of memory <ben@morrow.me.uk>
    Re: page 124 of the camel book <wade@zaxfuuq.net>
        parsing a mbox file in PERL <mc79@cse.buffalo.edu>
    Re: parsing a mbox file in PERL <ben@morrow.me.uk>
    Re: parsing a mbox file in PERL <jimsgibson@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 28 Nov 2007 13:32:46 -0800 (PST)
From: myalo <myalog@gmail.com>
Subject: Can't locate Digest/SHA.pm cannot install Digest/SHA
Message-Id: <d54a8951-46a9-4524-9488-86a1418bee64@i29g2000prf.googlegroups.com>

Hi
We are using IIS 6.0 on windows 2003. We have installed Active Perl.
We have script that uses
use Digest::SHA qw(hmac_sha256_hex);
When running it fails on
Can't locate Digest/SHA.pm in @INC (@INC contains: E:/Perl/site/lib E:/
Perl/lib
 .) at itunesu.pl line 87.
BEGIN failed--compilation aborted at itunesu.pl line 87.

I read and tried to use cpan to install. Here are the results:

cpan> install Digest::SHA
Running install for module 'Digest::SHA'
Running make for M/MS/MSHELOR/Digest-SHA-5.45.tar.gz

CPAN: checksum security checks disabled because Digest::SHA not
installed.
Please consider installing the Digest::SHA module.

CPAN: Time::HiRes loaded ok (v1.9707)
Scanning cache E:\Perl/cpan/build for sizes
 ............................................................................DONE

CPAN: Compress::Zlib loaded ok (v1.4201)
CPAN: Archive::Tar loaded ok (v1.3201)
Digest-SHA-5.45/
Digest-SHA-5.45/README
Digest-SHA-5.45/src/
Digest-SHA-5.45/src/hmac.h
Digest-SHA-5.45/src/hmacxtra.c
Digest-SHA-5.45/src/sha.h
Digest-SHA-5.45/src/shaxtra.c
Digest-SHA-5.45/src/sha64bit.h
Digest-SHA-5.45/src/sha64bit.c
Digest-SHA-5.45/src/hmac.c
Digest-SHA-5.45/src/sha.c
Digest-SHA-5.45/Makefile.PL
Digest-SHA-5.45/examples/
Digest-SHA-5.45/examples/dups
Digest-SHA-5.45/META.yml
Digest-SHA-5.45/Changes
Digest-SHA-5.45/shasum
Digest-SHA-5.45/typemap
Digest-SHA-5.45/MANIFEST
Digest-SHA-5.45/SHA.pm
Digest-SHA-5.45/t/
Digest-SHA-5.45/t/nistbyte.t
Digest-SHA-5.45/t/nistbit.t
Digest-SHA-5.45/t/rfc2202.t
Digest-SHA-5.45/t/bitbuf.t
Digest-SHA-5.45/t/hmacsha.t
Digest-SHA-5.45/t/podcover.t
Digest-SHA-5.45/t/methods.t
Digest-SHA-5.45/t/sha224.t
Digest-SHA-5.45/t/dumpload.t
Digest-SHA-5.45/t/sha384.t
Digest-SHA-5.45/t/sha1.t
Digest-SHA-5.45/t/sha512.t
Digest-SHA-5.45/t/gg.t
Digest-SHA-5.45/t/allfcns.t
Digest-SHA-5.45/t/gglong.t
Digest-SHA-5.45/t/pod.t
Digest-SHA-5.45/t/woodbury.t
Digest-SHA-5.45/t/fips198.t
Digest-SHA-5.45/t/ireland.t
Digest-SHA-5.45/t/base64.t
Digest-SHA-5.45/t/sha256.t
Digest-SHA-5.45/SHA.xs
CPAN: File::Temp loaded ok (v0.18)

CPAN.pm: Going to build M/MS/MSHELOR/Digest-SHA-5.45.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Digest::SHA
Could not read 'E:\Perl\cpan\build\Digest-SHA-5.45-KfEI5d\META.yml'.
Falling bac
k to other methods to determine prerequisites
'nmake' is not recognized as an internal or external command,
operable program or batch file.
MSHELOR/Digest-SHA-5.45.tar.gz
nmake -- NOT OK
Warning (usually harmless): 'YAML' not installed, will not store
persistent stat
e
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
MSHELOR/Digest-SHA-5.45.tar.gz : make NO

Any idea what is wrong and how to fix it?
Thanks


------------------------------

Date: Wed, 28 Nov 2007 22:34:31 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Can't locate Digest/SHA.pm cannot install Digest/SHA
Message-Id: <Xns99F6B2C7AEC1Basu1cornelledu@127.0.0.1>

myalo <myalog@gmail.com> wrote in
news:d54a8951-46a9-4524-9488-86a1418bee64@i29g2000prf.googlegroups.com: 

> Hi
> We are using IIS 6.0 on windows 2003. We have installed Active Perl.
> We have script that uses
> use Digest::SHA qw(hmac_sha256_hex);
> When running it fails on
> Can't locate Digest/SHA.pm in @INC (@INC contains: E:/Perl/site/lib
> E:/ Perl/lib
> .) at itunesu.pl line 87.
> BEGIN failed--compilation aborted at itunesu.pl line 87.
> 
> I read and tried to use cpan to install. 

C:\Home> ppm install Digest-SHA
Downloading Digest-SHA-5.45...done
Unpacking Digest-SHA-5.45...done
Generating HTML for Digest-SHA-5.45...done
Updating files in site area...done
   9 files installed


-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>



------------------------------

Date: Wed, 28 Nov 2007 14:55:59 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: Can't locate Digest/SHA.pm cannot install Digest/SHA
Message-Id: <c04e236e-a205-4897-b6a9-57c2407ac272@o42g2000hsc.googlegroups.com>

On Nov 28, 4:32 pm, myalo <mya...@gmail.com> wrote:
> Hi
> We are using IIS 6.0 on windows 2003. We have installed Active Perl.
> We have script that uses
> use Digest::SHA qw(hmac_sha256_hex);
> When running it fails on
> Can't locate Digest/SHA.pm in @INC (@INC contains: E:/Perl/site/lib E:/
> Perl/lib
> .) at itunesu.pl line 87.
> BEGIN failed--compilation aborted at itunesu.pl line 87.
>
> I read and tried to use cpan to install. Here are the results:
>
> cpan> install Digest::SHA
> Running install for module 'Digest::SHA'
> Running make for M/MS/MSHELOR/Digest-SHA-5.45.tar.gz
>
> CPAN: checksum security checks disabled because Digest::SHA not
> installed.
> Please consider installing the Digest::SHA module.
>
> CPAN: Time::HiRes loaded ok (v1.9707)
> Scanning cache E:\Perl/cpan/build for sizes
> ............................................................................DONE
>
> CPAN: Compress::Zlib loaded ok (v1.4201)
> CPAN: Archive::Tar loaded ok (v1.3201)
> Digest-SHA-5.45/
> Digest-SHA-5.45/README
> Digest-SHA-5.45/src/
> Digest-SHA-5.45/src/hmac.h
> Digest-SHA-5.45/src/hmacxtra.c
> Digest-SHA-5.45/src/sha.h
> Digest-SHA-5.45/src/shaxtra.c
> Digest-SHA-5.45/src/sha64bit.h
> Digest-SHA-5.45/src/sha64bit.c
> Digest-SHA-5.45/src/hmac.c
> Digest-SHA-5.45/src/sha.c
> Digest-SHA-5.45/Makefile.PL
> Digest-SHA-5.45/examples/
> Digest-SHA-5.45/examples/dups
> Digest-SHA-5.45/META.yml
> Digest-SHA-5.45/Changes
> Digest-SHA-5.45/shasum
> Digest-SHA-5.45/typemap
> Digest-SHA-5.45/MANIFEST
> Digest-SHA-5.45/SHA.pm
> Digest-SHA-5.45/t/
> Digest-SHA-5.45/t/nistbyte.t
> Digest-SHA-5.45/t/nistbit.t
> Digest-SHA-5.45/t/rfc2202.t
> Digest-SHA-5.45/t/bitbuf.t
> Digest-SHA-5.45/t/hmacsha.t
> Digest-SHA-5.45/t/podcover.t
> Digest-SHA-5.45/t/methods.t
> Digest-SHA-5.45/t/sha224.t
> Digest-SHA-5.45/t/dumpload.t
> Digest-SHA-5.45/t/sha384.t
> Digest-SHA-5.45/t/sha1.t
> Digest-SHA-5.45/t/sha512.t
> Digest-SHA-5.45/t/gg.t
> Digest-SHA-5.45/t/allfcns.t
> Digest-SHA-5.45/t/gglong.t
> Digest-SHA-5.45/t/pod.t
> Digest-SHA-5.45/t/woodbury.t
> Digest-SHA-5.45/t/fips198.t
> Digest-SHA-5.45/t/ireland.t
> Digest-SHA-5.45/t/base64.t
> Digest-SHA-5.45/t/sha256.t
> Digest-SHA-5.45/SHA.xs
> CPAN: File::Temp loaded ok (v0.18)
>
> CPAN.pm: Going to build M/MS/MSHELOR/Digest-SHA-5.45.tar.gz
>
> Checking if your kit is complete...
> Looks good
> Writing Makefile for Digest::SHA
> Could not read 'E:\Perl\cpan\build\Digest-SHA-5.45-KfEI5d\META.yml'.
> Falling bac
> k to other methods to determine prerequisites
> 'nmake' is not recognized as an internal or external command,
> operable program or batch file.
> MSHELOR/Digest-SHA-5.45.tar.gz
> nmake -- NOT OK
> Warning (usually harmless): 'YAML' not installed, will not store
> persistent stat
> e
> Running make test
> Can't test without successful make
> Running make install
> Make had returned bad status, install seems impossible
> Failed during this command:
> MSHELOR/Digest-SHA-5.45.tar.gz : make NO
>
> Any idea what is wrong and how to fix it?
> Thanks

(@INC contains: E:/Perl/site/lib E:/Perl/lib .)

Could Digest/SHA be installed in a directory that is missing from your
@INC list?


------------------------------

Date: Wed, 28 Nov 2007 14:57:51 -0800 (PST)
From: myalo <myalog@gmail.com>
Subject: Re: Can't locate Digest/SHA.pm cannot install Digest/SHA
Message-Id: <bd7cbb49-d6d3-4b23-ba37-09a3b06f5f0b@s19g2000prg.googlegroups.com>

Thank you for very quick response.
Your suggestion worked. I am missing another part now. Here is a copy
from the command prompet
LWP will support https URLs if the Crypt::SSLeay module is installed.
More information at <http://www.linpro.no/lwp/libwww-perl/README.SSL>.

E:\Webapps\ajula\CGI>ppm install Crypt-SSLeay
ppm install failed: Can't find any package that provide Crypt-SSLeay

As you can see I was trying to use your resolution to install
Crypt::SSLeay but this package is not found. Am I doing something
wrong?

Moshe

On Nov 28, 2:34 pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
> myalo <mya...@gmail.com> wrote innews:d54a8951-46a9-4524-9488-86a1418bee64@i29g2000prf.googlegroups.com:
>
> > Hi
> > We are using IIS 6.0 on windows 2003. We have installed Active Perl.
> > We have script that uses
> > use Digest::SHA qw(hmac_sha256_hex);
> > When running it fails on
> > Can't locate Digest/SHA.pm in @INC (@INC contains: E:/Perl/site/lib
> > E:/ Perl/lib
> > .) at itunesu.pl line 87.
> > BEGIN failed--compilation aborted at itunesu.pl line 87.
>
> > I read and tried to use cpan to install.
>
> C:\Home> ppm install Digest-SHA
> Downloading Digest-SHA-5.45...done
> Unpacking Digest-SHA-5.45...done
> Generating HTML for Digest-SHA-5.45...done
> Updating files in site area...done
>    9 files installed
>
> --
> A. Sinan Unur <1...@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
> clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>



------------------------------

Date: Wed, 28 Nov 2007 23:10:43 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Can't locate Digest/SHA.pm cannot install Digest/SHA
Message-Id: <Xns99F6B8EB63F19asu1cornelledu@127.0.0.1>

myalo <myalog@gmail.com> wrote in
news:bd7cbb49-d6d3-4b23-ba37-09a3b06f5f0b@s19g2000prg.googlegroups.com: 

[ Don't top-post and don't quote sigs. Quoted material snipped. ]

> Thank you for very quick response.
> Your suggestion worked. I am missing another part now. Here is a copy
> from the command prompet
> LWP will support https URLs if the Crypt::SSLeay module is installed.
> More information at <http://www.linpro.no/lwp/libwww-perl/README.SSL>.
> 
> E:\Webapps\ajula\CGI>ppm install Crypt-SSLeay
> ppm install failed: Can't find any package that provide Crypt-SSLeay
> 
> As you can see I was trying to use your resolution to install
> Crypt::SSLeay but this package is not found. Am I doing something
> wrong?

http://www.google.com/search?q=windows+crypt-ssleay

Do try to help yourself (for example, checking the program group for 
ActiveState Perl would have revealed the existence of "Perl Package 
Manager"). 

Do read the posting guidelines.

Sinan


-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>



------------------------------

Date: Wed, 28 Nov 2007 13:09:39 -0800 (PST)
From: Mark <google@markginsburg.com>
Subject: Re: Close function blocks forever when reading from piped output
Message-Id: <0b9d1703-f6c1-4017-9c4e-9d6fdbd49d49@e25g2000prg.googlegroups.com>

On Nov 28, 10:18 am, xhos...@gmail.com wrote:

> But why close, rather than just going about your business with an open but
> no longer used file handle?  If you want the return value of the close,
> then anything you do to force the close to happen means that the return
> value you get will now be driven by the forcing method rather than the
> natural operation of the child, and so probably isn't worth having.
>

I tried removing the close() as you suggested but then the perl
program hungs at the end of the program, presumably, while doing an
implicit close.


------------------------------

Date: 28 Nov 2007 22:12:45 GMT
From: xhoster@gmail.com
Subject: Re: Close function blocks forever when reading from piped output
Message-Id: <20071128171247.610$vg@newsreader.com>

Mark <google@markginsburg.com> wrote:
> On Nov 28, 10:18 am, xhos...@gmail.com wrote:
>
> > But why close, rather than just going about your business with an open
> > but no longer used file handle?  If you want the return value of the
> > close, then anything you do to force the close to happen means that the
> > return value you get will now be driven by the forcing method rather
> > than the natural operation of the child, and so probably isn't worth
> > having.
> >
>
> I tried removing the close() as you suggested but then the perl
> program hungs at the end of the program, presumably, while doing an
> implicit close.

So I assume you find that undesirable? :)

The same thing happens if a lexically held find handle goes of scope,
so this implicit close could get you in that case to.

And if I capture the pid and then kill it before the close, the close
doesn't hang but doing this seems to leave some kind of CPU-draining
zombies behind.

Ugg.  I'm glad I don't need to program in Perl for Windows very much.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


------------------------------

Date: Wed, 28 Nov 2007 23:17:46 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: named pipe and "Text file busy"
Message-Id: <qh9125-f73.ln1@osiris.mauzo.dyndns.org>


Quoth alexfayn@gmail.com:
> > That's bizarre. Attempting to write to apipewhich isn't open for
> > reading should raise SIGPIPE, and if that is caught the write should
> > fail with EPIPE. Are you *sure* this is what's happening? What happens
> > if you run this Perl program to write to thepipe:
> 
> If i just create a new pipe and there's no script (reader) running,
> then the program blocks.
> If i've got the script running later - it will read 'foo'  from the
> pipe. However after i kill the script and then
> run this program again (it does not matter whether i start the reader
> this time, the behavior is identical with either my Perl script
> running or stopped) the program can't write and reports an error "Text
> file busy"

This is very odd: the only way you're supposed to be able to get ETXTBSY
is by trying to write to a file that's currently being executed. Can you
write a trivial reader program in C and try that instead? If that fails
then your problem is with your OS or your filesystem, not with Perl. If
not, can you tell us

    1. which version of Linux you are using

    2. what type of fs the fifo is being created on

    3. an exact recipe to reproduce the problem, preferably in the form
    of a minimal script that creates a fifo, forks and attempts to talk
    to itself.

Ben



------------------------------

Date: Wed, 28 Nov 2007 22:54:17 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: out of memory
Message-Id: <p58125-v03.ln1@osiris.mauzo.dyndns.org>


Quoth aniait <aithalanirudh@gmail.com>:
> Is there any way to solve the 'out of memory exception' of perl on
> windows? I got this when i tried to dump a large hash into a file
> using Dumper.

Increase the size of your swapfile :). Windows machines usually don't
have anywhere near enough swap.

Ben



------------------------------

Date: Wed, 28 Nov 2007 17:56:38 -0700
From: "Wade Ward" <wade@zaxfuuq.net>
Subject: Re: page 124 of the camel book
Message-Id: <1196297320_65@sp12lax.superfeed.net>


<jl_post@hotmail.com> wrote in message 
news:158c9e2e-e20a-441e-ab68-685a2362143f@i29g2000prf.googlegroups.com...
> On Nov 25, 10:14 pm, "Wade Ward" <w...@zaxfuuq.net> wrote:
>>
>> I think that the syntax I'm looking for is on page 124 in the first two 
>> code
>> snippets:
>>
>>     {
>>     do {
>>           last if $x = $y ** 2;
>>           # do something here
>>     }  while $x++ <= $z;
>>
>> }
>>
>> and DO_LAST ...DO_NEXT immediately following.
>>
>> 1)  Don't you want '==' instaed of '=' on the test condition?
>
>
>   Well, that test condition is just for the sake of example.  To be
> honest, if I came across it in some code I was reviewing, I'd
> immediately suspect that it was a bug and then carefully review the
> code around it to confirm to suspicions.  But since it's example code,
> it might as well say "last if $blah_blah_blah;" since a complete
> working program isn't given.
>
>
>> 2)  What are the outside curly braces doing here?  What do they belong 
>> to?
>
>
>   The "last", "next", and "redo" statements are nice because they can
> jump out of (or around in) blocks enclosed by curly braces.  For
> example, you can have a block of code like this:
>
>      {
>         # do something here
>         last  if $x == 0;
>         # do something here that involves dividing by $x
>      }
>
> In this example, the program execution will jump out of the block mid-
> way if $x happens to be zero, preventing the second-half of the block
> to be executed.  Programmers familiar with other languages might write
> it like this:
>
>      // Do something here.
>
>      if (x != 0)
>      {
>         // Do something here that involves dividing by x
>      }
>
> While this approach definitely works, it kind of "divides" the
> original block in two and makes it look like there are two separate
> blocks of code, each independent of the other.  This might tempt
> future maintainers to insert totally unrelated code between the two
> blocks.
>
>   I'm not saying that the second approach is bad; I'm just saying
> that Perl programmers have the option of writing it the first way,
> which they might use if they want to give future maintainers the
> impression that the code all belongs in one block and should not be
> separated.
>
>   Now, if you look up "perldoc -f last", you'll see that "last"
> cannot be used to exit a "do-block" ("perldoc -f do" also says that).
> So back to your question:
>
>> 2)  What are the outside curly braces doing here?  What do they belong 
>> to?
>
> The outside curly braces are to provide a way of controlling where the
> "last" keyword will jump to if/when it is invoked.  "last" will NOT
> jump to the end of the innermost braces since they belong to a
> do{}while loop.  Therefore, an extra set of curly braces (surrounding
> the do{}while loop) is needed to completely jump out of the loop.
>
>   I hope this helps, Wade.
I'm experimenting with different options and think I have achieved a control 
that can be adapted to suit the purpose at hand.

## contract55.pl
## one sided increasingly good guesses
## contributors: joe smith, jean luc


use strict;
use warnings;

#integer, parameter :: dp=kind(1.0d0)
#real(kind=dp):: x_calc, x_sought, base, term
#real(kind=dp):: penultimate
#integer::  power

my $x_calc = 5.3;
my $x_sought = 7.321928094887362;
my $base = .5;
my $term = -.00057;
my $ penultimate = -.00057;

my $power = 1;

 do     {{
         $x_calc =  $x_calc - 1;
     #    last  if $x_calc < 0;
           print STDOUT "x calc  is $x_calc\n";
        do     {{
         $x_sought =  $x_sought - 1;
     #    last  if $x_sought < 0;
           print STDOUT "x sought  is $x_sought\n";

      }} until $x_sought < 0;
      }} until $x_calc < 0;





print STDOUT "power is $power\n";
print STDOUT "base is $base\n";

# end output prelims

# code elided
# perl contract55.pl
# perl contract55.pl 2>text55.txt >text56.txt

__END__
#begin output prelims
x calc  is 4.3
x sought  is 6.32192809488736
x sought  is 5.32192809488736
x sought  is 4.32192809488736
x sought  is 3.32192809488736
x sought  is 2.32192809488736
x sought  is 1.32192809488736
x sought  is 0.321928094887362
x sought  is -0.678071905112638
x calc  is 3.3
x sought  is -1.67807190511264
x calc  is 2.3
x sought  is -2.67807190511264
x calc  is 1.3
x sought  is -3.67807190511264
x calc  is 0.3
x sought  is -4.67807190511264
x calc  is -0.7
x sought  is -5.67807190511264
power is 1
base is 0.5
# end output

A couple things I have found interesdting:

{
You can stick this anywhere and have it run once

}

If you uncomment the last line with equivalent end conditions in last and 
until
        do     {{
         $x_sought =  $x_sought - 1;
     #    last  if $x_sought < 0;
           print STDOUT "x sought  is $x_sought\n";

      }} until $x_sought < 0;
, you don't execute the ultimate print.
-- 
wade ward

wade@zaxfuuq.net
435 -838-7760 



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


------------------------------

Date: Wed, 28 Nov 2007 19:46:46 -0500
From: Madhusudhanan Chandrasekaran <mc79@cse.buffalo.edu>
Subject: parsing a mbox file in PERL
Message-Id: <Pine.SOL.4.56.0711281938240.20060@pollux.cse.buffalo.edu>

Hi,

I am trying to parse a mbox file and extract the message's
body. I am using Mail::MboxParser for this purpose. In my
source code, I have


 my $mb = Mail::MboxParser->new('some_mailbox',
                                decode     => 'ALL',
                                 parseropts => $parseropts);

with the $parseropts initialized. However, it gives me the
following error message:

Can't locate object method "new" via package "MIME::Parser" at
/usr/local/share/perl/5.8.8/Mail/MboxParser/Mail.pm line 513.

I've MIME::Parser installed and it does seem to have a new method.

Any pointers appreciated.

Thanks in advance,

_Madhu
--------------------------------------------------
All in all I'm just another brick in the FIREWALL.



------------------------------

Date: Thu, 29 Nov 2007 01:16:17 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: parsing a mbox file in PERL
Message-Id: <1gg125-ul3.ln1@osiris.mauzo.dyndns.org>


Quoth Madhusudhanan Chandrasekaran <mc79@cse.buffalo.edu>:
> 
> I am trying to parse a mbox file and extract the message's
> body. I am using Mail::MboxParser for this purpose. In my
> source code, I have
> 
>  my $mb = Mail::MboxParser->new('some_mailbox',
>                                 decode     => 'ALL',
>                                  parseropts => $parseropts);
> 
> with the $parseropts initialized. However, it gives me the
> following error message:
> 
> Can't locate object method "new" via package "MIME::Parser" at
> /usr/local/share/perl/5.8.8/Mail/MboxParser/Mail.pm line 513.
> 
> I've MIME::Parser installed and it does seem to have a new method.

Either you haven't, or perl's failing to find it. M::MbP::Mail requires
MIME::Parser in an eval block, so you won't get an error if it can't be
found: not the most helpful thing to do. Try adding a

    use MIME::Parser;

line before your

    use Mail::MboxParser;

line to get the error message earlier. Then work out why perl can't find
MIME::Parser :).

Ben



------------------------------

Date: Wed, 28 Nov 2007 17:30:37 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: parsing a mbox file in PERL
Message-Id: <281120071730373940%jimsgibson@gmail.com>

In article <Pine.SOL.4.56.0711281938240.20060@pollux.cse.buffalo.edu>,
Madhusudhanan Chandrasekaran <mc79@cse.buffalo.edu> wrote:

> Hi,
> 
> I am trying to parse a mbox file and extract the message's
> body. I am using Mail::MboxParser for this purpose. In my
> source code, I have
> 
> 
>  my $mb = Mail::MboxParser->new('some_mailbox',
>                                 decode     => 'ALL',
>                                  parseropts => $parseropts);
> 
> with the $parseropts initialized. However, it gives me the
> following error message:
> 
> Can't locate object method "new" via package "MIME::Parser" at
> /usr/local/share/perl/5.8.8/Mail/MboxParser/Mail.pm line 513.
> 
> I've MIME::Parser installed and it does seem to have a new method.
> 
> Any pointers appreciated.

What versions are you running? Have you tried upgrading to the latest? 

Lines 511-515 of Mail::MboxParser.pm are as follows:


        if (! defined $Parser) {
            eval { require MIME::Parser; };
            $Parser = new MIME::Parser; $Parser->output_to_core(1);
            $Parser->extract_uuencode($self->{ARGS}->{uudecode});
        }

 ... and it looks like the code is not checking if the "require
MIME::Parser" worked :^(

Make sure MIME::Parser is installed properly. Try putting 

  warn("No MIME::Parser $@") if $@; 

after the eval.

-- 
Jim Gibson

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 1076
***************************************


home help back first fref pref prev next nref lref last post