[17364] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4786 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 1 18:05:37 2000

Date: Wed, 1 Nov 2000 15:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973119909-v9-i4786@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 1 Nov 2000     Volume: 9 Number: 4786

Today's topics:
    Re: "chown" of symlink instead of linked file (Martien Verbruggen)
    Re: "chown" of symlink instead of linked file (Otto Wyss)
    Re: "chown" of symlink instead of linked file <joe+usenet@sunstarsys.com>
    Re: About killing processes?? <tim@ipac.caltech.edu>
        CGI new user/password needed... <mjaffe@futuristics.net>
    Re: CGI Perl vs. Java Servlets... <jesusx@who.net>
    Re: CGI Perl vs. Java Servlets... (Randal L. Schwartz)
    Re: CGI Perl vs. Java Servlets... <russ_jones@rac.ray.com>
    Re: Having a brain fade (Richard J. Rauenzahn)
    Re: Integer overflow <harasty@my-deja.com>
    Re: IO::Socket, HTTP POST vs. GET (Charles DeRykus)
    Re: limit to number of sockets/filedesc on Win2K? <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: limit to number of sockets/filedesc on Win2K? <cak@putzl.com>
    Re: Mail::Send tltt@my-deja.com
    Re: ODBC - Newbie having problems (P&C)
    Re: out of memory problem under mod_perl (Martien Verbruggen)
    Re: out of memory problem under mod_perl <joe+usenet@sunstarsys.com>
    Re: Perl Question (Martien Verbruggen)
    Re: regular expression <james@NOSPAM.demon.co.uk>
    Re: sending webpage form <mischief@velma.motion.net>
    Re: SMS - text messaging (Richard J. Rauenzahn)
    Re: SMS - text messaging <xzrgpnys@yvtugubhfrovm.pbz>
    Re: Sorting an array of arrays zabor@my-deja.com
        Unix authentication with an /etc/shadow file <guess@where.com>
        Want to process all files less than 24 hours old <mark-lists@webstylists.com>
    Re: Want to process all files less than 24 hours old (Jerome O'Neil)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 01 Nov 2000 21:55:41 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: "chown" of symlink instead of linked file
Message-Id: <slrn9014at.vf1.mgjv@verbruggen.comdyn.com.au>

On 1 Nov 2000 08:20:35 GMT,
	Villy Kruse <vek@pharmnl.ohout.pharmapartners.nl> wrote:
> On 31 Oct 2000 15:25:16 -0500,
>          Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> 
> 
> >cfedde@fedde.littleton.co.us (Chris Fedde) writes:
> >
> >> 
> >> From the Apache Doc:
> >> 
> >>     SymLinksIfOwnerMatch 
> >> 	 The server will only follow symbolic links for which the
> >> 	 target file or directory is owned by the same user id as
> >> 	 the link.  
> >
> >IMHO, it's basically a gut check that prevents a local user from making 
> >/etc/passwd available via ~luser/symlink_to_config_file .
> >
> 
> Exactly!! or other sensitive files for that matter.

We're getting a bit offtopic here, but ok..

That is the reason, but it should only be necessary if the process
that tries to do the chown has sufficient privileges. A web server
shouldn't run with that many privileges. Anyone who runs a web server
as root, which is the only user that could chown /etc/passd, deserves
what they get.

There is hardly ever a decent reason to change ownership of a
symlink. Permissions all propagate to the real file, which is where
they belong.

Anyone who writes a program that needs to run as root and do large
amounts of chown (for example to change ownership of a whole tree of
files), should check that they're not doing it against a symlink. You
first stat the file, and if it's a symbolic link, you skip it, or
alternatively, you lchown it. Be careful using find or chown -R.

> And because you can't chown the symlink itself it is proven that the
> owner of the target is the same one that created the symlink.  The

Yes, you can. With lchown. We've shown two ways of doing that in this
thread. One using the system call directly, and one using chown with
the -h option.

> alternative is that apache doesn't follow symlink at all to prevent
> access to files which would not otherwise be available to the web
> server.
> 
> BTW, on most system these days an average user cant chown anything at
> all anyway.

I wouldn't say most systems. I'd say that on most systems chown works
fine. It's just limited to what you can do with it. You used to be
able to chown your own files to someone else, i.e. give them away.
Most systems do no longer allow this. However, you can still change
groups as long as you have the right permissions.

> Also, the way to change the owner of a symlink is to delete it and
> create a new one while running as the proper user.

Or to use lchown. If indeed you do not have the permissions to do
that, deleting and recreacting is an option. But I still fail to see
why that should ever be necessary, unless you need to work with
products with more failsafes than are good for them.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 42.6% of statistics is made up on the
Commercial Dynamics Pty. Ltd.   | spot.
NSW, Australia                  | 


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

Date: Wed, 1 Nov 2000 22:57:44 +0100
From: otto.wyss@bluewin.ch (Otto Wyss)
Subject: Re: "chown" of symlink instead of linked file
Message-Id: <1eje32w.1k450821htj5hcN%otto.wyss@bluewin.ch>

> tom, calm down. i am not in need of the chown -h option and i have it on
> my box if i needed it. i am just saying it is not a widespread option so
> it makes changing the symlink owner problem trickier from perl. if you
> 
I'd rather like to be able to specify options on perl functions if the
underlying system calls supports them instead of using another function
name . So how do I change the time of a symlink instead of the
referenced file? There is no "ltouch" nor a "touch -h" on my Debian
Linux and don't know if the kernel has a suitable syscall. In my view
the best would be if I could specify this kind of option together with
the file name (i. e. {testfile::symlink} ), so the symlink problem could
be use with any perl function. Besides this way a function with 2 file
parameter could use them independent. This is probably something for
perl 6 (and maybe for Linux as well).

Anyway since I'm not a very good perl programmer, could anybody tell my
how I have to change my statements 

        my (atime, $mtime) = (stat($file))[8,9];
        chown $uid, $gid, $file;
        utime ($atime, $mtime, $file);

so it just changes the owner of the symlink. 

O. Wyss


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

Date: 01 Nov 2000 17:04:30 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: "chown" of symlink instead of linked file
Message-Id: <m3aebjz6vl.fsf@mumonkan.sunstarsys.com>

otto.wyss@bluewin.ch (Otto Wyss) writes:

> name . So how do I change the time of a symlink instead of the
> referenced file? There is no "ltouch" nor a "touch -h" on my Debian
> Linux and don't know if the kernel has a suitable syscall. In my view

Does relinking a'la  "ln -sf" not work?

-- 
Joe Schaefer


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

Date: Wed, 01 Nov 2000 11:25:35 -0800
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: About killing processes??
Message-Id: <3A006E2F.CFE62793@ipac.caltech.edu>

Esa Vihtonen wrote:
> I want to run a c-program which will be started using perl script. What
> would be the easiest way for controlling the time that c-program has been
> running and how to kill it if running time gets too long (for example the
> c-program has got into neverending loop)?
> 
> I´ve never been part of these newsgroups but if someone could help me with
> the problem, i´d be very happy =)

