[14032] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1442 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 20 06:08:45 1999

Date: Sat, 20 Nov 1999 03:05:11 -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: <943095911-v9-i1442@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 20 Nov 1999     Volume: 9 Number: 1442

Today's topics:
        "Genric" cookies: Need help!! <lionel@lionelandre.com>
    Re: "Genric" cookies: Need help!! (Simon Cozens)
    Re: alias a mailer (Fox)
    Re: Can i prevent the user from viewing the source HTML (Bobo)
    Re: Can i prevent the user from viewing the source HTML (Abigail)
    Re: environment vars <uri@sysarch.com>
    Re: file descriptors already used when perl starts (Ilya Zakharevich)
    Re: file descriptors already used when perl starts (Abigail)
    Re: file descriptors already used when perl starts <uri@sysarch.com>
    Re: file descriptors already used when perl starts (Ilya Zakharevich)
    Re: Getting HTML tags via regular expression <gellyfish@gellyfish.com>
        Help - Servlet <moinsharif@yahoo.com>
        Help -Mod-perl Configuration <moinsharif@yahoo.com>
    Re: Is there anyone out there with experience setting u <jarrowwx@NOSPAM.home.com>
    Re: legal names and about sorting <uri@sysarch.com>
        newbie question <bunjonwa@trek.CS.ORST.EDU>
    Re: No Fork in NT Perl and Print to socket (Bart Lateur)
    Re: Perl Programmers Needed. Dallas, Texas USA (experie <bnelson@netcom.com>
    Re: Perl programming sytle (Tad McClellan)
        ping module on IIS4 <plaven@idl.net.au>
    Re: removing unwanted parts of a string... schablone@my-deja.com
    Re: Script Effiency (Tad McClellan)
    Re: Several Perl questions related to speed and memory  <jacks@pobox.com>
    Re: Small scripting question (Tad McClellan)
    Re: Split a input file with perl <huyv@usa.net>
    Re: Testsuite Mac/cgi/perl (jakal)
    Re: Variable expansion in Perl <slanning@bu.edu>
    Re: Variable expansion in Perl? (Tad McClellan)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 20 Nov 1999 06:46:06 +0000
From: Lionel Andre <lionel@lionelandre.com>
Subject: "Genric" cookies: Need help!!
Message-Id: <3835FD5E.3A831FDE@lionelandre.com>

Hi,

I am having a little problem here with using Cookies in a PERL script.
I tried using Cookies.lib from Matt wright, and it doesn't do what I
need (or so it seems)

I am trying to retrieve all the cookies for my domain, along with its
value.  My problem is that there can be one, or more cookies, with about
250 different names.  These cookies have been placed by a JavaScript :

<FORM>
<INPUT TYPE="button" VALUE="set cookie" onClick="document.cookie= '$name
=$value';">
</FORM>

Does any one know of an EASY way of retrieving these cookies using a
PERL script?

I am really stuck here and I really have no clue what to do :(

Any help more than wecome!

Thanks a lot.

Lionel

PS, please, when replying copy my email address. :)




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

Date: 20 Nov 1999 07:10:39 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: "Genric" cookies: Need help!!
Message-Id: <slrn83cibf.l88.simon@othersideofthe.earth.li>

This should be elsewhere. Followup set. (uh, no, they're not, because I
don't carry ciwag. Please respond to comp.infosystems.www.authoring.cgi)

Lionel Andre (comp.lang.perl.misc):
>I tried using Cookies.lib from Matt wright

That would be your first problem.
Matt Wright's `scripts' aren't real Perl, from what I can see.

>Does any one know of an EASY way of retrieving these cookies using a
>PERL script?

The CGI.pm module takes care of all this and more. It's a core Perl
(not PERL) module, so you don't have to download anything - just type
perldoc CGI, and read. :)

>PS, please, when replying copy my email address. :)

No. You asked on USENET, you get replies on USENET.

-- 
"We Americans, we're a simple people... but piss us off, and we'll bomb 
your cities."
-- Robin Williams, _Good Morning Vietnam_
-- 
There seems no plan because it is all plan.
		-- C.S. Lewis


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

Date: Sat, 20 Nov 1999 09:41:30 GMT
From: hry@163.net (Fox)
Subject: Re: alias a mailer
Message-Id: <38376aee.997048@news.bentium.com>

