[19512] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1707 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 6 21:05:27 2001

Date: Thu, 6 Sep 2001 18:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999824707-v10-i1707@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 6 Sep 2001     Volume: 10 Number: 1707

Today's topics:
    Re: Baiting Gozilla to obtain quality code for nothing! (Tim Hammerquist)
        Bizarre solution <dmartin119@home.com>
        Can't call method "uri"? (Souls Escaped)
    Re: Can't call method "uri"? <tony_curtis32@yahoo.com>
    Re: Can't call method "uri"? <jeff@vpservices.com>
    Re: Compiling Scripts to DOS EXEs <stumo@bigfoot.com>
    Re: Compiling Scripts to DOS EXEs (Damian James)
    Re: Confused (again) over complex data structures. (Abigail)
    Re: How can I determine if a script has write permissio <bart.lateur@skynet.be>
    Re: How can I find the PID's of my children? (Abigail)
    Re: Is PERL supported <bart.lateur@skynet.be>
    Re: Java mucks up split (Trewth Seeker)
        OT: CGI timeout <sh@planetquake.com>
    Re: OT: CGI timeout <bart.lateur@skynet.be>
    Re: Perl Commands Not Working <Juha.Laiho@iki.fi>
        Perl/CGI Script <ctsay81@stanford.edu>
    Re: Permissions - Is nobody better? <bart.lateur@skynet.be>
    Re: Permissions - Is nobody better? (BUCK NAKED1)
    Re: Regular Expression puzzle... (Tad McClellan)
    Re: Rounding a number (Richard J. Rauenzahn)
        Srvany and Windows 2000 <wespog@hotmail.com>
    Re: Statement modifiers?? (Abigail)
    Re: Undef'ing multiple variables (Abigail)
        uploading files using CGI (Arran)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 06 Sep 2001 23:41:55 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Baiting Gozilla to obtain quality code for nothing!!
Message-Id: <slrn9pg357.98a.tim@vegeta.ath.cx>

Me parece que Paul Boardman <peb@bms.umist.ac.uk> dijo:
> Matt Garrish wrote:
> 
> > And all this time I thought he was Don King's hideous love child...
> 
> What's all this 'he' business.  If you'd all been reading as many of
> Kiras posts as you imply I would have thought it obvious that *he* is a
> *she*.

[ snippage ]

 ...or would at least like to be thought of as a girl. We have no proof
that s?he is male, female, stupid, intelligent, human, or otherwise.
All we know is that s?he has a dictionary and a thesaurus...and that now
knows more Perl than s?he used to last year.  ;)

-- 
Our existence deforms the universe.
That's responsibility.
    -- Delirium, The Sandman


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

Date: Thu, 06 Sep 2001 22:23:22 GMT
From: "JerryGarciuh" <dmartin119@home.com>
Subject: Bizarre solution
Message-Id: <uHSl7.160662$oh1.68137915@news2.rdc2.tx.home.com>

Bizarre solution:  I erased the hidden fields and tried check boxes which
failed (initially checked or unchecked)  Then I tried text fields which
worked only if I entered the values not if the were displayed at runtime.
Finally I just erased it all and recoded.  Now it works.
Hope this helps someone in the future.
jg

