[7601] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1227 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 24 23:07:16 1997

Date: Fri, 24 Oct 97 20:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 24 Oct 1997     Volume: 8 Number: 1227

Today's topics:
     Re: 2 element associate array <firstcat@whitehouse.gov>
     Adding html to URLs harry_murphy@sfbayguardian.com
     cgi module in perl on apache server <lach@lach.net>
     Re: CGI module in PERL (Toutatis)
     Re: CGI module in PERL <rootbeer@teleport.com>
     Re: CGI module in PERL <lach@lach.net>
     Re: eval 'use Socket' vs. 'use socket' <rootbeer@teleport.com>
     Re: eval 'use Socket' vs. 'use socket' (Charles DeRykus)
     Fastest way to call a method or subroutine? (Toutatis)
     Re: Is there/will there be a decent way to do constants <zenin@best.com>
     other language for perl <soccer@all-soccer.com>
     Re: Perl and Windows95 question (J. Bacon)
     Re: Q: stat() on Win32 (J. Bacon)
     Re: Reading line from file and assiging to variables <rootbeer@teleport.com>
     Re: rmtree bug in File::Path in NT ??? (J. Bacon)
     Shared Memory (PRamanujam)
     Re: SQL and Perl (Abigail)
     Re: SQL to update a row from a Perl script (Abigail)
     Storable error <brian@criticalpath.net>
     Re: Storable error <brian@criticalpath.net>
     Re: Unexplainable error: Useless use of private variabl (Abigail)
     Using Shared Memory to communicate between 2 processes PRamanujam@aol.com
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 24 Oct 1997 20:00:18 -0400
From: "Sox Clinton" <firstcat@whitehouse.gov>
Subject: Re: 2 element associate array
Message-Id: <62re91$cor@world6.bellatlantic.net>

Mark Aurit wrote
>I cant figure out how to work a 2-element associate array table. With a
>...
>with <array>(1,2). But Im having no luck, I can work a single element hash,
>...
>The book Im using (Teach Yourself perl 5... I know, its not the Camel book,
>but isnt bad) doesnt mention how to do this.

It IS bad ... The Camel book has a whole chapter on multidimensional
arrays... :)

The upshot is: Perl soesn't HAVE multidimentional array, as such.

But you can have an array of arrays.

Buy the book


- Dave Kaufman <davidk@cnct.com>
------------------------------------------------
Run, rabbit, run.
Dig that hole.  Forget the sun.
When at last the work is done,
Don't sit down, it's time to dig another one.
- Pink Floyd
------------------------------------------------




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

Date: Fri, 24 Oct 1997 18:21:04 -0600
From: harry_murphy@sfbayguardian.com
Subject: Adding html to URLs
Message-Id: <877734649.31401@dejanews.com>

 I have a list of 1,000 URLs in MSWord that I want to
put on a Web page. I need to put the HTML coding in
each URL so that when I click on a URL, it will bring up
a Web page.
 It would probably take me 20 hours to type in the
html coding for each URL. However, I understand that
if I use BBedit and regular expressions, I can have all
of this done automatically.
  I have tried to use the following regular expression