On 20 Nov 1999 02:29:41 GMT, mgjv@wobbie.heliotrope.home (Martien
Verbruggen) wrote:

>On Fri, 19 Nov 1999 22:01:49 GMT,
>	Fox <hry@163.net> wrote:
>> hi all:
>> i got a problem....
>> in my /etc/aliases
>> i definded :
>>=20
>> aaa:|/www/fox/test.pl
>>=20
>> in /www.fox/test.pl i wrote:
>
>That's not the same thing.
then ,how can i  do that ?

>-w, and use strict are considered to be good things.
i can run it in shell ,and no errors ....
so i don't think -W is useful.

>And in the case of potentially multiple access to that output file, you
>should probably also implement locking.
i'll do that latter ,now is in my test system,only 1 user.

>> sh: /www/fox/test.pl: Text file busy
>
>That's an error from sh, not from perl
i know
>> 554 |/www/fox/test.pl... unknown mailer error 126
>That's an error from your MTA, not from perl
where to change to slove this error?

>What happens if you execute the script, feeding it an email message on
>stdin? Have you even tried?
i want to process some mail infomation .



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

Date: 20 Nov 1999 06:55:53 GMT
From: bobo@bobo.com (Bobo)
Subject: Re: Can i prevent the user from viewing the source HTML code by using PERL script ??
Message-Id: <815glp$fo61@imsp212.netvigator.com>


Can u speak more about how does the script can work ?

More, '/usr/local/apache/conf/httpd.conf' is what file ?



In article <814hsr$6ag$1@gellyfish.btinternet.com>, gellyfish@gellyfish.com 
says...
>
>On 19 Nov 1999 19:01:43 GMT Bobo wrote:
>> 
>> Can i prevent the user from viewing the source HTML code by using PERL 
script 
>> ??
>> 
>
>Sure.
>
>#!/usr/bin/perl -w
>
>
>use File::Find;
>
>my $conf_file = '/usr/local/apache/conf/httpd.conf'; # change this to match
>                                                     # your configuration
>
>open(CONF,$conf_file) || die "Cant open $conf_file - $!\n";
>
>my @docdirs;
>
>while(<CONF>)
>{
>  push @docdirs, $1 if /^DocumentRoot\s+(.+)/;
>}
>
>find \&fixdocs, @docdirs;
>
>sub fixdocs
>{
>  unlink if ( -f && /html?$/ );
>}
>
>HTH
>
>/J\
>-- 
>Jonathan Stowe <jns@gellyfish.com>
><http://www.gellyfish.com>
>Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>



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

Date: 20 Nov 1999 03:07:56 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Can i prevent the user from viewing the source HTML code by using PERL script ??
Message-Id: <slrn83cpdm.m2v.abigail@alexandra.delanet.com>

Bobo (bobo@bobo.com) wrote on MMCCLXXI September MCMXCIII in
<URL:news:8146qn$l0k9@imsp212.netvigator.com>:
?? 
?? Can i prevent the user from viewing the source HTML code by using PERL script
??


Easy. I've hidden the solution in this article.
Just do it the same way in your document.



Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 20 Nov 1999 02:36:34 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: environment vars
Message-Id: <x7r9hlpqbh.fsf@home.sysarch.com>

>>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:


  DC> David, yes I am spending lots of time with my four-year-old,
  DC> why do you ask?

i bet s/he is a better perl hacker already then most of our favorite
newbies.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 20 Nov 1999 06:25:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: file descriptors already used when perl starts
Message-Id: <815esl$t1s$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@delanet.com>],
who wrote in article <slrn83c1nm.m2v.abigail@alexandra.delanet.com>:
> $$ Definitely.  Read what I wrote above as fd 0/1/2 being open to /dev/tty.
> 
> /dev/tty is a device. I don't know what you mean with file descriptors
> being open to devices. I don't see anything above where you say anything
> about file descriptors being open to devices either.

Really?!

> perl -wle 'open F, "/dev/tty" or die; print "<<", <F>, ">>"'
xxx

<<xxx

>>

Ilya


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