Start by reading the docs. Look up 'system', 'exec', 'fork', 'kill', 'wait',
'waitpid', 'alarm', 'sleep' and 'time' in perlfunc, plus any other docs you may
need to get you up to speed on Perl in general. Then read perlopentut and/or
perlipc. Then give it a try and if you have more trouble, do a deja news search
on this newsgroup looking for past threads where similar topics have been
discussed. If you still have questions, post again with some minimal sample code
and data that shows the problem you're having. 

Here's a trivial example to get you going:
                              child   <|> parent       
perl -wle '$pid=fork or exec "sleep 60"; sleep 5; kill 9,$pid; wait; sleep 20'
                                           ^ = time child is allowed to run

Watch what happens to the various processes with top in another term window.

Good luck.

--

-- Tim Conrow         tim@ipac.caltech.edu                           |


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

Date: Wed, 01 Nov 2000 22:31:47 GMT
From: "Mark Jaffe" <mjaffe@futuristics.net>
Subject: CGI new user/password needed...
Message-Id: <nR0M5.7798$rl.656942@newsread2.prod.itd.earthlink.net>

I am admin to a CVS server and I need a method to allow users to log in and
change their passwords and make new accounts. I do NOT want or need them
directly accessing the machine through shell accounts.

I've tried a method where a perl CGI calls system executables tpo create
user and change password, but I am not getting expected results. The CGI is
marked suid but it fails to do the adduser call for a new user and also does
not do the passwd call to change an existing  user. What could be going
wrong?

System is running Mandrake 7.1, BTW.