"JerryGarciuh" <dmartin119@home.com> wrote in message
news:7tQl7.160463$oh1.67993409@news2.rdc2.tx.home.com...
> First off thanks for the response!
> Per the request I am posting the pertinent bits.  I'm trying to be
thorough
> so I have included both versions of the html as well as the Search
> subroutine which uses the vars in question (case and boolean) from the
> script.  I'm sorry if I am clouding the issue:
>
> Ok here is original version of html which works:
>
> <form method=POST action="http://www.mysite.com/cgi-bin/search.pl">
> <center><table border>
> <tr>
> <th>Text to Search For: </th><th><input type=text name="terms"
> size=40><br></th>
> </tr><tr>
> <th>Boolean: <select name="boolean">
> <option>AND
> <option>OR
> </select> </th> <th>Case <select name="case">
> <option>Insensitive
> <option>Sensitive
> </select><br></th>
> </tr><tr>
> <th colspan=2><input type=submit value="Search!"> <input
> type=reset><br></th>
> </tr></table></center></form>
>
> Here is modified version which *works* but never finds anything:
>
> <form method=POST action="http://www.mysite.com/cgi-bin/search.pl">
> <center>
>     Text to Search For:
>     <input type="hidden" name="boolean" value="AND">
>     <input type="hidden" name="case" value="Insensitive ">
>     <input type=text name="terms" size=40>
>     <input type=submit value="Search!" name="submit">
>   </center></form>
>
> And here is the Search subroutine which uses the vars case and boolean:
>
> sub search {
>
>    @terms = split(/\s+/, $FORM{'terms'});
>
>    foreach $FILE (@FILES) {
>
>       open(FILE,"$FILE");
>       @LINES = <FILE>;
>       close(FILE);
>
>       $string = join(' ',@LINES);
>       $string =~ s/\n//g;
>       if ($FORM{'boolean'} eq 'AND') {
>          foreach $term (@terms) {
>             if ($FORM{'case'} eq 'Insensitive') {
>                if (!($string =~ /$term/i)) {
>                   $include{$FILE} = 'no';
>       last;
>                }
>                else {
>                   $include{$FILE} = 'yes';
>                }
>             }
>             elsif ($FORM{'case'} eq 'Sensitive') {
>                if (!($string =~ /$term/)) {
>                   $include{$FILE} = 'no';
>                   last;
>                }
>                else {
>                   $include{$FILE} = 'yes';
>                }
>             }
>          }
>       }
>       elsif ($FORM{'boolean'} eq 'OR') {
>          foreach $term (@terms) {
>             if ($FORM{'case'} eq 'Insensitive') {
>                if ($string =~ /$term/i) {
>                   $include{$FILE} = 'yes';
>                   last;
>                }
>                else {
>                   $include{$FILE} = 'no';
>                }
>             }
>             elsif ($FORM{'case'} eq 'Sensitive') {
>                if ($string =~ /$term/) {
>     $include{$FILE} = 'yes';
>                   last;
>                }
>                else {
>                   $include{$FILE} = 'no';
>                }
>             }
>          }
>       }
>       if ($string =~ /<title>(.*)<\/title>/i) {
>          $titles{$FILE} = "$1";
>       }
>       else {
>          $titles{$FILE} = "$FILE";
>       }
>    }
> }
>
> Thanks very much for your help!
> jg
>
>
>
> ----- Original Message -----
> From: "Chris Fedde" <cfedde@fedde.littleton.co.us>
> Newsgroups: comp.lang.perl.misc
> Sent: Thursday, September 06, 2001 11:09 AM
> Subject: Re: form input changed from Select to hidden, no errors and no
> search results
>
>
> > In article <CBMl7.160097$oh1.67793303@news2.rdc2.tx.home.com>,
> > JerryGarciuh <dmartin119@home.com> wrote:
> > >Hi,
> > >I'm working on modifying a the MSA Simple Search script for my site.
> It's
> > >written in perl.  The bug I have encountered is that when I changed the
> > >boolean and case Select fields into hidden fields the script still runs
> > >without error but returns no results even though the results display
the
> > >vars and they are the same whichever way I do it.  So the script is
> > >receiving the vars, putting them in into the mix but somehow then
> > >eliminating all the results.  I triple checked spelling and case
between
> the
> > >2 setups and they match.
> > >Any suggestions?
> > >TIA
> > >jg
> > >
> >
> > Post a small but complete code segment that exhibits the problem.
> > Maybe then we can see what is going on and make a suggestion.
> > --
> >     This space intentionally left blank
>
>
>




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

Date: Thu, 6 Sep 2001 19:14:03 -0400 (EDT)
From: soulsescape@hotmail.com (Souls Escaped)
Subject: Can't call method "uri"?
Message-Id: <4165-3B98033B-19@bsg-storefull-1112.public.svc.webtv.net>

Has anyone ran into this problem?

[Can't call method "uri" on an undefined value at
/usr/local/lib/perl5/site_perl/5.6.1/HTTP/Response.pm line 173]

How can I fix this problem??

 .Thanks..


=9B
=9B



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

Date: Thu, 06 Sep 2001 18:52:39 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Can't call method "uri"?
Message-Id: <87ae07512w.fsf@limey.hpcc.uh.edu>

>> On Thu, 6 Sep 2001 19:14:03 -0400 (EDT),
>> soulsescape@hotmail.com (Souls Escaped) said:

> Has anyone ran into this problem?  [Can't call method
> "uri" on an undefined value at
> /usr/local/lib/perl5/site_perl/5.6.1/HTTP/Response.pm
> line 173]

> How can I fix this problem??

By solving it.

But it's impossible to anyone here to solve it if you show
noone the code involved.

-- 
Yes way!  Mmmmkay?


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

Date: Thu, 06 Sep 2001 16:51:19 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Can't call method "uri"?
Message-Id: <3B980BF7.A799188@vpservices.com>

Souls Escaped wrote:
> 
> Has anyone ran into this problem?
> 
> [Can't call method "uri" on an undefined value at
> /usr/local/lib/perl5/site_perl/5.6.1/HTTP/Response.pm line 173]
> 

If you try to make a call of the sort $foo->uri and $foo is not defined,
then you will get that error message.  So look at whatever object you
are making the call to uri() with and examine why it didn't get defined
when you think it did.

-- 
Jeff



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

Date: Fri, 7 Sep 2001 00:55:45 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: Compiling Scripts to DOS EXEs
Message-Id: <V%Tl7.8306$235.614388@news6-win.server.ntlworld.com>

Samneric <samneric@tigerriverOMIT-THIS.com> wrote in message
news:MPG.16014a7fa9f3e07f9896ab@news.onemain.com...
> Graham W. Boyes wrote:
> > Reading the usenet archives I've found a lot of folks use Perl2EXE for
> > compiling their scripts.  However my script needs to be run off a
> > Windows 98 boot disk.  Perl2EXE's compiler told me that my script
> > needed to be run under Microsoft Windows.
>
> A boot disk loads an operating system. So what operating system gets loaded
> from a Windows98 boot disk?

MS Dos 7. Microsoft haven't managed to put windows on a floppy.




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

Date: 7 Sep 2001 01:02:30 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Compiling Scripts to DOS EXEs
Message-Id: <slrn9pg71r.lo9.damian@puma.qimr.edu.au>

Graham W. Boyes chose 5 Sep 2001 17:48:29 -0700 to say this:
>...
>Reading the usenet archives I've found a lot of folks use Perl2EXE for
>compiling their scripts.  However my script needs to be run off a
>Windows 98 boot disk.  Perl2EXE's compiler told me that my script
>needed to be run under Microsoft Windows.

If you can get perlcc to work for you (I haven't tried, myself), then you
might have some luck with djgpp (http://www.delorie.com/djgpp), a port of
the gnu tools to 16bit DOS. 

Cheers,
Damian
-- 
@:=grep!(m!$/|#!..$|),split//,<DATA>;@;=0..$#:;while($:=@;){$;=rand
$:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,,
$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/}  __END__
Just another Perl Hacker, ### rev 3.3 -- stupidectomy performed :-)


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

Date: 6 Sep 2001 22:37:23 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Confused (again) over complex data structures.
Message-Id: <slrn9pfukq.jm2.abigail@alexandra.xs4all.nl>

Tassilo von Parseval (Tassilo.Parseval@post.rwth-aachen.de) wrote on
MMCMXXVIII September MCMXCIII in <URL:news:3B97BDA0.4010204@post.rwth-aachen.de>:
}} Stan Brown wrote:
}} 
}} >  foreach (@$records_array_ref)
}} >  {
}} > 	 $stho->execute (@$records_array_ref->[$i++]);
}} >  }
}} > 
}} >  But what is getting put in the DB are the references, not the data.
}} > 
}} >  What am I doing wrong?
}} 
}} Not long ago there was a discussion here whether better to use the 
}} full-blown way of dereferencing a variabile (@{$ref}) or rather the 
}} shortcut (@$ref). In your case these two are not equivalent and you have 
}} to say:
}} 
}} $stho->execute ( @{$records_array_ref->[$i++]} )
}} 
}} Both Uri and Randal in general spoke in favour of the notation with the 
}} curly brackets. The advantage over the shortcut is that this will always 
}} work and you wont accidently run into errors.

Well, in that case, one should also always use

    $ref -> [0] -> {foo} -> [10];

instead of the "shortcut"

    $ref -> [0] {foo} [10];

Or perhaps better, one should always fully parenthesize arithmetic
expressions, and not use "short cuts" by leaving them out. After all,
that's what the pair of braces after the @ is doing: denoting precedence.

}}                                               It's also sort of an 
}} eye-catcher: @{ } indicating: Hey, this is a dereferenced array!