Date: 20 Nov 1999 01:51:00 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: file descriptors already used when perl starts
Message-Id: <slrn83ckte.m2v.abigail@alexandra.delanet.com>

Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on MMCCLXXII September
MCMXCIII in <URL:news:815esl$t1s$1@charm.magnus.acs.ohio-state.edu>:
&& [A complimentary Cc of this posting was sent to Abigail
&& <abigail@delanet.com>],
&& who wrote in article <slrn83c1nm.m2v.abigail@alexandra.delanet.com>:
&& > $$ Definitely.  Read what I wrote above as fd 0/1/2 being open to /dev/tty.
&& > 
&& > /dev/tty is a device. I don't know what you mean with file descriptors
&& > being open to devices. I don't see anything above where you say anything
&& > about file descriptors being open to devices either.
&& 
&& Really?!
&& 
&& > perl -wle 'open F, "/dev/tty" or die; print "<<", <F>, ">>"'
&& xxx
&& 
&& <<xxx
&& 
&& >>


I'm confused. What do you mean with "opening a file descriptor to a
device"?



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 20 Nov 1999 02:56:27 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: file descriptors already used when perl starts
Message-Id: <x7n1s9ppec.fsf@home.sysarch.com>

>>>>> "MD" == Mark-Jason Dominus <mjd@op.net> writes:

  MD> It really isn't a kernel feature; it's more like a giant conspiracy
  MD> between the programs that allocate terminals, the shells, and the C
  MD> standard I/O library.

and the semantics of dup and exec help as well so there is some kernel
support for this conspiracy. from dup(2):

	The new file descriptor is set to remain  open  across  exec
	functions (see fcntl(2)).

	The file descriptor returned is the lowest one available.

from fcntl:

	F_DUPFD   Return a new file descriptor which is  the  lowest
			numbered  available  (that  is,  not already open)
			file descriptor greater than or equal to the third
			argument,  arg,  taken  as an integer of type int.
			The new file descriptor refers to  the  same  open
			file  description as the original file descriptor,
			and shares any locks. The FD_CLOEXEC flag  associ-
			ated  with  the  new file descriptor is cleared to
			keep the file open across calls to one of the  ex+-
			ec(2) functions.

a telnet or getty can open the pseudo or real tty in itself and fork a
child which closes fd 0, 1 and 2, dups to them the fd pointing to the
device and then closes those high fds. then exec is called to run login
or the shell which will keep 0, 1 and 2 open since they have the
FD_CLOEXEC flag set by the dup. the flag is set on fds 0, 1 and 2 is
inherited by all children of the shell which don't close them and open
new ones (as they woould for pipes and redirections).

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 20 Nov 1999 09:48:22 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: file descriptors already used when perl starts
Message-Id: <815qp6$86u$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@delanet.com>],
who wrote in article <slrn83ckte.m2v.abigail@alexandra.delanet.com>:
> && > perl -wle 'open F, "/dev/tty" or die; print "<<", <F>, ">>"'
> && xxx
> && 
> && <<xxx
> && 
> && >>
> 
> 
> I'm confused. What do you mean with "opening a file descriptor to a
> device"?

I said nothing about a device.  All I said was about opening a fd to a
file, which /dev/tty (more or less) is.  I would think that you can
find details in open(2).  For an example, see the above code, which
opens fileno(F) to/from /dev/tty.

Ilya


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

Date: 19 Nov 1999 23:45:16 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Getting HTML tags via regular expression
Message-Id: <814nec$6ji$1@gellyfish.btinternet.com>

On Fri, 19 Nov 1999 22:11:11 GMT davidairth@my-deja.com wrote:
> I am trying to parse HTML files and get a list of all of the tags,
> pretty simple.  I am using regular expressions and just about have it,
> but I am still getting:
> 
> "<b> blah blah </b> and this too"  <---matches to the end of a line
> 
> I want just a list of all the open and close tags:
> 
> <b>   <---match 1
> </b>  <---match 2
> <TR>
> <TD>
> </TD>
> </TR>
> 
> basically, the parsing doesn't stop when it hits the second > tag:
> 
> I am trying: </?b.+>
> 
> Any ideas?
> 

Yes use HTML::Parser - I have posted a veritable shedload of examples in
the last few weeks.

As you wont show us your code we wont show you ours ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Nov 1999 06:22:18 GMT
From: Moin <moinsharif@yahoo.com>
Subject: Help - Servlet
Message-Id: <815emn$uu0$1@nnrp1.deja.com>



I am able to configure Java servlets without any errors in appache
server. I want to know how to create servlet zone and from where the
java servlets is loaded.
Moin


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


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