but can't seem to get it to work to add the html coding
for each URL. Can anyone advise me on how to do this
and what is wrong with my coding:
Search: (^.*//([^/]+)/.*)
Replace: <ahref="/1">/2</a>

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 24 Oct 1997 21:07:49 -0500
From: Lachlan Dunlop <lach@lach.net>
Subject: cgi module in perl on apache server
Message-Id: <34515475.7947D454@lach.net>

Here is the error log:


Undefined subroutine &main::header called at
/home/httpd/cgi-bin/upsship.pl line 7.

access to /home/httpd/cgi-bin/upsship.pl failed for abc.xyz.com, reason
Premeture end of script headers

Thanks

Lach



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

Date: 25 Oct 1997 00:38:08 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: CGI module in PERL
Message-Id: <toutatis-ya023180002510970238040001@news.euro.net>

Lachlan Dunlop <lach@lach.net> wrote:

> The Apache server returns:
> 
> Server Error
> 
> The server encountered an internal error or misconfiguration and was
> unable to complete your
> request.
> 
> Please contact the server administrator, rleel@spcbrass.com and inform
> them of the time the error
> occurred, and anything you might have done that may have caused the
> error.
> 
> The Script:

Forget about the script for now. Stop driving that van blindfolded. First,
you must find a way to see the *actual* errormessage that your script
generates. What your browser displays is just a cosmetic message for Larry
Ellison's aunt. 
If you can't get access to the real http errorlog, use the CGI::Carp
carpout function to redirect it to your browser, while debugging your
program.

-- 
Toutatis
no mail replies please


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

Date: Fri, 24 Oct 1997 18:06:50 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Lachlan Dunlop <lach@lach.net>
Subject: Re: CGI module in PERL
Message-Id: <Pine.GSO.3.96.971024180444.18434A-100000@usertest.teleport.com>

On Fri, 24 Oct 1997, Lachlan Dunlop wrote:

> is the "use CGI qw(:standard);"  valid under linux.

It has nothing to do with whether you're running Linux or not. It should
work even under Windows. :-)

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. Hope
this helps!

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 24 Oct 1997 22:26:16 -0500
From: Lachlan Dunlop <lach@lach.net>
Subject: Re: CGI module in PERL
Message-Id: <345166D8.3B9CFB84@lach.net>

I had the wrong version og CGI.pm  DAH



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

Date: Fri, 24 Oct 1997 18:17:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: vikas@navya.com
Subject: Re: eval 'use Socket' vs. 'use socket'
Message-Id: <Pine.GSO.3.96.971024180749.18434B-100000@usertest.teleport.com>

On 24 Oct 1997, Vikas Aggarwal wrote:

> 	eval 'use Socket';
> and
> 	use Socket;
> 
> seem to be behaving differently in my script.

Well, they are different, they look different, and they're defined to be
different. That's probably the reason. :-)

> In the sample scripts below, if I replace the 'use Socket' to an eval,
> then it does not seem to define the parameters correctly.

That's akin to saying that there is more than one way to tie your
shoelaces, and that one of those ways makes it hard to walk. :-)

> Isnt the 'eval' supposed to scan in the Socket module in the current
> context ?

No, eval runs some code at runtime. For 'use' to work its magic, it needs
to be done at compile time. If you wish to trap the error in case
Socket.pm is missing, try something like this. 

    BEGIN {
	eval {				# emulate use
	    require 'Socket.pm';
	    Socket->import;
	};
	if ($@) {
	    print "Can't load Socket.pm: $@\n";
	    exit;	# Or your own error-handling code
	}
    }

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!




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

Date: Fri, 24 Oct 1997 23:31:29 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: eval 'use Socket' vs. 'use socket'
Message-Id: <EIKxCJ.FLE@bcstec.ca.boeing.com>

In article <62r3po$ou$1@newsreader.jvnc.net>,
Vikas Aggarwal <vikas@navya.com> wrote:
 > Folks, sorry to revisit this 'socket: protocol not supported' issue again,
 > but:
 > 
 > 	eval 'use Socket';
 > and
 > 	use Socket;
 > 
 > seem to be behaving differently in my script.
 > 
 > In the sample scripts below, if I replace the 'use Socket' to an eval,
 > then it does not seem to define the parameters correctly.
 > 
 > 	#!/usr/local/bin/perl5 -w
 > 	use Socket;
 > 	$proto = getprotobyname('tcp');
 > 	socket(S, PF_INET, SOCK_STREAM, $proto) || die "socket: $!" ;
 > 	print "END\n";
 > 
 > gives me:
 > 	Identifier "main::S" used only once:
 > 
 > However, if I change the 'use Socket' to:
 > 
 > 	#!/usr/local/bin/perl5 -w
 > 	eval 'use Socket';
 > 	..etc..
 > 
 > I get a:
 > 	Argument "SOCK_STREAM" isn't numeric in socket at ./a.pl line 8.
 > 	Argument "PF_INET" isn't numeric in socket at ./a.pl line 8.
 > 	socket: Protocol not supported at ./a.pl line 8.
 > 
 > Isnt the 'eval' supposed to scan in the Socket module in the current
 > context ?
 > 
 > 