Mark




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

Date: Wed, 01 Nov 2000 15:23:15 -0500
From: jesus X <jesusx@who.net>
Subject: Re: CGI Perl vs. Java Servlets...
Message-Id: <3A007BB3.DACFF8CF@who.net>

"Randal L. Schwartz" wrote:
> Sorta like that old phrase, "Presume a perfectly spherical cow..."

Ok, I must admit, I don't know this old phrase. I'd love to hear the rest
though, as the idea of a spherical cow has me rolling in laughter. =-]

--
jesus X  [ Booze-fueled paragon of pointless cruelty and wanton sadism. ]
 email   [ jesusx @ who.net ]
 web     [ http://www.burntelectrons.com/ ]
 tag     [ The Universe: It's everywhere you want to be. ]
 warning [ If at first you don't succeed, reload. ]


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

Date: 01 Nov 2000 13:23:20 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: CGI Perl vs. Java Servlets...
Message-Id: <m1pukfz8s7.fsf@halfdome.holdit.com>

>>>>> "jesus" == jesus X <jesusx@who.net> writes:

>> Sorta like that old phrase, "Presume a perfectly spherical cow..."

jesus> Ok, I must admit, I don't know this old phrase. I'd love to
jesus> hear the rest though, as the idea of a spherical cow has me
jesus> rolling in laughter. =-]

You think *you* are rolling?  Oughta see that cow!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 01 Nov 2000 15:48:38 -0600
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: CGI Perl vs. Java Servlets...
Message-Id: <3A008FB6.5596C2D0@rac.ray.com>

"Randal L. Schwartz" wrote:
> 
> >>>>> "jesus" == jesus X <jesusx@who.net> writes:
> 
> >> Sorta like that old phrase, "Presume a perfectly spherical cow..."
> 
> jesus> Ok, I must admit, I don't know this old phrase. I'd love to
> jesus> hear the rest though, as the idea of a spherical cow has me
> jesus> rolling in laughter. =-]
> 
> You think *you* are rolling?  Oughta see that cow!
> 

Out here on the prairie we call that "cow tipping." It's not practiced
in polite company.


-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: 1 Nov 2000 19:07:48 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: Having a brain fade
Message-Id: <973105666.588545@hpvablab.cup.hp.com>

Bart Lateur <bart.lateur@skynet.be> writes:
>dottiebrooks@my-deja.com wrote:
>
>>I need to do some work on all combinations of a variable number of
>>fields.  For example, if the current run has 3 variables (A, B, C), I
>>need to pull input for analysis of A, AB, AC, ABC, ACB, B, BA, BC,
>>BAC,...  The next run could have 4 variables, for example. 
>
>This sound like a job for a binary counter. Actually, you can use an
>ordinary counter, and use each bit of it as a flag, indicating if you
>need to include that "variable".

That provides combinations, not permutations...

>	sub getemall {
>	    my @result;
>	    for my $i (1 .. 1<<@_) {
>	        push @result, [ map { ($i & 1<<$_)?$_[$_]:() } 0..$#_];
>	    }
>	    return @result;
>	}
>	print "@$_\n" foreach getemall('A', 'B', 'C', 'D');

But I like it -- I wrote this the hard way many months ago while trying
to optimize bracket/stud distances in a closet...

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Wed, 01 Nov 2000 21:51:13 GMT
From: Dan Harasty <harasty@my-deja.com>
Subject: Re: Integer overflow
Message-Id: <8tq38e$lnu$1@nnrp1.deja.com>

In article <1eim8wf.1gj7o0hoieseiN%kpreid@attglobal.net>,
  kpreid@attglobal.net (Kevin Reid) wrote:

> I am working on a large, long-running Perl application.
>
> There is an object class for which each instance has an ID number. The
> numbers are assigned sequentially:
> ....
> I am concerned that, now or in future versions,
> Perl will start
die()ing on integer overflow...

A) From the "thinking outside-of-the-box" department:  Don't use
integers as your IDs, use a string, and use Perl's automagical string
incrementing:

Initialize $NextID to "aaaaaaaaaaaaaaaaaaaa" (that's 20 letters 'a'),
then:

    my $id = $NextID++;

On the next pass, $NextID is "aaaaaaaaaaaaaaaaaaab", and so on upto
"zzzzzzzzzzzzzzzzzzzz".  That's a lot of IDs: about 2 * 10^28.  That is
the equivalent to using a 32-bit int a million-million-million times.

B) From the "are you being realistic?" department: Are you *really*
going to run out of integers?  If you start at 0 and need 1000 unique
IDs every second, your program will "run out" of the standard signed
integers in about two months.  You can double this if you use the
negative integers, too...  You will run out of memory sooner that that!

C) From the "oh, if you MUST do it your way" department:  If you really
need that many ints and you really need them to be ints (not just
unique), then check out the Math::BigInt module.



