[22310] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4531 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 10 18:12:23 2003

Date: Mon, 10 Feb 2003 15:11:25 -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           Mon, 10 Feb 2003     Volume: 10 Number: 4531

Today's topics:
        Best way to fork multiple servers (Maynard)
    Re: Best way to fork multiple servers <goldbb2@earthlink.net>
        Can perl receive input from the CRON line ? pcg2001@sympatico.ca
    Re: Can perl receive input from the CRON line ? <w_ichmann@uni-wuppertal.de>
        can't locate Mail/MboxParser.pm in @INC <dbryson@gmx.de>
    Re: can't locate Mail/MboxParser.pm in @INC <tony_curtis32@yahoo.com>
    Re: can't locate Mail/MboxParser.pm in @INC <tassilo.parseval@post.rwth-aachen.de>
    Re: can't locate Mail/MboxParser.pm in @INC <dbryson@gmx.de>
    Re: can't locate Mail/MboxParser.pm in @INC <tony_curtis32@yahoo.com>
    Re: can't locate Mail/MboxParser.pm in @INC <dbryson@gmx.de>
    Re: can't locate Mail/MboxParser.pm in @INC <tassilo.parseval@post.rwth-aachen.de>
    Re: can't locate Mail/MboxParser.pm in @INC <jeff@vpservices.com>
    Re: can't locate Mail/MboxParser.pm in @INC <dbryson@gmx.de>
    Re: can't locate Mail/MboxParser.pm in @INC <dbryson@gmx.de>
    Re: can't locate Mail/MboxParser.pm in @INC <tassilo.parseval@post.rwth-aachen.de>
    Re: can't locate Mail/MboxParser.pm in @INC <dbryson@gmx.de>
    Re: can't locate Mail/MboxParser.pm in @INC <dbryson@gmx.de>
    Re: can't locate Mail/MboxParser.pm in @INC <tassilo.parseval@post.rwth-aachen.de>
    Re: Can't use an undefined value as an ARRAY reference <abigail@abigail.nl>
    Re: Can't use an undefined value as an ARRAY reference <nospam@nospam-anon.com.nospam.invalid>
    Re: Can't use an undefined value as an ARRAY reference <abigail@abigail.nl>
    Re: Can't use an undefined value as an ARRAY reference (Greg Bacon)
    Re: Can't use an undefined value as an ARRAY reference <nospam@nospam-anon.com.nospam.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 7 Feb 2003 13:53:58 -0800
From: rev_maynard3@hotmail.com (Maynard)
Subject: Best way to fork multiple servers
Message-Id: <a4847dc.0302071353.286c3471@posting.google.com>

Hello All,

I've been using Perl for a little while, but this is my first attempt
at forking child processes.  I've written a Win32 service, which works
fine, but I'm having trouble with forking within it.  I would like to
spawn four TCP servers (which I also have under control, so that code
is omitted), on different ports.  My code, listed below, works, but
seems repetitive.

Perhaps someone more experienced can either show me a better way, or
help me condense my code into something more reasonable.


#################### BEGIN ####################

#! c:\perl\bin\perl.exe

my ($s1_pid, $s2_pid, $s3_pid, $s4_pid) = 0;

print "parent pid: $$\n\n";

fork_kids();
launch_kids();


sub fork_kids {
	if (! defined($s1_pid = fork())) { die "error forking s1\n\n"; }
	if (! defined($s2_pid = fork())) { die "error forking s2\n\n"; }
	if (! defined($s3_pid = fork())) { die "error forking s3\n\n"; }
	if (! defined($s4_pid = fork())) { die "error forking s4\n\n"; }
}