Well, that eye-catcher is giving you the wrong signal then:

    @{$ref}{"foo", "bar"}

No array here; just a hash slice.



Abigail
-- 
perl -Mstrict -we '$_ = "goto K.print chop;\n=rekcaH lreP rehtona tsuJ";K1:eval'


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

Date: Thu, 06 Sep 2001 23:01:39 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How can I determine if a script has write permission in a given directo
Message-Id: <b00gptsc9sk4ervvu1b535aakosc0st4qe@4ax.com>

Stan Brown wrote:

>I need to be able to determine if a target directory exists, and is
>writable by the user runing a script. If it does not exist, it would also
>be nice to see if they have permission to create the given directory.

Try creating the directory. If you can't do it, you'll notice. No it
won't bomb on you, it'll just fail. Check the return value of mkdir().

-- 
	Bart.


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

Date: 6 Sep 2001 22:53:52 GMT
From: abigail@foad.org (Abigail)
Subject: Re: How can I find the PID's of my children?
Message-Id: <slrn9pfvjn.jm2.abigail@alexandra.xs4all.nl>

Stan Brown (stanb@panix.com) wrote on MMCMXXVI September MCMXCIII in
<URL:news:9n39c8$imf$1@panix2.panix.com>:
~~ In <9n37be$m9n$1@artemis.transmeta.com> mcafee@artemis.transmeta.com (Sean McAfee) writes:
~~ 
~~ >In article <9n335p$9hv$1@panix1.panix.com>, Stan Brown <stanb@panix.com> wrote:
~~ >>I'm writing a perlTK script, which will spawn at least one child task to do
~~ >>some long runing processing.
~~ 
~~ >>However, I'm going to leave the user the option of canceling from an "exit"
~~ >>button on the main window. So I need to be able to send a kill() signal to
~~ >>my children.
~~ 
~~ >>Short of making these PID's global variables, when they are spwned, how can
~~ >>I detrmine what children, my runing perl process is the parent of?
~~ 
~~ >What's wrong with keeping track of the PIDs yourself?
~~ 
~~ Thanks for the example code, but I would prefer not to have to clutter
~~ global variable space with yet another array, because of callbacks etc. I
~~ already have _way_ more global data than I normally like.
~~ 
~~ So I was hoping for a function that would allow a perl script to look at
~~ the process table, and determine from there what tasks it is the parrent
~~ of.


You mean that avoiding the use of a variable is a reason for gross
inefficiency and unportability?

If you don't want to use a global variable, by all means, don't:

    {
        my %pids;   # Lexical to this block.

        sub spawn {
            ...
            my $pid = fork;
            ...
            $pids {$pid} = 1 if $pid;
            ...
        }

        sub ragnarok {
            kill 15 => keys %pid;
        }

        $SIG {CHLD} = sub {
            my $pid = wait;
            delete $pids {$pid}
        };

    }


I don't get your remark about not wanting to add another global array
because of callbacks. What do callbacks have to do with it?