Your eval happens at runtime - too late to correctly evaluate 
constants PF_INET and SOCK_STREAM.   

So you need to fully qualify the subroutine call:

eval "use Socket";
 ..etc..
socket(S, &Socket::PF_INET, &Socket::SOCK_STREAM, $proto) || 
   die "socket: $!" ;


or, just wrap the eval in a BEGIN block to force early
compilation:


BEGIN { eval 'use Socket'
           ...etc...
}
socket(S, PF_INET, SOCK_STREAM, $proto) || die "socket: $!" ;



HTH,
--
Charles DeRykus







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

Date: 25 Oct 1997 00:16:59 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Fastest way to call a method or subroutine?
Message-Id: <toutatis-ya023180002510970217010001@news.euro.net>

What is the fastest way (run time, not compile time) to call a method or
subroutine, in particular, if this call is made *from whithin* the same
package?

Package::method();
method();
Package->method();
$object->method();

I'm not only interested in what is the fastest, but also *why*.
-- 
Toutatis
no mail replies please


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

Date: 25 Oct 1997 01:40:47 GMT
From: Zenin <zenin@best.com>
Subject: Re: Is there/will there be a decent way to do constants in perl?
Message-Id: <62rimv$gbq$1@nntp2.ba.best.com>

Doug Seay <seay@absyss.fr> wrote:
> Zenin wrote:
> >         use constant FOO => 'foo';
> >         print "This is @{[ FOO ]}\n";
> >         print "And the current time is @{[ scalar localtime(time) ]}.  Cool hey?\n";
> >         print "If it was hard to write, dammit it should be hard to read!\n";
> Zenin,
> 	You are evil.  But I like it.

	Well, it does make much more sense in here-in statements then on
	liners:

	print <<"EndOfData";
		This is my report.
		It was created on @{[ scalar localtime (time) ]}
		blgh blgh blgh
	EndOfData

-- 
-Zenin (zenin@best.com)
 The Bawdy Caste (San Jose, CA)       http://www.netmagic.net/~dmcgrath/bawdy/
 Barely Legal   (Berzerkly, CA)                    http://www.barelylegal.org/
 Zenin's Rocky Archive (Moving soon!)              http://www.best.com/~zenin/


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

Date: Fri, 24 Oct 1997 22:39:26 -0400
From: Geoffrey Hebert <soccer@all-soccer.com>
Subject: other language for perl
Message-Id: <34515BDE.7EC1@all-soccer.com>

I wish to translate my site to another language.
Most of the site is html created from perl cgi.

Could someone tell me how the process might work?

If you are interested in working on this
email me.
soccer@all-soccer.com
-- 

Free site for your Soccer League

http://www.all-soccer.com

All about soccer - what else is there!


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

Date: 25 Oct 1997 02:31:17 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Re: Perl and Windows95 question
Message-Id: <62rlll$gj8@sjx-ixn4.ix.netcom.com>

In article <344e241c.7211859@news.mindspring.com>, dilcher@cueva.com says...
>
>I have a script that I wrote in Perl that I want to give to a friend
>who is running Windows 95.
>
>In my Windows version of Perl, I note a couple of files:
>
>perl.exe
>perl300.dll
>
>If my friend puts these two files in the same directory as the
>perl script, will it run ok?  
>
>I guess I am asking this so as to spare my friend from having to 
>do a full blown perl installation on his machine in order to run
>my one silly script.
>
>Thanks for your help,
>direct email responses greatly appreciated.
>
>-jeff

Probably not.  Most scripts refer to at least one module or another in the LIB 
directory, and those sometimes refer to yet another...