Happy Perling,

Dan Harasty



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 1 Nov 2000 19:22:03 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: IO::Socket, HTTP POST vs. GET
Message-Id: <G3D1sr.8Eu@news.boeing.com>

In article <39F75570.C2942928@sharewire.com>,
Jihad Battikha  <jihad.battikha@sharewire.com> wrote:
>I'm having a mental block with something that might be simple, but I'm
>not sure how to deal with it.
>
>I'm trying to create a simple HTTP logging daemon using low-level socket
>code rather than some high-level modules like LWP::UserAgent,
>HTTP::Daemon, HTTP::Request, or HTTP::Response.  I don't want to go into
>detail as to why I want a lower level of control, but part of the reason
>is to manipulate chucks of the headers mid-stream (back and forth) and
>to help me with debugging other scripts which *do* use high-level
>modules.
>
>Anyway, here's an extremely simple snippet which works fine for requests
>without body entities:
>
>my $server = IO::Socket::INET->new(LocalPort => 8010,
>                                   Type      => SOCK_STREAM,
>                                   Listen    => 10) or die "$@\n";
>... snipped

[ posted and mailed ]

Sorry for the late response but I just remembered httpsniffer
which at least lets you peep at the transaction. Should 
be flexible enought to work here with a bit of twiddling.
Don't remember if it's on CPAN but the pod says the latest 
version is availble from: 

  http://www.compansr.demon.co.uk   (author: T. Meadowcroft)

hth,
--
Charles DeRykus


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

Date: Wed, 01 Nov 2000 13:11:49 -0800
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: limit to number of sockets/filedesc on Win2K?
Message-Id: <3A008715.670D5ABA@jpl.nasa.gov>

Chris Kantarjiev wrote:
> 
> I'm trying to create a lot (500 to 1000) connections from one perl
> script, and am running into a limit - when I try to open the 254th
> connection, I get the error "Bad file descriptor"  from
> IO::Socket::INET->new(). This is on Win2K - is it a hard limit? A quicky
> experiment with a C program lets me open 508 file descriptors...

It is suggestive that 508 = 254*2.  You might want to find a group that
discusses the Win2K operating system to find out what the socket limit
is.  (I seem to recall something about Microsoft artifically limiting
the number of socket connections for non-server NTs.)

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: Wed, 01 Nov 2000 14:20:41 -0800
From: Chris Kantarjiev <cak@putzl.com>
Subject: Re: limit to number of sockets/filedesc on Win2K?
Message-Id: <3A009739.1307C762@putzl.com>

Jon Ericson wrote:
> 
> Chris Kantarjiev wrote:
> >
> > I'm trying to create a lot (500 to 1000) connections from one perl
> > script, and am running into a limit - when I try to open the 254th
> > connection, I get the error "Bad file descriptor"  from
> > IO::Socket::INET->new(). This is on Win2K - is it a hard limit? A quicky
> > experiment with a C program lets me open 508 file descriptors...
> 
> It is suggestive that 508 = 254*2.  You might want to find a group that
> discusses the Win2K operating system to find out what the socket limit
> is.  (I seem to recall something about Microsoft artifically limiting
> the number of socket connections for non-server NTs.)
> 
> Jon
> --
> Knowledge is that which remains when what is
> learned is forgotten. - Mr. King

Yes, that *is* suggestive ... but sadly, not very helpful :-)


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

Date: Wed, 01 Nov 2000 21:43:27 GMT
From: tltt@my-deja.com
Subject: Re: Mail::Send
Message-Id: <8tq2pu$l95$1@nnrp1.deja.com>

In article ,lattice@cassandra.intergate.ca (blaine) wrote:
> Unfortunately, the 'From' header is not set. I've tried using
$msg->set(),
> as well as setting other headers (ie, $msg->set( 'X-Myheader',
'Mydata' ) )
> to no avail. Is this a bug in Mail::Send, or am I just doing something
wrong?