Abigail
-- 
use   lib sub {($\) = split /\./ => pop; print $"};
eval "use Just" || eval "use another" || eval "use Perl" || eval "use Hacker";


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

Date: Thu, 06 Sep 2001 22:37:42 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Is PERL supported
Message-Id: <4hufptos0blmjjc0uidrps5t5fb5arngjk@4ax.com>

Prasad, Victor [FITZ:K500:EXCH] wrote:

>Just out of curiosity - is Perl supported - or is it considered free like
>Linux.
>
>At work - everybody agrees with Perl but the complaint is it is not
>supported.  What ever that means.  I think most businesses use it.

Is Microsoft's stuff supported?

Just find a bug in, say, MS Office. That shouldn't be too hard, I've had
cases where I stumbled over a bug within the first five minutes of ever
using such a product. Now ty to get Microsoft to fix it. Just don't hold
your breath. Chances are that years later the bug will still be there.
No, I don't think Microsoft "supports" their products.

-- 
	Bart.


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

Date: 6 Sep 2001 17:55:03 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: Java mucks up split
Message-Id: <d690a633.0109061655.45027ae2@posting.google.com>

Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3B9356CC.5F6B2ABA@earthlink.net>...

> I say, the authors of Java's regexes *did* in fact say that they were
> exactly like Perl's regexes, and that by not, in fact, being exactly
> like Perl's regexes, they are broken.

Well, they didn't say that they are exactly like Perl's, but they
did clearly intend to provide similar functionality.  And in the
case of split, it was clear that they misinterpreted the semantics
of the "limit" argument.  Given that they made such a foolish mistake
and that it had made it this far, I didn't expect them to
see the light without some prodding from the Perl community,
but in fact their evaluation of my bug report is:

   Submitter is correct.

So I apologize to the readers here for taking up your time.
And I apologize for providing an opportunity for Abigail to
display her keenly honed ability to abuse logic and reason
to no particular end.


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

Date: Thu, 06 Sep 2001 22:10:34 GMT
From: "Sean Hamilton" <sh@planetquake.com>
Subject: OT: CGI timeout
Message-Id: <uvSl7.7565$Gi6.811255@news0.telusplanet.net>

Greetings,

I do all Perl testing/debugging running Apache on my Win2k desktop, but have
found that if I accidentally create an infinite loop, I am forced to reboot.

apache -k stop, or apache -k restart doesn't kill the runaway Perl script,
which then consumes as much CPU as it can. When I try to terminate perl.exe
from Task Manager, I get permission errors.

I have found I can run Apache in a window, and Ctrl+C it. But this is an
issue of principle:

- When these scripts finally go to my FreeBSD server, will they have the
same problem? If I've overlooked an infinite loop, will they just run
forever? (I'm not the only one running scripts on this box, so I'm looking
more along the lines of an Apache configuration which will timeout and kill
scripts after some span of time).

- What about all these sites that run Apache on Win2k? How do they handle
this problem?

TiA,

sh




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

Date: Thu, 06 Sep 2001 22:50:23 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: OT: CGI timeout
Message-Id: <c8vfptouatl3gcvtt5p36g4749e10vo7eb@4ax.com>

Sean Hamilton wrote:

>- When these scripts finally go to my FreeBSD server, will they have the
>same problem? If I've overlooked an infinite loop, will they just run
>forever?

Yes. But killing a runaway script from the shell is pretty easy.

> (I'm not the only one running scripts on this box, so I'm looking
>more along the lines of an Apache configuration which will timeout and kill
>scripts after some span of time).

You can always put an alarm() in your script. (Heh! Perl content!) But
not on Windows: alarm() is not implemented on Win32.

-- 
	Bart.


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

Date: 6 Sep 2001 18:31:14 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: Perl Commands Not Working
Message-Id: <9n8fdi$vqm$1@ichaos.ichaos-int>

dennis100@webtv.net (BUCK NAKED1) said:
>Yes, I did error checking. Sorry, I forgot to post the results. I
>learned a long time ago from this group to always use $! to check for
>errors. The errors returned say "Permission Denied" or "Operation Not
>Permitted".

So, something does not match. Either the process is not running
in the directory you think it is, or it is running under a user
ID different than you suspect.

Add the following functionality to your scripts (and have them
output the results to the browser (stdout)) to check.
----
# fragment to check current UID, working directory and CWD permissions
use strict;
use POSIX;
my (@sb,@gl);
my ($uid,$gid,$euid,$egid,$cwd);

$uid=getuid; $gid=getgid; $euid=geteuid; $egid=getegid; $cwd=getcwd;
foreach (getgroups) { push @gl,(getgrgid $_)[0]." (".$_.")"; }

printf "Current UID: %s (%d)<BR>\n",(getpwuid $uid)[0],$uid;
printf "Current EUID: %s (%d)<BR>\n",(getpwuid $euid)[0],$euid;
printf "Current GID: %s (%d)<BR>\n",(getgrgid $gid)[0],$gid;
printf "Current EGID: %s (%d)<BR>\n",(getgrgid $egid)[0],$egid;
printf "Supplementary groups: %s<BR>\n",join ", ",@gl;
printf "Current directory: %s<BR>\n",$cwd;
printf "Permissions of current directory: %04o<BR>\n",
        (@sb=stat($cwd))[2] & 07777;
printf "Owner of current directory: %s (%d)<BR>\n",(getpwuid $sb[4])[0],$sb[4];
printf "Group of current directory: %s (%d)<BR>\n",(getgrgid $sb[5])[0],$sb[5];
----

So, the above will show you in which directory your script is run,
which account/group/supplementary group permissions the script has
when run, and what are the permissions of the directory where the
script is run.
-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ UH++++$ UL++++$ P++@ L+++ E(-) W+$@ N++ !K w !O
         !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h--- r+++ y+++
"...cancel my subscription to the resurrection!" (Jim Morrison)


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

Date: Thu, 6 Sep 2001 16:12:10 -0700
From: Caroline Jacinta Tsay <ctsay81@stanford.edu>
Subject: Perl/CGI Script
Message-Id: <Pine.GSO.4.31.0109061612020.6488-100000@cardinal0.Stanford.EDU>

Hi,

I am able to run a Perl/CGI script from the Windows command line on my
Windows Advanced Server OS.  It uses CGI to get the values from a HTML
form, an$
module to take that information and create a new user using CreateUser().
When I run the script after clicking submit on the web page, the script
won't
create the user.  Does anyone have any idea why?  Is it because I need to
use certain flags in CreateUser? Or because I need to change some paths
for IIS?

Any help would be appreciated.
Thanks!
Caroline





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

Date: Thu, 06 Sep 2001 22:59:13 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Permissions - Is nobody better?
Message-Id: <bfvfpt0bbg3v0rfghhs7l1v316ujgu0psk@4ax.com>

BUCK NAKED1 wrote:

>At other Linux hosts, I was also running as "user" and this script
>worked; but this host says in order for it to work, he'll have to change
>the ownership on that script, and  run it as "nobody". Is this the only
>way to do it? I really don't want to lose the security of running
>scripts as "myself".

Think of CGIwrap. Your server probably doesn't allow running SUID
scripts. So you need a SUID wrapper program in a compiled language.

Intro:	<http://www.iperweb.com/cgiwrap.htm>:

	cgiwrap is a "script wrapper" that lets your scripts execute
	under your own userid and group instead of user nobody and group
	www. 

Home:	<http://cgiwrap.unixtools.org/>

-- 
	Bart.


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

Date: Thu, 6 Sep 2001 19:29:06 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Permissions - Is nobody better?
Message-Id: <17211-3B9814D2-71@storefull-247.iap.bryant.webtv.net>

I'd already reviewed Apache execSUID page; and it didn't look feasible
for my problem. I'm studying CGIwrap now. Thanks for the links.

--Dennis 



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

Date: Thu, 06 Sep 2001 23:04:30 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Regular Expression puzzle...
Message-Id: <slrn9pfon4.666.tadmc@tadmc26.august.net>

Fred <fredcoyoteno@spamgo.com> wrote:
>Laocoon wrote:
>> 
>> 1 while $test =~ s/ ([\w&]\s)/$1/;
>> 
>> Note that the first character in the match is a space and not \s because \s
>> will also match \n (and its shorter).Hope this helps..
>
>ahh... that works very well...
             ^^^^^^^^^^^^^^^


You mean you _want_

   YYYYY X X X

to be transformed to

   YYYYYX X X

??

I don't remember you specifying that behavior...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 6 Sep 2001 23:38:17 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: Rounding a number
Message-Id: <999819496.592695@hpvablab.cup.hp.com>

NOSPAM@mail.ru writes:
>I asked another question  <pj56ntgu7kn27gvorbgudpuk6u8l31m8vq@4ax.com>
>Of course I could find the reply myself, BUT posting it here brought
>really a lot of interesting solutions, that will probably be usefull
>to somebody else !

Ah!  The irony.  How will it be useful to anyone else unless they search
for it?

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: Fri, 07 Sep 2001 00:25:58 GMT
From: "Wes" <wespog@hotmail.com>
Subject: Srvany and Windows 2000
Message-Id: <quUl7.20477$at.3964835@news1.busy1.on.home.com>

Hi,
I'm having trouble installing programs (written in perl) as  services on
Windows 2000.
To be precise I have 6 programs that I want to run as services.

On Windows NT 4.0 they all install and startup fine.  I'm using the srvany
tool that came with the  NT 4.0 resource kit to load them as services.

The problem is with Windows 2000.  I again used the srvany tool to install
them as services.  However, when the computer boots up only two programs
consistently start normally.  They are the same two each time.

Srvany fails to load the other four about 90% of the time.  The other 10% of
the time all services start normally.

I don't know if it's coincidence but the two that consistently start
normally are alphabetically lower on the services list then the 4 that do
not consistently start normally.

Has anyone experienced any similar problems?
Is there any way to get some error reporting from srvany? There are six
instances of srvany running but only two of my six programs are loaded in
memory.  There are no error messages reported to me that I can find.
Thanks





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

Date: 6 Sep 2001 23:26:29 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Statement modifiers??
Message-Id: <slrn9pg1gt.jm2.abigail@alexandra.xs4all.nl>

Malcolm Dew-Jones (yf110@vtn1.victoria.tc.ca) wrote on MMCMXXVII
September MCMXCIII in <URL:news:3b95dcdc@news.victoria.tc.ca>:
:) 
:) If you have a series of 'if $debugging then' statements then you do get
:) runtime overhead, but I was theorizing (based on hazy memory) that by
:) using 'assert(condition)' then you could use a perl sub as the assert
:) because if you define the assert to be a null sub for production use then
:) the entire function call would dissappear due to optimizations and
:) therefore the assert would have no runtime overhead, just like using a
:) "real" macro which expands into nothing.


    use constant DEBUGGING => 0;

    if (DEBUGGING) { ... }