If you are in a server environment, install perl to the server, and then your 
friend can run the install program, which fixes up his registry without 
penalty to his hard drive space.


-- 
Jim Bacon                    .(o)   (o).  / +  +  +\
jwbacon@ix.netcom.com        .   ___   . / +  +  + /
303-581-9635 ext 329 (work)   ..|   |.. / +  +  + / 
303-581-0960 (FAX)(w)           |_|_|  /_________/    W5-62-93



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

Date: 25 Oct 1997 02:44:52 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Re: Q: stat() on Win32
Message-Id: <62rmf4$gj8@sjx-ixn4.ix.netcom.com>

In article <62n937$rmh@ascomax.hasler.ascom.ch>, periat@ens.ascom.ch says...
>
>Hi everybody
>
>Can someone explain me what i get from the funxtion 'stat()' on
>a 'Windows NT' and a 'Windows 95' system?
>
>
>Thanks
>Henri

According to the book "teach yourself Perl 5 for Windows NT in 21 days" (I'm 
on the stupid side, it took me almost a month...;)

it returns a list in the following order:
0: the device on which the file resides
1: the internal reference (inode) number for this file
2: permissions for the file
3: # of hard links to the file
4: numerical user ID of the file owner
5: numerical group ID of the file user
6: device type -- if this "file" is actually a device
7: size of file in bytes
8: when file was last accessed
9: when file was last modified
10: when file status was last changed.

Forget about 4 and 5 on a Windows 95 system, and I'm not sure what a couple of 
the other things mean with respect to a 95 system.  I heard O'Reilly was going 
to come out with a Perl reference for NT -- in the meantime, about all you can 
do is get one of the cheesy manuals like I mentioned above.

Hope that helps.
-- 
Jim Bacon                    .(o)   (o).  / +  +  +\
jwbacon@ix.netcom.com        .   ___   . / +  +  + /
303-581-9635 ext 329 (work)   ..|   |.. / +  +  + / 
303-581-0960 (FAX)(w)           |_|_|  /_________/    W5-62-93



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

Date: Fri, 24 Oct 1997 18:21:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kathy  <kathyl@cais.com>
Subject: Re: Reading line from file and assiging to variables
Message-Id: <Pine.GSO.3.96.971024181853.18434C-100000@usertest.teleport.com>

On 24 Oct 1997, Kathy  wrote:

> Newsgroups: comp.lang.perl.misc, comp.lang.perl.modules

What does this question have to do with modules? Maybe you included that
newsgroup by mistake.

> I'm currently trying to read in a file, one line at a time, and assign
> diffeent "fields" based on the field separator, then manipulate certain
> fields.  I've tried: 
> 
> 	@fields = split(/\s+\);

Maybe you mean this?

	@fields = split(/\s+/);

That line splits $_ on whitespace and assigns the resulting fields to
@fields. Is that what you wanted? (Probably.)

> 	print $field[0];

Maybe you mean this?

	print $fields[0];

Use the -w invocation option; it will help you to catch errors like this.
Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 25 Oct 1997 02:07:43 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Re: rmtree bug in File::Path in NT ???
Message-Id: <62rk9f$gj8@sjx-ixn4.ix.netcom.com>

In article <877238319.8613@dejanews.com>, maverner@hotmail.com says...
>
>I am using perl version 5.004_02 on Windows NT and trying
>to remove an entire directory.  I make the call
>
>rmtree("c:/mydir", 0 , 1) in my perl file.  Sometimes this works but
>sometimes I get an infinite loop with the following messages:
>
>Can't unlink file C:/mydir/temp.tst: Permission denied
>at c:\perltest\doit.perl line 63
>Can't unlink file C:/mydir/temp.tst: Permission denied
>at c:\perltest\doit.perl line 63
>Can't unlink file C:/mydir/temp.tst: Permission denied
>at c:\perltest\doit.perl line 63
> .
> .
> .
>
>Does anyone have any clues about what is going on and how to
>fix this?
>Thanks
>
>Matt