Date: Sat, 20 Nov 1999 06:18:54 GMT
From: Moin <moinsharif@yahoo.com>
Subject: Help -Mod-perl Configuration
Message-Id: <815ege$us8$1@nnrp1.deja.com>

Can any one tell me how to configure mod-perl. I have tried it but in
vain. I am able to install mod-perl without any problem,but when I add
the following code in the httpd.conf the appache server does not restart
The error which I get is:
  "Invalid command PerlRequire perhaps misspelt or defined by a module
not included in the server config"

The code which I add in httpd.conf is as follows:
PerlRequire           conf/startup.pl
PerlFreshRestart        On

Alias           /modperl/       /usr/local/apache/htdocs/modperl/


<Location       /modperl>
       SetHandler      perl-script
        PerlHandler     Apache::Registry
        PerlSendHeader  On
        Options         +ExecCGI
</Location>


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


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

Date: Sat, 20 Nov 1999 06:08:50 GMT
From: John Arrowwood <jarrowwx@NOSPAM.home.com>
Subject: Re: Is there anyone out there with experience setting up Microsoft's  Personal Web Server to run perl/CGI scripts?
Message-Id: <38363B0A.A7E3F117@NOSPAM.home.com>

I don't actually KNOW the answer to your problem, in part because I would need
a little more information about what you are doing and how you are doing it.
However, maybe this will help.

I assume you have PWS running, even when you are not connected.  Though I could
be wrong, I have a suspicion that you are trying to run the script by typing
its filename in the browser window, something like this:
c:\InetPub\wwwroot\cgi-bin\perlscript.pl (yes, I know, the path is undoubtably
wrong...)  Unfortunately, though, when you do this, the browser is retrieving
the file directly, rather than processing it through the web server.  SSI's
don't work that way, either, go figure! :)

Try browsing to script through the webserver, like this:

http://localhost/cgi-bin/perlscript.pl

Then, the browser will create a TCP/IP connection through the loopback device
to the webserver in order to request the page, and it will be processed the way
it should be.

Hope that helps!

If that ISN'T the problem, then give us more information about exactly what you
are doing, how it is failing, etc.

Admittedly, this isn't a perl problem, and therefore belongs in a different
forum, but you take your answers where you can get them, right? :)


Raymond Gordon wrote:

> I would like to learn CGI programming with perl and get som practical
> experience too.  I have Windows98 (second edition) and have installed the
> Personal Web Server software which came with it.  The browser being used is
> IE v5.0.  I am not connected to any LAN.  I have internet access via a modem
> and telephone line.  When I choose a link to launch a perl script using the
> CGI module, I get a DOS window with text informing me that the I am working
> offline and requesting me for the input parameters.  This happens whether or
> not  I am connected to the internet.  The Personal Web Server instructions
> for configuring the browser to access a web site not connected to a network
> do not work for IE v/5.0.  I have experimented a couple of days now without
> getting anywhere.  Have not tried anything really drastic which may cause me
> to irrevocably loose my present IE configuration, though, because I still
> need to access the internet on a regular basis.  Would appreciate any help I
> can get.  --raymond



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

Date: 20 Nov 1999 02:59:54 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: legal names and about sorting
Message-Id: <x7k8ndpp8l.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  >> I still claim "sort" shouldn't be in the name. GRT, with the T standing
  >> for transform is my suggestion - it fits with ST.

  LR> That's GReaT!

why are my synapses clogged by the image of tony the tiger introducing
us to some audience.

though i do like the symmetry with the ST. best name so far IMO.

uri


-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sat, 20 Nov 1999 02:34:34 -0800
From: Waranun Bunjongsat <bunjonwa@trek.CS.ORST.EDU>
Subject: newbie question
Message-Id: <Pine.GSO.4.03.9911200227410.26808-100000@trek.CS.ORST.EDU>

Hi,

	I know now that why my DB_File is not working. This is because 
my server do not have the program installed. So, I downloaded the DB_File
from sleepycat. But, I do not know how to use it. I feel that I need
DB_File.pm. But should I put it in my cgi-bin ?? what else I need to do ?
What other file I need ? Do I need to install something ?

-- 
____________________________________________________________________________