should be optimized away too.



Abigail
-- 
perl -wlpe '}{$_=$.' file  # Count the number of lines.
#    A lark flying over
#    the stream. Two flying ravens.
#    A flying gannet.


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

Date: 6 Sep 2001 22:22:37 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Undef'ing multiple variables
Message-Id: <slrn9pftp4.jm2.abigail@alexandra.xs4all.nl>

H. Merijn Brand (h.m.brand@hccnet.nl) wrote on MMCMXXVIII September
MCMXCIII in <URL:news:Xns911498E44782Merijn@192.0.1.90>:
== abigail@foad.org (Abigail) wrote in 
== news:slrn9pd8ee.hk3.abigail@alexandra.xs4all.nl:
== 
== > An alternative would be to start all the variables you want to undef
== > with a particular letter, say U. No other variables should start with U.
== > Also, the variables should be package variables.
== > 
== > Then you can undefine them using the little known function reset:
== > 
== >      reset "U";
== 
== Which is very errorprone if you (by accident) use a variable that also starts
== with a 'U' but you don't want to reset.

It's the 21st century. People like to live on the edge.

== A much cleaner way to do the same is to use a hash (%U) populated with the 
== variables you want to reset


That's so seventies.



Abigail
-- 
   my $qr =  qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
      $qr =~  s/$qr//g;