In order to change the "From" field you need to be a trusted user (check
the sendmail docs for that). The Perl side of things seems to be working
OK.

hth,
tltt


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 01 Nov 2000 20:10:29 GMT
From: mailloop@localhost.com (P&C)
Subject: Re: ODBC - Newbie having problems
Message-Id: <3a0078d6.31341406@netnews.voicenet.com>

On Wed, 01 Nov 2000 04:43:02 GMT, Bob Walton
<bwalton@rochester.rr.com> wrote:

>P&C wrote:
>...
>> Now the problem, if I go to my URL and type in the test.pl which came
>> with the ODBC package
>> 
>> ----------------------  T E S T   Error Report: ---------------------
>>         Error Report:
>> The following were errors:
>> Test 3a = new(): [-1024] [] "[Microsoft][ODBC Microsoft Access Driver]
>> Could not use '(unknown)'; file already in use."
>> 
>> Also, any attempts to call my &initialize($dsn); function just returns
>> a blank html page.  I never get the die message nor any other messages
>> and the database never gets updated.
>> 
>> What do I do next, where do I go from here?
>> 
>> Thanks,
>> 
>> Phil
>> p c   a t   n t a d m i n   d o t   c o m
>Sounds to me like you probably didn't define your system ODBC connection
>on the computer that is running your web server.  That is where your CGI
>script would be trying to get it.
Thanks for that guess.  I have indeed defined the ODBC connection
under the system tab (see the 1st line in my original posting) and I
have just double checked that as well and it is indeed there.  This is
substantiated bye the fact that test.pl (which comes with the ODBC
package) can access the database just fine when run from the command
line but not if from the web browser.


p c   a t   n t a d m i n   d o t   c o m


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

Date: Wed, 01 Nov 2000 22:16:38 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: out of memory problem under mod_perl
Message-Id: <slrn9015i5.vf1.mgjv@verbruggen.comdyn.com.au>

On Wed, 1 Nov 2000 19:07:30 -0000,
	Christian Mahnke <mahnke@fliegen-ist-schoener.de> wrote:
> hello group,
> 
> I get the following error under high load. Has anybody seen that before? Do
> I need more memory, and if so why does the OS (Linux) doesn`t manage with
> the swap? Any help is highly appriciated.

It's hard to tell which is the cause. The effect is that perl can't
get enough memory. 

\begin{offtopic}

If your machine has enough CPU grunt left, and your run queue is
small, more memory could solve the problem. If you have a long run
queue and a saturated machine, you need to investigate what it's
doing. If it's swapping, more memory. If not, more CPU. Note that
measuring the performance of the machine while this occurs is not
going to tell you what to do. You will need to find out what occurs
first: Does the system start to swap before the run queue gets large?
Is it the other way around? 

In one case you need more memory, in the other more CPU power. How
much more is hard to tell. Whether it will shift the bottleneck to the
other spot is also hard to tell.

Anyway, this is not a Perl problem. Tuning machines is an art in
itself, and you should probably move to a linux group to see if
someone over there can help you determine what the problem is. I've
never done any performance tuning on linux, so I don't know what tools
to use, what to look at, and what to tweak, except in general terms.

If you're interested in more scalable performance, maybe you should
consider running one of the *BSD distributions instead. Or maybe
Solaris for x86.

\end{offtopic}

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 42.6% of statistics is made up on the
Commercial Dynamics Pty. Ltd.   | spot.
NSW, Australia                  | 


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

Date: 01 Nov 2000 17:42:59 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: out of memory problem under mod_perl
Message-Id: <m34s1rz53g.fsf@mumonkan.sunstarsys.com>

"Christian Mahnke" <mahnke@fliegen-ist-schoener.de> writes:

> hello group,
> 
> I get the following error under high load. Has anybody seen that before? Do
> I need more memory, and if so why does the OS (Linux) doesn`t manage with
> the swap? Any help is highly appriciated.
> 
> Erroo Log:
> 
> Sun Oct 29 15:23:25 2000] [notice] Apache/1.3.9 (Unix) Debian/GNU
> mod_perl/1.21_03-dev configured -- resuming normal operations
> [Sun Oct 29 15:23:22 2000] [notice] SIGUSR1 received.  Doing graceful
> restart
> [Sun Oct 29 13:48:44 2000] [notice] child pid 14620 exit signal Alarm
> clock (14)
> Callback called exit.
> Out of memory!
> Ouch!  malloc failed in malloc_block()
> Callback called exit.
> Out of memory!
> Callback called exit.
> Out of memory!
> Callback called exit.
> Out of memory!
> [Sun Oct 29 11:47:25 2000] [error] server reached MaxClients setting,
> consider raising the MaxClients setting
> Callback called exit at /dev/null line 319.
> END failed--cleanup aborted at /dev/null line 319.
> Callback called exit at /dev/null line 319.
> Callback called exit at /dev/null line 319.
> END failed--cleanup aborted at /dev/null line 319.
> Callback called exit at /dev/null line 319.
> END failed--cleanup aborted at /dev/null line 319.
> Callback called exit at /dev/null line 319.
> Callback called exit at /dev/null line 319.
> Out of memory!
> Out of memory!
> Out of memory!
> Callback called exit at /dev/null line 4.
> END failed--cleanup aborted at /dev/null line 4.
> Callback called exit at /dev/null line 4.
> END failed--cleanup aborted at /dev/null line 4.
> Callback called exit at /dev/null line 4.
> END failed--cleanup aborted at /dev/null line 4.
> Callback called exit.
> Callback called exit.
> Callback called exit.
> Out of memory!
> Out of memory!
> Out of memory!
> Ouch!  malloc failed in malloc_block()
> [Sun Oct 29 06:25:18 2000] [notice] suEXEC mechanism enabled (wrapper:
> /usr/lib/apache/suexec)
> 