sub launch_kids {
	if ($s1_pid && (! $s2_pid) && (! $s3_pid) && (! $s4_pid)) {
		# RUN SERVER #1 HERE
		print "  server one: $s1_pid\n";
	}

	if ($s2_pid && (! $s1_pid) && (! $s3_pid) && (! $s4_pid)) {
		# RUN SERVER #2 HERE
		print "  server two: $s2_pid\n";
	}
	
	if ($s3_pid && (! $s1_pid) && (! $s2_pid) && (! $s4_pid)) {
		# RUN SERVER #3 HERE
		print "server three: $s3_pid\n";
	}
	
	if ($s4_pid && (! $s1_pid) && (! $s2_pid) && (! $s3_pid)) {
		# RUN SERVER #4 HERE
		print " server four: $s4_pid\n";
	}
}

#################### END ####################

I'm running all this from ActiveState Perl v.5.8, on Win32.

Thank you.


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

Date: Fri, 07 Feb 2003 23:31:32 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Best way to fork multiple servers
Message-Id: <3E448824.40C95959@earthlink.net>

Maynard wrote:
[snip]
> sub fork_kids {
>      if (! defined($s1_pid = fork())) { die "error forking s1\n\n"; }
>      if (! defined($s2_pid = fork())) { die "error forking s2\n\n"; }
>      if (! defined($s3_pid = fork())) { die "error forking s3\n\n"; }
>      if (! defined($s4_pid = fork())) { die "error forking s4\n\n"; }
> }

This doesn't make 4 new processes.  It makes 15 new processes.  The
first proc forks, producing a parent and a child.  The both parent and
child then fork, producing the parent, it's old child, it's new child,
and one grandchild.  Then all 4 of these fork, producing the parent,
it's two old children and one new child, one old grandchild and one new
grandchild, and one great-grandchild.  Then all 8 of these fork,
producing the parent, it's three old children, it's one new child, it's
two old grandchildren and three new grandchildren, it's one old
great-grandchild and two new great-grandchildren, for a total of 16,
including the parent.

What I would suggest is:

sub fork_kids {
   my @kids;
   # lexical filehandles get closed on scope-exit.
   pipe( my( $rd, $wr ) ) or die "Couldn't make pipe: $!";
   for my $i ( 1 .. 4 ) {
      defined( my $kid = fork() ) or last;
      push(@kids, $i), next if $kid;
      close $wr;
      # This  waits  until  the  parent closes  $wr, and
      # ensures that this  process hasn't  returned from
      # fork_kids  before it has a chance of making sure
      # that it was able to successfully fork 4 children.
      sysread( $rd, my $discard, 1 );
      return $i;
   }
   if( @kids != 4 ) {
      { local $!; kill "KILL" => @kids }
      die "Couldn't fork 4 childen: $!";
   }
   # When the  parent returns,  $rd and $wr are closed.
   # At this  point, the sysread()s in the children all
   # stop blocking, and  return 0, thus indicating EOF.
   return 0;
}

if( my $i = fork_kids() ) {
   print "This is child number $i, process id $$\n";
} else {
   print "This is the parent process, process id $$\n";
}
exit;

[tested on Windows 95, with ActiveState perl 5.6.1, build 631]

Obviously, if you want the parent to know the pids of all 4 children,
you'll have to return \@kids, instead of returning 0.

-- 
"So, who beat the clueless idiot today?"
"Well, we flipped for it, but when Kuno
 landed, he wasn't in any shape to fight."
"Next time, try flipping a *coin.*"


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

Date: Mon, 10 Feb 2003 02:30:22 -0500
From: pcg2001@sympatico.ca
Subject: Can perl receive input from the CRON line ?
Message-Id: <e6le4vklj2ib4frobmg1jg3o2fk2pj1tee@4ax.com>

I'm trying to pass a number like this but I can't see it in my perl
script or I just don't know how. 

10 10 10 * * /home/web/lookup.cgi "86034"

The idea would be to launch the perl script and have the 86034
available in a variable. Any help is appreciated

TIA




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

Date: Mon, 10 Feb 2003 09:26:05 +0100
From: Ingo Wichmann <w_ichmann@uni-wuppertal.de>
Subject: Re: Can perl receive input from the CRON line ?
Message-Id: <b27nv8$442$04$1@news.t-online.com>