Waranun Bunjongsat               tel: 541-343-5970
Graduate Student                 e-mail: bunjonwa@cs.orst.edu
Department of Computer Science   homepage:http://www.cs.orst.edu/~bunjonwa
Oregon State University
____________________________________________________________________________





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

Date: Sat, 20 Nov 1999 09:16:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: No Fork in NT Perl and Print to socket
Message-Id: <383766af.589180@news.skynet.be>

Scott McMahan wrote:

>ActiveState is working on a fork() which
>is based (as I understand it) on the fact Perl is an interpreter that can
>be cloned among Win32 threads so each interpreter instance gets its own,
>independent state walled off from the others. It will be an interpreter
>fork and not an OS fork, if that makes any sense. (I think this is
>a rather extreme case of anything being solvable by another layer of
>indirection -- if you can't fork, copy the whole interpreter. I'm really
>interested to see if it is more or less efficient to fork an interpreter
>than a whole process.)

I thought that fork(), on Unix, made a copy of *everything* in the
process? That way, I can't see much of a difference between the two.
Maybe it's just me. ;-)

-- 
	Bart.


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

Date: 20 Nov 1999 01:16:15 -0600
From: Bob Nelson <bnelson@netcom.com>
Subject: Re: Perl Programmers Needed. Dallas, Texas USA (experienced only)
Message-Id: <815hrv$4n4$1@renpen.nelson.org>

In comp.unix.programmer David Cassell <cassell@mail.cor.epa.gov> wrote:
> Jeff S. Dickson wrote:
>> 
>> Sandbox Studios HR wrote:
> [snip]
>> > We're hiring full-time and part-time Perl programmers for our Dallas
>> > offices.  Experienced programmers only.  Work on different Internet 
> [snip]

>> What's the point of advertising world wide for jobs specific to a
>> particular area?

> Surely you've noticed that all Texans assume everyone else is
> dying to move there.  :-)

 ...and your point is? 


-- 
========================================================================
          Bob Nelson -- Dallas, Texas, USA (bnelson@iname.com)
      http://www.oldradio.com/archives/nelson/open-computing.html
``Those who don't understand UNIX are condemned to reinvent it, poorly.''


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

Date: Fri, 19 Nov 1999 20:24:28 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl programming sytle
Message-Id: <slrn83bu2c.3h5.tadmc@magna.metronet.com>

On 19 Nov 1999 23:22:33 -0000, Jonathan Stowe <gellyfish@gellyfish.com> wrote:

>I started my working career
>making TV adverts for gods sake ... 


   Wow!

   Now that's an impressive client list!


> now look at me ;-}


   I don't want to and you can't make me.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 20 Nov 1999 09:57:31 GMT
From: "Peter Lavender" <plaven@idl.net.au>
Subject: ping module on IIS4
Message-Id: <01bf333d$093a4aa0$0909a8c0@winnie.sspl.net.au>

Hi everyone,

I'm only learning perl, and do it at home on my linux box.  I came across
the ping.pm package and used it to good effect producing a html page
showing me hosts that were reachable and unreachable.

Someone at work requested such a thing, so I got them to get and install
activestate perl on the IIS box.

What I found is the ping module doesn't work under IIS, but works fine when
run from the command prompt.

I suspect that it has something to do with permissions on executing the
ping part of the pm module using the ICMP protocol.  As stated in the pod,
it requires the script to be SUID root to use ICMP.

I have tried taking ownership of the script as Administrator, but this
didn't work either.

Anyone got any suggestions, besides droping the NT box.  :)

Thanks,

Pete.


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

Date: Sat, 20 Nov 1999 09:52:10 GMT
From: schablone@my-deja.com
Subject: Re: removing unwanted parts of a string...
Message-Id: <815r0a$7cj$1@nnrp1.deja.com>

In article <MPG.129e0c7bac74a3ed98a232@nntp.hpl.hp.com>,
  Larry Rosler <lr@hpl.hp.com> wrote:
> In article <8110pi$nnk$1@nnrp1.deja.com> on Thu, 18 Nov 1999 14:00:20
> GMT, schablone@my-deja.com <schablone@my-deja.com> says...
> > In article <MPG.129cc553359a5ae998a226@nntp.hpl.hp.com>,
> >   Larry Rosler <lr@hpl.hp.com> wrote:
>
> ...