print $qr, "\n";


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

Date: 6 Sep 2001 16:05:43 -0700
From: arran.price@datamail.co.nz (Arran)
Subject: uploading files using CGI
Message-Id: <1e288238.0109061505.6468fec@posting.google.com>

Hi all,
Im a little confused in regard how to upload a file.
I have a cgi script that a user will select a file to upload, press
the upload button and the same script will do the actual uploading
(all operation completed within the one script - it displays different
pages dependant on what action button was used).

code extracts:

use CGI qw /:standard :html3/;   #using this
start_html("my page title"),  start_multipart_form,   #starting form
as multipart

print "File to upload: <input type=file name=upfile><br>",
         $Q->submit('Action','Upload'),p;

Im using <input type=file name=upfile>.... because the only
alternative I see in CGI is something along the lines of $Q->filefield
which gives me a text box which is less user friendly than above. I
take it Im not restricted to having to use filefield?

after pressing upload, the script may present another page, when
clicking the appropriate action from here the upload occurs. In order
to keep the value of upfile. Im doing:

   print $Q->hidden('upfile','$MYFILE');
   $MYFILE=param('upfile');

Im wondering if I can do this as Im not sure if I get passed the
filename or more detail ie content, filetype etc(if not how to I
retain it?).

When I want to output the file

   $OUTPUT_FILENAME="/somedir/myfile.here";
   open (OUTPUTFILE,">$OUTPUT_FILENAME") || die $!;
   binmode SAVE;        
   while (read($MYFILE,$DATA,1024)) 
   {
       print OUTPUTFILE $DATA;
   }
 
   close SAVE;

which dosent work due to $MYFILE not being a filehandle (Im assuming).

Ive also tried using cgi-lib to now avail (I can work it from an html
page but dont get anywhere when calling from my cgi script).

someone clue me in?

thanks

Arran
arran.price@datamail.co.nz


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

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 1707
***************************************


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