It took a while before I realized your chronology is
upside-down.  Here's what I think is happening:

You have some perl code that is caught in a loop.
When this happens in mod_perl, that tends to freeze out the looping
child that got stuck processing the request from serving any other 
requests. From that point on, apache thinks the child is busy, and 
so it will create a new process to handle subsequent requests.  After 
a period of time, more processes will get stuck, and more memory/cpu
resources are consumed.  Eventually, your box gets filled with looping
processes that are probably a few megs each, since mod_perl children
are obese.

That's quite a reach given the small amount of info you've provided,
but having seen this behavior before, it's all too familiar.  It's 
probably also worth noting that certain well-known mod_perl Apache
modules have bugs in them that allow a malicious user to cause this
situation.

-- 
Joe Schaefer



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

Date: Wed, 01 Nov 2000 22:06:30 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl Question
Message-Id: <slrn9014v6.vf1.mgjv@verbruggen.comdyn.com.au>

On Wed, 1 Nov 2000 17:32:32 +0000,
	James Taylor <james@NOSPAM.demon.co.uk> wrote:
> In article <slrn9003vu.a5b.tadmc@magna.metronet.com>, Tad McClellan
> <URL:mailto:tadmc@metronet.com> wrote:
> > 
> > Nobody reads all the articles posted here (there are just too many).
> > 
> > So they must decide somehow which ones they will read and which
> > ones they will skip. Most do this by looking at the Subject.
> > 
> > Many folks will skip an article if they cannot tell what it
> > is about from the Subject header.
> 
> I agree that Subject: lines should be descriptive of the matter under
> discussion where possible, but I'm curious about your suggestion that
> people actually skip articles that do not have a descriptive subject.
> If I see a subject that I know I won't find interesting then I skip
> it, but if the subject tells me nothing there is a small chance that
> I'll open it to discover what is being discussed. Hmmm, I think I've
> just answered my own question - it really is a *very* small chance. :-)

I won't read them, normally. The only reason that I'm reading this is
that Tad followed up to the original post.  My score file marks
certain posts as potetntially being of higher value, and some as
potentially of lower value.  Of course, some posters, subjects,
origins or reference headers will completely disqualify a post, and
those never even show up on my screen.

I actually used to score down posts with Perl in the subject for a
while, but unfortunately, that was too crude a filter.  Some posts
with Perl in the subject were actually worth reading. I just browsed
some old entries in the score file. 'Question' used to also be one
that got a negative score. I don't know why I removed it anymore.

I read my posts in scored order. I hardly ever get down to the ones
that got a negative score. Once I am past the ones that got a positive
score, I skim subject lines for things that catch my eye. 'Perl
Question' wouldn't.