>
> > Anyway, enough of this rambling, must get back to my plans for world
> > domination.
> >
> > Many thanks for the reply, I really appreciate all the advice
> > put out on comp.lang.perl.misc and learn a lot just by lurking.
> > Fraid I can't really reciprocate right now, but once I've achieved
> > world power the post of Lord High Perl Monger is yours for the
asking.
>
> Sounds good to me.  I'll (try to) hold you to it, but once you've
> achieved world power I don't know what power I would have.  :-)
>
Well, for a start, you would have full authority to dangle anyone who
confuses "Perl" and "CGI" in a vat of boiling peanut butter.

I'd do it myself only it takes so long to get the vat nice and hot.

Schablonski



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


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

Date: Fri, 19 Nov 1999 20:15:33 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Script Effiency
Message-Id: <slrn83bthl.3h5.tadmc@magna.metronet.com>

On Fri, 19 Nov 1999 18:42:06 GMT, Kragen Sitaker <kragen@dnaco.net> wrote:
>In article <slrn83ae1l.1ug.tadmc@magna.metronet.com>,
>Tad McClellan <tadmc@metronet.com> wrote:
>>On Wed, 17 Nov 1999 17:47:14 -0800, Steven Lybeck <alanis@softhome.net> wrote:
>>>There are a few things that
>>>could be done more efficiently. Like when you are reading the file, you can
>>>take out the entire "while ($person=<ALUMNI>) {}" loop and do exactly the
>>>same thing with "@people = <ALUMNI>;"
>>
>>   1) that is _less_ (memory) efficient, not more efficient.
>
>Can you elucidate?  


   Err, yeah.

   I replied without seeing the original post, so I didn't know
   that code inside of the {} was keeping the entire file
   in memory anyway.

   Sorry folks.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 20 Nov 1999 00:26:32 -0500
From: "Jack Stansbury" <jacks@pobox.com>
Subject: Re: Several Perl questions related to speed and memory use
Message-Id: <383630b9.0@news4.his.com>

Kragen Sitaker wrote in message ...
>Have you benchmarked?

Yes, I did try benchmark after some of you suggested that. I changed the one
pattern to use index and substr instead, because that was a little faster
than the m/XYZZY=([A-Za-z0-9]+) I was using, according to the benchmark.

I've been referring to the text on the Perl CD with the six (?) books on it.
There is a section there that describes things one can do to speed up a Perl
script, and I've been through most if not all of them. With those, I have
been able to speed up the script to process the data lines much faster than
it was. However, I am still concerned about the slowdown in speed as it
processes more files. I understand some of you all's concern about me not
posting my script, but hey, I do like my job! :-)

My main concern was in getting a grip on the memory aspects of the script,
and being able to answer questions like: Am I leaving dangling refs to
memory that I thought I was deleting or undefing? Is the accumulation of
unused-but-not-deleted memory slowing down the script? Exactly what memory
has been allocated but not deleted? Can I dump all of memory that I have
allocated? If Perl has ways to do this kind of analysis, please point me in
that direction.

I am not calling the malloc function, as someone asked me in an e-mail. I
just allocate anonymous hashes and arrays somewhat like this:

my %Table;

$Table{$key) = $ref1 = [];
$ref1->[0] = $value1;
$ref1->[1] = $value2;
$ref1->[2] = $ref2 = [];
$ref2->[0] = [ @fields ];

and so forth. In the script, the hash entry points to an array A of 5
entries. The last entry in the array A is a ref pointing to an array B of 4
entries. Each entry in the array B is a ref pointing to an array C of 6
entries. If I do a delete %Table{$key}, I hope that is deleting all the
arrays involved in that hash entry.

Thanks for all the great responses! It's been fun learning this language!

Jack Stansbury
jacks@pobox.com







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

Date: Fri, 19 Nov 1999 21:03:56 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Small scripting question
Message-Id: <slrn83c0cc.3ia.tadmc@magna.metronet.com>

On Sat, 20 Nov 1999 04:16:18 GMT, Cissy Hartley 
   <cissy@writerspace.removethis.com> wrote:

>I need a piece of script that would take the $VALUE{'PICTURES'}
>(0380803291.gif), strip off the '.gif' and create another
>$VALUE{'ISBN'} (0380803291)


      ($VALUE{ISBN} = $VALUE{PICTURES}) =~ s/\.gif$//i;

   perldoc perlre


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 20 Nov 1999 01:34:37 -0500
From: "Huy Vu" <huyv@usa.net>
Subject: Re: Split a input file with perl
Message-Id: <NgrZ3.4590$MM.151414@newscontent-01.sprint.ca>