I am clueless as to WHAT is going on, but had a similar problem.  I got 
around the problem with this really elegant approach:

1) use a system command "dir <path> /b /s > myfile.txt
2) open "myfile.txt" and suck the contents into a list,
3) sort the list (this gets the subdirs in the proper order)
3) test each filetype for attributes; if file, set to "read/write"
4) delete all the files -- record error info if any.
5) delete all the subdirectories.

My problem was on a (Novell) server -- I wrote a mirroring program; there was
no way to tell whether a file was still "open" as far as the server was
concerned.  Some people think the way you log off is to shut the power to
your PC off and leave for the night.

The other thing that screws you up sometimes is if there are "hidden" files
in a directory.  Other than that, run scandisk or something and see if your
FAT is hosed up at all.

Jim Bacon                    .(o)   (o).  / +  +  +\
jwbacon@ix.netcom.com        .   ___   . / +  +  + /
303-581-9635 ext 329 (work)   ..|   |.. / +  +  + / 
303-581-0960 (FAX)(w)           |_|_|  /_________/    W5-62-93



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

Date: 25 Oct 1997 01:41:01 GMT
From: pramanujam@aol.com (PRamanujam)
Subject: Shared Memory
Message-Id: <19971025014100.VAA14952@ladder01.news.aol.com>

How do I pass Shared Memory Id between Processes without forking a process


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

Date: 24 Oct 1997 23:14:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: SQL and Perl
Message-Id: <slrn652b36.qp.abigail@betelgeuse.wayne.fnx.com>

lb8qc@qcunix1.qc.edu (lb8qc@qcunix1.qc.edu) wrote on 1515 September 1993
in <URL: news:877711530.6152@dejanews.com>:
++ How can I execute SQL commands on a database using a perl script?
++ Do I need a perl of c module for that? If so, where can I get it from?