I think that most people with a lot of Usenet experience read news
this way. It becomes too annoying any other way.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | Curiouser and curiouser, said Alice.
NSW, Australia                  | 


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

Date: Wed, 1 Nov 2000 20:15:10 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: regular expression
Message-Id: <ant012010064fNdQ@oakseed.demon.co.uk>

In article <slrn900lm2.be8.tadmc@magna.metronet.com>, Tad McClellan
<URL:mailto:tadmc@metronet.com> wrote:
>
> Doubling backslashes in single quoted strings is useless,
[snip]

Okay, I see now that backslashes in sinlge quotes can be avioded in
many cases, and I also see that avoiding them can improve legibility.

> I dunno what "trip you up" cases you might mean. Got an example
> of what you mean there?

Well, I was thinking of building regexes and that if you only had
single backslashes it might be possible for them to be misinterpreted
later on when you come to use the built regex. Ren Maddox points
this out in the next article. Err... that's the one with message id:
<m3pukf60bi.fsf@dhcp11-177.support.tivoli.com>

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: Wed, 01 Nov 2000 21:16:58 -0000
From: <mischief@velma.motion.net>
Subject: Re: sending webpage form
Message-Id: <t0122a11d2vbf@corp.supernews.com>

digihoo@hotmail.com wrote:
> hi
> i know how to generate and send the <text> results
> of a form using perl .. but is there any way to send
> the <HTML> (or WYSIWYG) version of the page, as filled
> out by the user?
> there must be a way to do this (?)
> thanks ..

I'm not sure how you're wanting to do this (or for that matter why),
but there are a couple of ways to get a whole HTML page from a
HTTP url. Take a look at the LWP modules. They won't get the user's
input, but you can do that with CGI.pm instead. The way to approach
this would be to use the REFERER field (or a hidden field containing
some other way to reference the file/page).

If the CGI is running on the same web server from which the page
is being served, you could just read the file from its path.


You could also make a CGI that print out the page in the first place,
and optionally include the input the user gave from a previous session
by reading it from a file. I've done this for quote request forms. I
take the input from a page, write it to a file, and email someone that
the quote was requested. Someone then goes to the URL, where the CGI
reads the info from the file and uses it to build the web page. It
makes input fields with the default values set to whatever the user
requesting the quote typed in. Then, the sales rep checks the
capitalization, the validity of the email address, and a few other
things, and enters any price, availability, and contract terms info
before clicking the button to email the quote.


The short answer, then, is no, you can't read the whole HTML web page
including the user's input. The long answer, though, is you just have
to be marginally creative with Perl and HTML to do what you want.

If you don't have control of the web page but do have control of the
CGI, then I'd suggest the LWP family of modules.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

-- 
Christopher E. Stith
mischief@motion.net

Oooooh! Navy Seals!



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

Date: 1 Nov 2000 19:11:05 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: SMS - text messaging
Message-Id: <973105864.460009@hpvablab.cup.hp.com>

xzrgpnys@yvtugubhfrovm.pbz writes:
>Steve wrote:
>> Can anybody recommend a script that allows a user to
>> send text messages from a website to a mobile phone.
>> I have searched on deja and quite a few script sites
>> without much luck. Recommendations from current users
>> would be extremely helpful.
>
>Well, that would most likely depend a great deal on the type of phone. 
>Did it come with instructions on how to send messages to the phone? 
>Most companies will automatically send an email that sent to a certain
>address to the phone, so if that is how your provider works, look up a
>script to send email from a web page.

Or if he's asking how to write a script that uses an existing webpage,
then he'll want to look at the lwpcook manpage.

I wish many posters on clpm would try to write clearer questions.

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: 01 Nov 2000 19:45:13 GMT
From: kevin metcalf <xzrgpnys@yvtugubhfrovm.pbz>
Subject: Re: SMS - text messaging
Message-Id: <3A00734E.1D488A0C@yvtugubhfrovm.pbz>

"Richard J. Rauenzahn" wrote:
> xzrgpnys@yvtugubhfrovm.pbz writes:
> >Steve wrote:
> >> Can anybody recommend a script that allows a user to
> >> send text messages from a website to a mobile phone.
> >> I have searched on deja and quite a few script sites
> >> without much luck. Recommendations from current users
> >> would be extremely helpful.
> >
> >Well, that would most likely depend a great deal on the type of phone.
> >Did it come with instructions on how to send messages to the phone?
> >Most companies will automatically send an email that sent to a certain
> >address to the phone, so if that is how your provider works, look up a
> >script to send email from a web page.
> 
> Or if he's asking how to write a script that uses an existing webpage,
> then he'll want to look at the lwpcook manpage.