I have to find out to eliminate them before writting to a file

Thanks.

Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:3833cb91_2@newsread3.dircon.co.uk...
> Huy Vu <huyv@usa.net> wrote:
> > Hi all,
> >
> > I have a file with a format as below:
> >
> > ^R
> >                            AAAAAA   BBBBBbb  CCCCCCCc
> >
> > PARAGRAPH   #1
> >
> > ^O1234     Testing        54.0
>
> I'm not quite clear what you mean - do you mean that you want to save all
> the lines that begin with a a ctrl-O,  I think your data might have got
> garbled up in usenet somewhere
>
> /J\
> --
> "Report accuses Royal Opera House of 'arrogance and elitism'. Report
> further alleges that Pope is Catholic. Report further claims that bears
> may well indeed defecate in the woods" - Private Eye




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

Date: Sat, 20 Nov 1999 16:00:26 +1030
From: jakem@camtech.net.au (jakal)
Subject: Re: Testsuite Mac/cgi/perl
Message-Id: <jakem-2011991600260001@dialup-sa-1-173.uni.camtech.net.au>


> In article <1e1j9zc.13rpxbq1dmrrbcN@p3e9eb8ac.dip.t-dialin.net>,
> Hado Hein <Hado.Hein@gmx.net> wrote:

>I have (handy) NetPresenz with cgi on , but it does not work. I also
>have downloaded MacPerl.
>But what need I to do with the cgi's and pl's.
>Do I need to compile them before NetPresenz can run them ?
> 

I am not familiar with NetPresenz, but I use WebStar (a web server) and
MacPerl on a Macintosh.

You need to save the Perl scripts as CGI scripts. Choose 'save as' from
within MacPerl. Webstar requires the scripts to have a .acgi extensions,
NetPresenz may do the same.

Hope this helps,

Jake

-- 
jakem@camtech.net.au


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

Date: 20 Nov 1999 03:26:54 -0500
From: Scott Lanning <slanning@bu.edu>
Subject: Re: Variable expansion in Perl
Message-Id: <kus66yxsh4h.fsf@strange.bu.edu>

limbostar@my-deja.com writes:
> $line =~ s-$pattern-$replace-g;
> 
> I've deduced by logic that the $1 is not being
> expanded because it's in another variable.

try sticking on a couple 'e's, like 's///eeg'.
perldoc perlop, look for "s/PATTERN/REPLACEMENT/egimosx",
there is an example of it.

-- 
"I'm going to have fun telling you about this absurdity, because I
find it delightful." --Richard Feynman


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

Date: Fri, 19 Nov 1999 21:29:57 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Variable expansion in Perl?
Message-Id: <slrn83c1t5.3ia.tadmc@magna.metronet.com>

On Sat, 20 Nov 1999 04:25:00 GMT, limbostar@my-deja.com 
   <limbostar@my-deja.com> wrote:
   
>The situation is this:  I am reading from a text
>file various patterns and replacements which act on
>a body of text.  For example, I might have two
>lines in the file:
>
>\*\*([^\*]*)\*\*
><b>$1</b>
>
>These are both regexps that change anything **
>within double asterisks** into <b>html boldface</b>
>..
>
>The problem is - it doesn't work.  I mean, it works
>fine if I have the strings quoted as literals, but
>since i'm reading them in from a file, they're
>inside variables themselves, so I wind up with an
>HTML bolded $1, and the pattern be damned.


>The s///g construct looks like:
>
>$line =~ s-$pattern-$replace-g;
>
>I've deduced by logic that the $1 is not being
>expanded because it's in another variable.


   Correct.

   You only get one level of variable interpolation.


>There's got to be a way to do this, but I can't
>figure it out.
>
>Can anyone help me?


   $replace = qq/"$replace"/;  # wrap it in double quotes for the
                               # second round of evaluation.
                               # or include the quotes in your file
   s/$pattern/$replace/gee;


>I'd appreciate personal replies, 


   That is too selfish.

   There might be somebody else here who wants to know the
   answer too.

   Ask it here, get the answer here.


> because I'm
>obviously not a regular...


   You should fix that.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

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


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