pcg2001@sympatico.ca schrieb:
> I'm trying to pass a number like this but I can't see it in my perl
> script or I just don't know how. 
> 
> 10 10 10 * * /home/web/lookup.cgi "86034"
> 
> The idea would be to launch the perl script and have the 86034
> available in a variable. Any help is appreciated

How did you try it? Did you try with @ARGV?

Ingo

-- 
Meine Mail-Adresse enthält keinen Unterstrich



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

Date: Sun, 9 Feb 2003 22:35:55 +0100
From: "David Bryson" <dbryson@gmx.de>
Subject: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b26hk3$5rk$04$1@news.t-online.com>

Hi-ya folks.
The above is an error msg that I get when trying to run a cgi that uses this
module.
I got it after upgrading to SuSE 8.1 from 7.3
All the other CGIs work fine, so it would seem to be something that's
specific to this module.
Hope someone can help.
TIA
David




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

Date: Sun, 09 Feb 2003 15:39:24 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <87d6m1dtgz.fsf@limey.hpcc.uh.edu>

>> On Sun, 9 Feb 2003 22:35:55 +0100,
>> "David Bryson" <dbryson@gmx.de> said:

> Hi-ya folks.  The above is an error msg that I get when
> trying to run a cgi that uses this module.  I got it
                ^^^^^