Good point.

> I wish many posters on clpm would try to write clearer questions.

Say it isn't so!  ;)

Kevin
--
email: xzrgpnys@yvtugubhfrovm.pbz
Huh?  http://www.flactem.com/utils/rot13.html


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

Date: Wed, 01 Nov 2000 20:12:35 GMT
From: zabor@my-deja.com
Subject: Re: Sorting an array of arrays
Message-Id: <8tptfb$gal$1@nnrp1.deja.com>

Thank you for your answer. Very much help. I did read through all the
different sort documents out there but none of them really discussed
multi-dimentional arrays.

In article <3A005B7D.5D0CFEF3@iname.com>,
  Kjetil Skotheim <kjetilskotheim@iname.com> wrote:
>
> zabor@my-deja.com wrote:
> >
> > I am reading from a file that lists a bunch of users. Now I need to
> > sort that list and reprit it. Here is my users data that I have in a
> > file called data.dat:
> >
> > Jim|Doe|zabor|6/25/00|16:45:31
> > Mark|Doed|madman|6/30/00|12:18:00
> > Ken|Doer|Shoeboota|6/2/00|3:22:55
> > Hope|Doeg|Arabelle|10/2/00|5:55:30
> >
> >         if ($FORM{'sortby'} eq "fname")     {$loc = 0;}
> >         elsif ($FORM{'sortby'} eq "lname")  {$loc = 1;}
> >         elsif ($FORM{'sortby'} eq "uname")  {$loc = 2;}
> >         elsif ($FORM{'sortby'} eq "date")   {$loc = 3;}
> >         elsif ($FORM{'sortby'} eq "time")   {$loc = 4;}
> >
> >         @nusers = sort {[$a]->[$loc] cmp [$b]->[$loc]} @users;
>
> Try:
> $loc={fname=>0,lname=>1,uname=>2,date=>3,time=>4}->{$FORM{sortby}};
> @nusers = sort{$$a[$loc] cmp $$b[$loc]} @users;
>
> ...but of course it would not work for "date"-sorting.
>
> --
> Kjetil Skotheim
> kjetilskotheim@iname.com
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 1 Nov 2000 13:28:24 -0500
From: "Che Gonzalez" <guess@where.com>
Subject: Unix authentication with an /etc/shadow file
Message-Id: <8tpnck02j1d@enews1.newsguy.com>

WIthout using the Authen module is there any way to authenticate a user in
BSD | Linux that uses a /etc/shadow file.  Also, no greping or reading
/etc/shadow.  Any alternatives?




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

Date: Wed, 01 Nov 2000 13:43:41 -0800
From: Mark Thompson <mark-lists@webstylists.com>
Subject: Want to process all files less than 24 hours old
Message-Id: <27310t4jj0mb15rd51hs11b3foajj10bjt@4ax.com>

Hi,

I'm wondering how would be the best way to go about processing all
files in a directory that matches a certain extension that have been
modified within the past 24 hours.

The way I'm thinking about doing this cycling through all of the files
in the directory, determining whether the extension of the files is .d
and then determing whether performing a -M on the file gets a result
of less than 1 and if it passes all of these tests, it will process
the file.

Any thoughts on whether there's a better way of doing this?  What I'm
basically trying to do is determine what files appear in my logs
directory in the past 24 hours.

Thanks,

Mark






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

Date: Wed, 01 Nov 2000 21:53:57 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: Want to process all files less than 24 hours old
Message-Id: <Vh0M5.1302$q81.288587@news.uswest.net>

Mark Thompson <mark-lists@webstylists.com> elucidates:

> Any thoughts on whether there's a better way of doing this? 

Its a fine way of doing things.  Just ensure you use File::Find when
you do it.

Good Luck!


-- 
"Civilization rests on two things: the discovery that fermentation 
produces alcohol, and the voluntary ability to inhibit defecation.  
And I put it to you, where would this splendid civilization be without 
both?" --Robertson Davies "The Rebel Angels" 


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4786
**************************************


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