Well, that depends a lot on what database you use. If that one only
communicates in smoke signals, you need to find a language that
outputs smoke signals. (I've heard Java applets in Netscape do).

CPAN has perl interfaces to several databases. Whether it has one
for yours, who knows, as you don't tell which one you use.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^(11+?)\1+$/'


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

Date: 24 Oct 1997 23:17:02 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: SQL to update a row from a Perl script
Message-Id: <slrn652b79.qp.abigail@betelgeuse.wayne.fnx.com>

brian d foy (comdog@computerdog.com) wrote on 1515 September 1993 in
<URL: news:comdog-ya02408000R2410971453430001@news.panix.com>:
++ In article <3450DF28.6F56D35B@westatNOSPAM.com>, Henry Hartley <HARTLEH1@westatNOSPAM.com> wrote:
++ 
++ >$sql = sprintf("select * from Users where UserID='%s'", $uid);

Why the sprintf? Why not:

    $sql = "select * from Users where UserID='$uid'"; ?



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^(11+?)\1+$/'


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

Date: Fri, 24 Oct 1997 18:19:16 -0700
From: brian moseley <brian@criticalpath.net>
To: modperl@listproc.itribe.net
Subject: Storable error
Message-Id: <34514914.D7E595EE@criticalpath.net>

[sent to modperl list and comp.lang.perl.misc]

hi. the set of Apache::Registry scripts i'm writing uses Storable to
serialize an object to file for session storage purposes. using mod_perl
1.03 and Apache 1.3b2, everything works great using a server with a
virtual host configured to deal with mod_perl stuff.

when, however, i tried the mod_perl_tuning suggestion of using a proxy
to send mod_perl requests to a separate mod_perl server, i suddenly
begin to get this error with the Storable store() routine:

12102 CPath::WebMail: unable to store session 384552001953126 | Can't
determine type of SCALAR(0x162f40) at
/castro/dev/lib/perl5/site_perl/auto/Storable/_store.al line 15, at
/castro/dev/lib/perl5/site_perl/CPath/WebMail.pm line 117

i used Data::Dumper to check out the contents of the object i'm trying
to store. looks pretty reasonable to me:

$VAR1 = bless( {
                 sort => 'Date',
                 inbox => [
                            bless( {
                                     hdrs => {
                                               Subject => 'chaos rides',
                                               To => undef,
                                               From => 'moseley
<tuggy@maz.org>',
                                               Cc => undef,
                                               Bcc => undef,
                                               'Reply-To' => undef,
                                               Date => 'Fri, 24 Oct 1997
14:50:09 -0700 (PDT)',
                                               'Message-ID' =>
'<Pine.GSO.3.96.971024144903.21549A-100000@atari>'
                                             },
                                     size => 1018,
                                     status => 1,
                                     id =>
'3837373732393831352e353535302e63617374726f0',
                                     body => '
this is just a quick note to inform you that the Host of Chaos will be
taking arms against the puerile forces of Good tomorrow at dawn. we hope
to have cleaned up by tea-time.

ttys!


   tuggy@maz.org   -+-   white trash technologies   -+-   www.maz.org'
                                   }, 'CPath::MSI::Message' )
                          ],
                 workgroup => 'staff',
                 session => '284057617187501',
                 lname => 'jonez',
                 address => 'nerull@frog.dpo.net',
                 fname => 'nerull'
               }, 'CPath::User' );

let me reiterate that the _exact same data_ was handled wonderfully by
the single server setup. the only difference between the configurations
is that the first used a single server with a virtual host, the second
uses two servers, one as proxy.

any ideas?

-- code that poops out

sub death {
    my ( $r, $u ) = @_;

    my $session = $u->session;
    if ( &_store( $u ) ) {
        if ( $CPath::WebMail::DEBUG ) {
            print STDERR "$Prefix user stored as ";
            print STDERR "$CPath::session_store/$session \n";
        }
    } else {
        my $error = "unable to store session $session | $@";
        print STDERR "$Prefix: $error\n";
    }

    &Apache::exit();
}


sub _store {
    my $u = shift;
    my $session = $u->session;

#    if ( $CPath::WebMail::DEBUG ) {
#       use Data::Dumper;
#       print STDERR "$Prefix: u:\n", Dumper( $u );
#    }

    eval {
        &Storable::store( $u, "$CPath::session_store/$session" );
    };

    return ( $@ ? undef : 1 );
}

-- httpd.conf (from the well-behaved one server setup)

* regular httpd.conf stuff, snipped

<VirtualHost webmail.criticalpath.net>

ServerName                      webmail.criticalpath.net
DocumentRoot                    /home/ix/work/www/mail
UserDir                         disabled
DirectoryIndex                  inbox

PerlTaintCheck                  On
PerlFreshRestart                On
PerlScript                      /home/ix/work/www/init_perl

PerlSetEnv PATH                 /bin:/usr/bin
PerlSetEnv ORACLE_SID           <sid>
PerlSetEnv TWO_TASK             <two_task>
PerlSetEnv ORACLE_HOME          <oracle_home>

<Directory /home/ix/work/www/mail>

SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI

ErrorDocument 500 /err/server_error
ErrorDocument 404 /err/not_found

</Directory>

</VirtualHost>

* generic srm.conf, AddIcon, yadda yadda, snipped *

-- castro.conf ( 2nd setup; main server )

* same httpd.conf stuff, snipped *

ProxyPass /mail         http://localhost:6667/mail

* same exact srm. conf stuff, snipped *

-- webmail.conf ( 2nd setup; mod_perl server )

* same httpd.conf stuff, snipped

PerlTaintCheck          On
PerlFreshRestart        On
PerlScript              /home/ix/work/www/init_perl

PerlSetEnv PATH         /bin:/usr/bin
PerlSetEnv ORACLE_SID   dpo
PerlSetEnv TWO_TASK     dpo
PerlSetEnv ORACLE_HOME  /haight/oracle/app/oracle/product/7.3.2

<Directory /home/ix/work/www/mail>
DirectoryIndex          inbox
IndexOptions            FancyIndexing

SetHandler              perl-script
PerlHandler             Apache::Registry
Options                 +ExecCGI

ErrorDocument 500       /mail/err/server_error
ErrorDocument 404       /mail/err/not_found
</Directory>

* same srm.conf stuff, snipped *


-- 

* brian moseley *
{ agent of chaos => critical path }


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

Date: Fri, 24 Oct 1997 18:41:41 -0700
From: brian moseley <brian@criticalpath.net>
To: modperl@listproc.itribe.net
Subject: Re: Storable error
Message-Id: <34514E55.119BF80@criticalpath.net>

[sent to modperl list and comp.lang.perl.misc]

i just took the configuration file from the happy one server setup and
simply changed it from using a <VirtualHost> to an Alias'ed <Location>
and boom! same error.

??

brian moseley wrote:
> 
> [sent to modperl list and comp.lang.perl.misc]
> 
> hi. the set of Apache::Registry scripts i'm writing uses Storable to
> serialize an object to file for session storage purposes. using mod_perl
> 1.03 and Apache 1.3b2, everything works great using a server with a
> virtual host configured to deal with mod_perl stuff.
> 
> when, however, i tried the mod_perl_tuning suggestion of using a proxy
> to send mod_perl requests to a separate mod_perl server, i suddenly
> begin to get this error with the Storable store() routine:
> 
> 12102 CPath::WebMail: unable to store session 384552001953126 | Can't
> determine type of SCALAR(0x162f40) at
> /castro/dev/lib/perl5/site_perl/auto/Storable/_store.al line 15, at
> /castro/dev/lib/perl5/site_perl/CPath/WebMail.pm line 117
> 
> i used Data::Dumper to check out the contents of the object i'm trying
> to store. looks pretty reasonable to me:
> 
> $VAR1 = bless( {
>                  sort => 'Date',
>                  inbox => [
>                             bless( {
>                                      hdrs => {
>                                                Subject => 'chaos rides',
>                                                To => undef,
>                                                From => 'moseley
> <tuggy@maz.org>',
>                                                Cc => undef,
>                                                Bcc => undef,
>                                                'Reply-To' => undef,
>                                                Date => 'Fri, 24 Oct 1997
> 14:50:09 -0700 (PDT)',
>                                                'Message-ID' =>
> '<Pine.GSO.3.96.971024144903.21549A-100000@atari>'
>                                              },
>                                      size => 1018,
>                                      status => 1,
>                                      id =>
> '3837373732393831352e353535302e63617374726f0',
>                                      body => '
> this is just a quick note to inform you that the Host of Chaos will be
> taking arms against the puerile forces of Good tomorrow at dawn. we hope
> to have cleaned up by tea-time.
> 
> ttys!
> 
>    tuggy@maz.org   -+-   white trash technologies   -+-   www.maz.org'
>                                    }, 'CPath::MSI::Message' )
>                           ],
>                  workgroup => 'staff',
>                  session => '284057617187501',
>                  lname => 'jonez',
>                  address => 'nerull@frog.dpo.net',
>                  fname => 'nerull'
>                }, 'CPath::User' );
> 
> let me reiterate that the _exact same data_ was handled wonderfully by
> the single server setup. the only difference between the configurations
> is that the first used a single server with a virtual host, the second
> uses two servers, one as proxy.
> 
> any ideas?
> 
> -- code that poops out
> 
> sub death {
>     my ( $r, $u ) = @_;
> 
>     my $session = $u->session;
>     if ( &_store( $u ) ) {
>         if ( $CPath::WebMail::DEBUG ) {
>             print STDERR "$Prefix user stored as ";
>             print STDERR "$CPath::session_store/$session \n";
>         }
>     } else {
>         my $error = "unable to store session $session | $@";
>         print STDERR "$Prefix: $error\n";
>     }
> 
>     &Apache::exit();
> }
> 
> sub _store {
>     my $u = shift;
>     my $session = $u->session;
> 
> #    if ( $CPath::WebMail::DEBUG ) {
> #       use Data::Dumper;
> #       print STDERR "$Prefix: u:\n", Dumper( $u );
> #    }
> 
>     eval {
>         &Storable::store( $u, "$CPath::session_store/$session" );
>     };
> 
>     return ( $@ ? undef : 1 );
> }
> 
> -- httpd.conf (from the well-behaved one server setup)
> 
> * regular httpd.conf stuff, snipped
> 
> <VirtualHost webmail.criticalpath.net>
> 
> ServerName                      webmail.criticalpath.net
> DocumentRoot                    /home/ix/work/www/mail
> UserDir                         disabled
> DirectoryIndex                  inbox
> 
> PerlTaintCheck                  On
> PerlFreshRestart                On
> PerlScript                      /home/ix/work/www/init_perl
> 
> PerlSetEnv PATH                 /bin:/usr/bin
> PerlSetEnv ORACLE_SID           <sid>
> PerlSetEnv TWO_TASK             <two_task>
> PerlSetEnv ORACLE_HOME          <oracle_home>
> 
> <Directory /home/ix/work/www/mail>
> 
> SetHandler perl-script
> PerlHandler Apache::Registry
> Options +ExecCGI
> 
> ErrorDocument 500 /err/server_error
> ErrorDocument 404 /err/not_found
> 
> </Directory>
> 
> </VirtualHost>
> 
> * generic srm.conf, AddIcon, yadda yadda, snipped *
> 
> -- castro.conf ( 2nd setup; main server )
> 
> * same httpd.conf stuff, snipped *
> 
> ProxyPass /mail         http://localhost:6667/mail
> 
> * same exact srm. conf stuff, snipped *
> 
> -- webmail.conf ( 2nd setup; mod_perl server )
> 
> * same httpd.conf stuff, snipped
> 
> PerlTaintCheck          On
> PerlFreshRestart        On
> PerlScript              /home/ix/work/www/init_perl
> 
> PerlSetEnv PATH         /bin:/usr/bin
> PerlSetEnv ORACLE_SID   dpo
> PerlSetEnv TWO_TASK     dpo
> PerlSetEnv ORACLE_HOME  /haight/oracle/app/oracle/product/7.3.2
> 
> <Directory /home/ix/work/www/mail>
> DirectoryIndex          inbox
> IndexOptions            FancyIndexing
> 
> SetHandler              perl-script
> PerlHandler             Apache::Registry
> Options                 +ExecCGI
> 
> ErrorDocument 500       /mail/err/server_error
> ErrorDocument 404       /mail/err/not_found
> </Directory>
> 
> * same srm.conf stuff, snipped *
> 
> --
> 
> * brian moseley *
> { agent of chaos => critical path }

-- 

* brian moseley *
{ agent of chaos => critical path }


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

Date: 25 Oct 1997 00:24:56 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Unexplainable error: Useless use of private variable in void context
Message-Id: <slrn652f6j.qp.abigail@betelgeuse.wayne.fnx.com>

Baruch Even (Baruch.Even@nospam.ibm.net) wrote on 1515 September 1993 in
<URL: news:fbwusskyewayaihojk.pminews@localhost>:
++ Hello,
++ 
++ I'm new to perl and trying to write my first program, I get the following
++ message on a while clause: "Useless use of private variable in void context"
++ 
++   if (something) { $banNbr == 0 ;}
                              ^
                              |
    You might want '=' here --+



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^(11+?)\1+$/'


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

Date: Fri, 24 Oct 1997 21:41:39 -0600
From: PRamanujam@aol.com
Subject: Using Shared Memory to communicate between 2 processes
Message-Id: <877745445.6845@dejanews.com>

could any one give a example of One process creating a shared memory and
a second process attaching to the same shared memory without using fork
to attach to the process

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 1227
**************************************

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