[It's a perl program, not "a cgi".]

> after upgrading to SuSE 8.1 from 7.3 All the other CGIs
> work fine, so it would seem to be something that's
> specific to this module.  Hope someone can help.

Doesn't the error message tell the whole story?

Install Mail::MboxParser from CPAN.

hth
t


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

Date: 9 Feb 2003 21:49:41 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b26idl$cjf$1@nets3.rz.RWTH-Aachen.DE>

Also sprach David Bryson:

> The above is an error msg that I get when trying to run a cgi that uses this
> module.
> I got it after upgrading to SuSE 8.1 from 7.3
> All the other CGIs work fine, so it would seem to be something that's
> specific to this module.

It's specific to any module that is not properly installed. :-)

I don't know how upgrading the SuSE distribution works. Did you upgrade
from scratch (that is, reinstall) the whole thing? In case upgrade
happens more smoothly it's possible that in the event of this upgrade
your perl was upgraded as well and thus the @INC is now different.

Simply reinstall from CPAN and it should work again. The module isn't
overly complex so it should all work seamlessly.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Sun, 9 Feb 2003 22:50:15 +0100
From: "David Bryson" <dbryson@gmx.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b26if0$7mm$05$1@news.t-online.com>

Hey Tony, thanks for ur answer. Saying cgi was just a manner of speaking.
I don't know how to install the module from CPAN.
What I did was dl from CPAN and tar, makefile, make, make install all the
pieces.
this was some time ago.
After the upgrade, when I got the error msg, i tried to re-install the same
way, but it didn't work this time, even though I tried several times.
How would I install from CPAN and do I remove the previous stuff first?
TIA and Cheers,
David

"Tony Curtis" <tony_curtis32@yahoo.com> wrote in message
news:87d6m1dtgz.fsf@limey.hpcc.uh.edu...
> >> On Sun, 9 Feb 2003 22:35:55 +0100,
> >> "David Bryson" <dbryson@gmx.de> said:
>
> > Hi-ya folks.  The above is an error msg that I get when
> > trying to run a cgi that uses this module.  I got it
>                 ^^^^^
> [It's a perl program, not "a cgi".]
>
> > after upgrading to SuSE 8.1 from 7.3 All the other CGIs
> > work fine, so it would seem to be something that's
> > specific to this module.  Hope someone can help.
>
> Doesn't the error message tell the whole story?
>
> Install Mail::MboxParser from CPAN.
>
> hth
> t




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

Date: Sun, 09 Feb 2003 15:54:27 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <877kc9dsrw.fsf@limey.hpcc.uh.edu>


[ top-posting rearranged, follow up text comes after the
  original ]

>> On Sun, 9 Feb 2003 22:50:15 +0100,
>> "David Bryson" <dbryson@gmx.de> said:
>> 
>> Install Mail::MboxParser from CPAN.

> Hey Tony, thanks for ur answer. Saying cgi was just a
> manner of speaking.  I don't know how to install the
> module from CPAN.

As a user with sufficient permissions (probably, but not
necessarily, root):

    perl -MCPAN -e 'install Mail::MboxParser'

hth
t


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

Date: Sun, 9 Feb 2003 23:27:14 +0100
From: "David Bryson" <dbryson@gmx.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b26kkd$h1c$06$1@news.t-online.com>

Hi Tassilo, thanks for responding.

I tried to install from CPAN but got the same error that I got previously
when trying to install manually.
These are:
warning: prerequisite IO::Stringy 1.211 not found.
warning: prerequisite Mail::Field 1.05 not found.
warning: prerequisite Mail::Header 1.01 not found.
warning: prerequisite IO::Internet 1.0203 not found.

and later I saw:

Can't locate IO/Scalar.pm in @INC
and   can't locate IO/Wrap.pm in @INC
DIED Failed tests 1-6
Any ideas?
TIA
David



Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote in message
news:b26idl$cjf$1@nets3.rz.RWTH-Aachen.DE...
> Also sprach David Bryson:
>
> > The above is an error msg that I get when trying to run a cgi that uses
this
> > module.
> > I got it after upgrading to SuSE 8.1 from 7.3
> > All the other CGIs work fine, so it would seem to be something that's
> > specific to this module.
>
> It's specific to any module that is not properly installed. :-)
>
> I don't know how upgrading the SuSE distribution works. Did you upgrade
> from scratch (that is, reinstall) the whole thing? In case upgrade
> happens more smoothly it's possible that in the event of this upgrade
> your perl was upgraded as well and thus the @INC is now different.
>
> Simply reinstall from CPAN and it should work again. The module isn't
> overly complex so it should all work seamlessly.
>
> Tassilo
> --
>
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
>
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
>
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval




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

Date: 9 Feb 2003 22:34:36 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b26l1s$fb6$1@nets3.rz.RWTH-Aachen.DE>

Also sprach David Bryson:

> I tried to install from CPAN but got the same error that I got previously
> when trying to install manually.
> These are:
> warning: prerequisite IO::Stringy 1.211 not found.
> warning: prerequisite Mail::Field 1.05 not found.
> warning: prerequisite Mail::Header 1.01 not found.
> warning: prerequisite IO::Internet 1.0203 not found.

Those are prerequesites of the MIME::Tools. You have to install them as
well (I have never heard of IO::Internet though). Go to CPAN once more
and get the distributions that contain these modules (I think IO::Scalar
and MailTools are those).

> and later I saw:
> 
> Can't locate IO/Scalar.pm in @INC
> and   can't locate IO/Wrap.pm in @INC

This will go away once you installed the above, too.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Sun, 09 Feb 2003 14:32:40 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <3E46D708.70409@vpservices.com>

[please don't top post: put your reply *under* what you are replying to]

David Bryson wrote:

> Hi Tassilo, thanks for responding.
> 
> I tried to install from CPAN but got the same error that I got previously
> when trying to install manually.
> These are:
> warning: prerequisite IO::Stringy 1.211 not found.
> warning: prerequisite Mail::Field 1.05 not found.
> warning: prerequisite Mail::Header 1.01 not found.
> warning: prerequisite IO::Internet 1.0203 not found.


In other words, all of those modules are prerequistes for the one you 
are trying to install and therefore you need to install those first, 
then install the one you want.  If you use the CPAN.pm module with the 
"follow" option set, it would install these others as soon as it found 
that the module you tried first needed them.

-- 
Jeff




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

Date: Sun, 9 Feb 2003 23:34:08 +0100
From: "David Bryson" <dbryson@gmx.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b26l1b$9cj$04$1@news.t-online.com>

Hi Tony,

"David Bryson" <dbryson@gmx.de> wrote in message
news:b26kkd$h1c$06$1@news.t-online.com...
> Hi Tassilo, thanks for responding.
>
> I tried to install from CPAN but got the same error that I got previously
> when trying to install manually.
> These are:
> warning: prerequisite IO::Stringy 1.211 not found.
> warning: prerequisite Mail::Field 1.05 not found.
> warning: prerequisite Mail::Header 1.01 not found.
> warning: prerequisite IO::Internet 1.0203 not found.
>
> and later I saw:
>
> Can't locate IO/Scalar.pm in @INC
> and   can't locate IO/Wrap.pm in @INC
> DIED Failed tests 1-6
> Any ideas?
> TIA
> David
>
>
>
> Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote in
message
> news:b26idl$cjf$1@nets3.rz.RWTH-Aachen.DE...
> > Also sprach David Bryson:
> >
> > > The above is an error msg that I get when trying to run a cgi that
uses
> this
> > > module.
> > > I got it after upgrading to SuSE 8.1 from 7.3
> > > All the other CGIs work fine, so it would seem to be something that's
> > > specific to this module.
> >
> > It's specific to any module that is not properly installed. :-)
> >
> > I don't know how upgrading the SuSE distribution works. Did you upgrade
> > from scratch (that is, reinstall) the whole thing? In case upgrade
> > happens more smoothly it's possible that in the event of this upgrade
> > your perl was upgraded as well and thus the @INC is now different.
> >
> > Simply reinstall from CPAN and it should work again. The module isn't
> > overly complex so it should all work seamlessly.
> >
> > Tassilo


Thanks for ur post. I tried and got the  errors mentioned.
I think possibly the upgrade re-located something in a different place.
I only upgraded because of a weird message (and occasional server hang-ups),
which
are to do with hardware, nothing to do with perl or Apache.
Anyway I still get these even after the upgrade, so I can always go back to
the previous
situation.
To answer Tassilo's quaestion: it was an upgrade that left my scripts
intact.
Cheers,
David




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

Date: Mon, 10 Feb 2003 00:32:14 +0100
From: "David Bryson" <dbryson@gmx.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b26oef$26o$02$1@news.t-online.com>

Hi all,

"Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote in
message news:b26l1s$fb6$1@nets3.rz.RWTH-Aachen.DE...
> Also sprach David Bryson:
>
I tried a couple more times, but at a certain point, things go wrong:
All is well but:
At MIME-tools-5.411 the make is --OK
But the make test produced erors:
Can't locate IO/Scalar.pm in @INC
Can't locate IO/Wrap.pm in @INC
Any more ideas?
David




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

Date: 9 Feb 2003 23:46:49 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b26p99$ihs$1@nets3.rz.RWTH-Aachen.DE>

Also sprach David Bryson:

> "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote in
> message news:b26l1s$fb6$1@nets3.rz.RWTH-Aachen.DE...
>> Also sprach David Bryson:
>>
> I tried a couple more times, but at a certain point, things go wrong:
> All is well but:
> At MIME-tools-5.411 the make is --OK
> But the make test produced erors:
> Can't locate IO/Scalar.pm in @INC
> Can't locate IO/Wrap.pm in @INC
> Any more ideas?

Have you installed IO::Scalar already? When installing a bunch of Perl
modules, you have to install them in the right order. First the module
on which the second module depends on and so on. MIME::Tools depend on
IO::Scalar and the MailTools, so install those two before installing
MIME::Tools. After that, you should be able to install Mail::MboxParser
as well.

Perhaps it would be best to do all that through the CPAN shell.

    perl -MCPAN -eshell

On first invokation it'll ask you a couple of questions. After that, all
is set up to easily install modules including their prerequesites using

    cpan> install Mail::MboxParser
    etc...

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Mon, 10 Feb 2003 07:57:19 +0100
From: "David Bryson" <dbryson@gmx.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b27ij2$j6a$03$1@news.t-online.com>


"Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote in
message news:b26p99$ihs$1@nets3.rz.RWTH-Aachen.DE...
> Also sprach David Bryson:
>
> > "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote in
> > message news:b26l1s$fb6$1@nets3.rz.RWTH-Aachen.DE...
> >> Also sprach David Bryson:
> >>
> > I tried a couple more times, but at a certain point, things go wrong:
> > All is well but:
> > At MIME-tools-5.411 the make is --OK
> > But the make test produced erors:
> > Can't locate IO/Scalar.pm in @INC
> > Can't locate IO/Wrap.pm in @INC
> > Any more ideas?
>
> Have you installed IO::Scalar already? When installing a bunch of Perl
> modules, you have to install them in the right order. First the module
> on which the second module depends on and so on. MIME::Tools depend on
> IO::Scalar and the MailTools, so install those two before installing
> MIME::Tools. After that, you should be able to install Mail::MboxParser
> as well.
>
> Perhaps it would be best to do all that through the CPAN shell.
>
>     perl -MCPAN -eshell
>
> On first invokation it'll ask you a couple of questions. After that, all
> is set up to easily install modules including their prerequesites using
>
>     cpan> install Mail::MboxParser
>     etc...
>
> Tassilo
> --
>
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
>
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
> $

Thanks Tassilo, but I've done all that.
But tonight I'll make a fresh start.
I even tried copying the whole directory out of a previous error-free
installation, but I got the same
error when the perl script tried to run.
So it obviously has to do with the way SuSE installs Perl on the 8.1 version
of their distro.
I found a posting on the net where there was a similar problem, and the
advice was to uninstall mod_perl and reinstall it as a DSO. Dunno what that
means (yet).
Hey, it's all a learning experience.
David.
_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval




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

Date: Mon, 10 Feb 2003 08:03:23 +0100
From: "David Bryson" <dbryson@gmx.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b27iug$v19$07$1@news.t-online.com>


"Jeff Zucker" <jeff@vpservices.com> wrote in message
news:3E46D708.70409@vpservices.com...
> [please don't top post: put your reply *under* what you are replying to]
>
> David Bryson wrote:
>
> > Hi Tassilo, thanks for responding.
> >
> > I tried to install from CPAN but got the same error that I got
previously
> > when trying to install manually.
> > These are:
> > warning: prerequisite IO::Stringy 1.211 not found.
> > warning: prerequisite Mail::Field 1.05 not found.
> > warning: prerequisite Mail::Header 1.01 not found.
> > warning: prerequisite IO::Internet 1.0203 not found.
>
>
> In other words, all of those modules are prerequistes for the one you
> are trying to install and therefore you need to install those first,
> then install the one you want.  If you use the CPAN.pm module with the
> "follow" option set, it would install these others as soon as it found
> that the module you tried first needed them.
>
> --
> Jeff
>
>
Thanks for the response, Jeff.  How would I use the follow option with:
perl -MCPAN -e 'install Mail::MboxParser'
Cheers David




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

Date: 10 Feb 2003 07:48:37 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: can't locate Mail/MboxParser.pm in @INC
Message-Id: <b27lgl$7hg$1@nets3.rz.RWTH-Aachen.DE>

Also sprach David Bryson:

> "Jeff Zucker" <jeff@vpservices.com> wrote in message
> news:3E46D708.70409@vpservices.com...

>> In other words, all of those modules are prerequistes for the one you
>> are trying to install and therefore you need to install those first,
>> then install the one you want.  If you use the CPAN.pm module with the
>> "follow" option set, it would install these others as soon as it found
>> that the module you tried first needed them.

> Thanks for the response, Jeff.  How would I use the follow option with:
> perl -MCPAN -e 'install Mail::MboxParser'

You can find out how your CPAN.pm is configured by issuing:

    cpan> o conf

after entering the shell with 'perl -MCPAN -eshell'.

Scroll up a bit and look for "prerequisites_policy". If it is set to
"awk" or "follow" all you need to do is 'install Mail::MboxParser'.

If it is set to "never", you have to change it manually:

    cpan> o conf prerequisites_policy follow

and then install.

Have you already read 'perldoc CPAN'? This module is too important to
not know about it.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: 09 Feb 2003 00:51:37 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Can't use an undefined value as an ARRAY reference
Message-Id: <slrnb4b9gp.sb.abigail@alexandra.abigail.nl>

JD (nospam@nospam-anon.com.nospam.invalid) wrote on MMMCDXLVI September
MCMXCIII in <URL:news:q3n54vgncqetof33cejlhicn7l74qb8p5m@4ax.com>:
**  Lo all,
**  
**  OS slackware 8.1 and 8.0
**  I'm running (attempting to) the nntpget script that comes with the
**  news::scan module. getnews has the same error.
**  
**  Here's the problem: It doesn't work. Well, strangely enough it works
**  for one newsgroup (uk.food+drink.sausages) but not for
**  others, alt.os.linux.slackware or misc.test for example. The sausage
**  group is newly formed so that may be an issue.
**  
**  The error:
**  
**  Getting articles from news.nildram.co.uk...Can't use an undefined
**  value as an ARRAY reference at /usr/lib/perl5/site_perl/News/Scan.pm
**  line 554.
**  
**  the uk.food+drink.sausage downloads all the articles into a directory,
**  no problem.
**  
**  misc.test creates a few empty numbered files in the same directory
**  (all prev files deleted first) then give the above error.
**  I have tried this with 2 ISP's (nildram and demon) and 2 news servers,
**  news.nildram.co.uk and news.demon.co.uk
**  Same error. All the groups tested exist on both servers...

Ah, yes, that's a long standing, and well known bug in Perl. As soon
as your application tries to do something with a newsgroup that isn't
about sausages, little green men, blue eyed brunettes or the KGB,
a bug on line 554 appears out of the blue sky.

**  Any clue much appreciated.

I strongly suggest to focus on sausages, and not on Linux. After all,
all software sucks.


Abigail
-- 
Ghee man, get a clue. Show us a *small* code sample that exhibits
the unwanted behaviour. Don't assume us to be omniscient - only
the Usenet oracle is.


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

Date: Sun, 09 Feb 2003 02:15:27 +0000
From: JD <nospam@nospam-anon.com.nospam.invalid>
Subject: Re: Can't use an undefined value as an ARRAY reference
Message-Id: <k8eb4v4ih34g9t5vf08ugu696oqbphrll6@4ax.com>

On 09 Feb 2003 00:51:37 GMT, Also Sprach Abigail <abigail@abigail.nl>
:

>JD (nospam@nospam-anon.com.nospam.invalid) wrote on MMMCDXLVI September
>MCMXCIII in <URL:news:q3n54vgncqetof33cejlhicn7l74qb8p5m@4ax.com>:
>**  Lo all,

>**  Getting articles from news.nildram.co.uk...Can't use an undefined
>**  value as an ARRAY reference at /usr/lib/perl5/site_perl/News/Scan.pm
>**  line 554.
>**  
>**  the uk.food+drink.sausage downloads all the articles into a directory,
>**  no problem.
>**  
>**  misc.test creates a few empty numbered files in the same directory
>**  (all prev files deleted first) then give the above error.
>**  I have tried this with 2 ISP's (nildram and demon) and 2 news servers,
>**  news.nildram.co.uk and news.demon.co.uk
>**  Same error. All the groups tested exist on both servers...
>
>Ah, yes, that's a long standing, and well known bug in Perl. As soon
>as your application tries to do something with a newsgroup that isn't
>about sausages, little green men, blue eyed brunettes or the KGB,
>a bug on line 554 appears out of the blue sky.
>
>**  Any clue much appreciated.
>
>I strongly suggest to focus on sausages, and not on Linux. After all,
>all software sucks.

:)

As per your sig...
Line 554 is noted.

sub collect {
    my $self = shift;

    my $group;
    my $spool;

    $group = $self->name;
    unless (defined $group) {
        return $self->error("$self has no idea what group it is");
    }

    $spool = $self->spool;
    unless (defined $spool) {
        return $self->error("$self does not know where its spool is");
    }

    unless (-d $spool and -w _) {
        return $self->error("`$spool' not a directory or writable");
    }

    unless ($self->nntp_connect) {
        return $self->error("Failed to create Net::NNTP object: "
                            . $self->error);
    }
    
    my $client = $self->nntp_client;

    unless ($client->group($group)) {
        return $self->error("Invalid group name: `$group'");
    }

    local $_;

    my %seen;
    if (open SEEN, "$spool/.seen") {
        while (<SEEN>) {
            chomp;

            $seen{$_} = 1;
        }

        close SEEN;
    }

    for (grep { !-f "$spool/$_" && !$seen{$_} } @{$client->listgroup})
{
        unless (open ART, ">$spool/$_") {
            return $self->error("Failed to save article");
        }

line 554:        print ART @{ $client->article($_) };
        close ART;
    }

    $self->error(0);

    1;
}

--
John

arjf @ sghzfu qbg qrzba qbg pb.hx


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

Date: 09 Feb 2003 02:55:21 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Can't use an undefined value as an ARRAY reference
Message-Id: <slrnb4bgop.sb.abigail@alexandra.abigail.nl>

JD (nospam@nospam-anon.com.nospam.invalid) wrote on MMMCDXLIX September
MCMXCIII in <URL:news:k8eb4v4ih34g9t5vf08ugu696oqbphrll6@4ax.com>:
{}  
{}  line 554:        print ART @{ $client->article($_) };

Clearly, the method 'article' returns an undefined value, while this
line assumes it's returning a array reference.


Abigail
-- 
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";


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

Date: Sun, 09 Feb 2003 12:03:29 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: Can't use an undefined value as an ARRAY reference
Message-Id: <v4cgsh764h4t3e@corp.supernews.com>

In article <q3n54vgncqetof33cejlhicn7l74qb8p5m@4ax.com>,
    JD  <jd@anon.com.nospam.invalid> wrote:

: OS slackware 8.1 and 8.0
: I'm running (attempting to) the nntpget script that comes with the
: news::scan module. getnews has the same error.
:
: [...]

It's a bug in my code that's fixed in the next release.  Here's a
patch:

% diff -ru News-Scan-0.52/ ../src/perl/News-Scan/
diff -ru News-Scan-0.52/News/Scan.pm ../src/perl/News-Scan/News/Scan.pm
--- News-Scan-0.52/News/Scan.pm Fri Nov 15 05:14:51 2002
+++ ../src/perl/News-Scan/News/Scan.pm  Tue Dec 31 07:53:18 2002
@@ -546,12 +546,21 @@
         close SEEN;
     }

-    for (grep { !-f "$spool/$_" && !$seen{$_} } @{$client->listgroup}) {
+    for (grep { !-f "$spool/$_" && !$seen{$_} } @{ $client->listgroup }) {
+        my $art = $client->article($_);
+        unless ($art) {
+            my $msg = $client->message;
+
+            warn "$0: $group:$_: $msg\n";
+
+            next;
+        }
+
         unless (open ART, ">$spool/$_") {
             return $self->error("Failed to save article");
         }

-        print ART @{ $client->article($_) };
+        print ART @$art;
         close ART;
     }

End of patch.

Sorry for the slow response. :-(

Greg
-- 
All the marvelous achievements of Western civilization are fruits grown
on the tree of liberty.
    -- Ludwig von Mises, *The Theory of Money and Credit*


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

Date: Sun, 09 Feb 2003 23:17:12 +0000
From: JD <nospam@nospam-anon.com.nospam.invalid>
Subject: Re: Can't use an undefined value as an ARRAY reference
Message-Id: <j9od4vo9apooon6e941siu4jn2e0iga49o@4ax.com>

On Sun, 09 Feb 2003 12:03:29 -0000, Also Sprach gbacon@hiwaay.net
(Greg Bacon) :


>It's a bug in my code that's fixed in the next release.  Here's a
>patch:

<snip>

>Sorry for the slow response. :-(

Give over!

Thank you very much for your time!
--
John

arjf @ sghzfu qbg qrzba qbg pb.hx


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

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.  

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 V10 Issue 4531
***************************************


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