[8483] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2100 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 14 19:07:33 1998

Date: Sat, 14 Mar 98 16:00:24 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 14 Mar 1998     Volume: 8 Number: 2100

Today's topics:
    Re: (NT) Which command processor gets used for "system" (Vincent Fatica)
        arp <jrifkin@nih.gov>
    Re: arp <chasecreek.systemhouse@usa.net>
    Re: arp (I R A Aggie)
        calculating distance between strings (fortune cookies) (Simon Oosthoek)
    Re: Is there a "Newsgroup" for Newbies to Perl? <stackhou@execpc.com>
    Re: ls -l to an array and pull 3 columns on data <justinb@cray.com>
    Re: mkdir won't work... (I R A Aggie)
    Re: Oraperl and CGI - Does it work? <justinb@cray.com>
    Re: Ordering Numbers <joegottman@nospam.worldnet.att.net>
        Perl guru required for scripting job <Nick.Jones@btinternet.com>
    Re: Perl4 vs Perl 5 <chasecreek.systemhouse@usa.net>
    Re: Perl4 vs Perl 5 (I R A Aggie)
    Re: Perl4 vs Perl 5 (Mike Stok)
    Re: Perl4 vs Perl 5 (Matt Elrod)
    Re: Perl4 vs Perl 5 <chasecreek.systemhouse@usa.net>
        Reading excel files under Unix <nelson24@insight.att.com>
    Re: Redirecting to a script on another server. <G.S.Cooper@iti.salford.ac.uk>
        self 'seek'ing script <danboo@negia.net>
    Re: self 'seek'ing script <chasecreek.systemhouse@usa.net>
        Single logons <dave.leather@btinternet.com>
        sockets <msbritt@us.itd.umich.edu>
        threads stvhoof@netvision.net.il
    Re: threads <chasecreek.systemhouse@usa.net>
    Re: Where can I get the PERL for Windows NT and 95? <hgg@techsoftdesign.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 14 Mar 1998 19:56:49 GMT
From: vefatica@syr.edu (Vincent Fatica)
Subject: Re: (NT) Which command processor gets used for "system"?
Message-Id: <350ade7f.96354690@news.ican.net>

On Sat, 14 Mar 1998 16:32:41 GMT, vefatica@syr.edu (Vincent Fatica) wrote:

>I have installed both the ActiveState (5.003) and the Standard (5.004) versions
>of PERL. I generally use the 4NT.EXE or TCSH.EXE command processor and I have
>%COMSPEC% set to 4NT.EXE. PERL 5.003 appeaers to use %COMSPEC% for "system"
>calls while 5.004 seems to use the NT default of CMD.EXE (see below for results
>I get under any command processor). Is this actually the case, and do I have any
>control over which command processor is used by the Standard version (5.004),
>for example with an environment variable?

Found it (after considerable grepping). For the benefit of others:

Standard (5.004) will use the command interpreter specified in the NT
environment variable %PERL5SHELL, if set, and apparently, CMD.EXE otherwise.

ActiveWare (5.003) will use the data in the registry (string) value "COMSPEC" in
the key:

	HKEY_LOCAL_MACHINE\Software\ActiveWare\Perl5

if set, and (apparently) the value of the environment variable %COMSPEC
otherwise.

 - Vince
___
   Vincent Fatica
   Syracuse University Mathematics
   vefatica@syr.edu
   http://barnyard.syr.edu/~vefatica/


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

Date: Sat, 14 Mar 1998 15:15:36 -0500
From: Jed Rifkin <jrifkin@nih.gov>
Subject: arp
Message-Id: <350AE568.72E62484@nih.gov>

Anybody have any examples of how to do an arp in perl?

I'm trying to cleanup a duplicate IP address mess, so I need to be able
to arp for an address and then get back the replies to check for
duplicate IP addresses. Pointers to ICMP ping would also be a help.

Thanks,
Jed Rifkin
jrifkin@nih.gov





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

Date: Sat, 14 Mar 1998 20:46:34 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
To: rifkinj@pop.nci.nih.gov
Subject: Re: arp
Message-Id: <350AEB5B.86ACADB8@usa.net>

Mailed and Posted:

One of these modules may help you -
http://reference.perl.com/query.cgi?net+index

/^HTH$/
Sneex



Jed Rifkin wrote:

> Anybody have any examples of how to do an arp in perl?
>
> I'm trying to cleanup a duplicate IP address mess, so I need to be able
> to arp for an address and then get back the replies to check for
> duplicate IP addresses. Pointers to ICMP ping would also be a help.
>
> Thanks,
> Jed Rifkin
> jrifkin@nih.gov





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

Date: Sat, 14 Mar 1998 16:51:57 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: arp
Message-Id: <fl_aggie-1403981651570001@aggie.coaps.fsu.edu>

In article <350AE568.72E62484@nih.gov>, rifkinj@pop.nci.nih.gov wrote:

+ Anybody have any examples of how to do an arp in perl?

@results=`arp -a`; # :)

+ Pointers to ICMP ping would also be a help.

Get the netlib modules from CPAN:

use Net::Ping;
$p = Net::Ping->new();
print "$host is alive.\n" if $p->ping($host);
$p->close();

for example...

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: 14 Mar 1998 22:46:34 GMT
From: s.oosthoek@student.utwente.nl (Simon Oosthoek)
Subject: calculating distance between strings (fortune cookies)
Message-Id: <6ef1ca$85n$1@dinkel.civ.utwente.nl>

Hi,

I'm looking for a program/script/whatever that can calculate the distance 
between two text-strings. By distance I mean that I want to find strings that 
human beings can identify as "the same", but a computer would not directly 
consider equal in the sense: ($StrX eq $StrY) 

the reason I want this is that I have a lot of fortune cookie files, from 
which I want to create a canonical collection. I don't consider my time 
invaluable enough (or my life long enough) to process the 20 MB or so by 
hand.

I was hoping that somebody might have thought of a way to do this already, so 
I won't have to do it myself. 
I have considered the module String::Approx, but I don't think that that will 
be enough, because I'd rather have a metric for a string that I can compare 
to other metrics (without using the string again).

maybe there is even a program to canonicalise (sp?) fortune cookie 
collections I don't know about????

any help is greatly appreciated!

Simon.



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

Date: Sat, 14 Mar 1998 11:08:55 -0600
From: Mark Stackhouse <stackhou@execpc.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6eedr2$b6m@newsops.execpc.com>

> Ahhhh! The satisfaction of a well laid snare!!!  Now would the experts in
> this Newsgroup please explain the difference between the following clips?
> (a fair percentage of the "Experts" took this one "hook, line, and
> sinker!)



> Newbie to Expert:

> > There are pleanty of mentors at the University.  They get paid, and
>                ^
> With all your education, I'd think you could at LEAST spell, or learn
> how to use a spell checker.  The word is "plenty" not "pleanty".

> > his ragged appearence manages to avoid all of the legitimate channels
>                   ^ "appearance" ;-)

Expert to Newbie: (same expert BTW)

But first get yourself a grammar and a spelling book; you really need
it.  It's ok to be a little lazy at the keyboard within the confines
of the social etiquette applicible to your audience, but taken to your
extreme it's simply insulting and annoying.  Express yourself in an
intelligent and respectful manner and you're liable to fool folks into
believing that you actually are intelligent and deserving of respect.
This lesson in life is probably off topic here, but so was your
request for information, so deal with it.

Answer:

Absolutely NOTHING!  Except that the "Expert" gets off "scott free" and the
"Newbie" gets flamed, brow beaten,
and brain bashed in hopes he will leave and never come back.  I can only
imagine how many timid freshmen, inexperienced NET users, and frustrated 55
year old engineers who have chalked this "resource" off as simply a bad
experience!  They have left with foul tastes in there mouths, never to be
heard from again.  A real fine way to promote the expansion of Perl!

Take a few minutes and query the posts here using the words Newbie, Help and
Please.  Read the posts and there
respective replies.  Why do some of you insist on intimidating these
posters?  How dare you judge someone's worth
or initiative by the way they "phrase" a question.

I'm also amazed that some people here think that everyone has years of
experience "cruising around" on the NET.  Not everyone can go "clickety
clickety click" and find exactly what they are looking for.  Very few can
speed read
documentation and technical manuals and absorb much of anything.  To expect
a beginner to digest code like:

    s/^\\$a/\x\\$a/g;

without so much as an explanation is not only absurd, it's down right rude.
Re: the argument for comp.lang.perl.intro, comp.lang.perl.intermediate, and
comp.lang.perl.advanced.  The Experts who haven't "burned out" will continue
to assist the Newbies, the Newbies will advance to "Intermediates", the
"Intermediates" will help each other, and the "burned out Experts" can have
a chunk of band width all to themselves (which seems to be what you want
anyway).

A few "hackles" have been raised the last couple of days... exactly my
intention.  The subject of curt replies to those
genuinely seeking advice needed to be addressed.  To those who had the
courage to back some of my opinions, I salute you.  To those who have
offered us usable assistance... a heartfelt THANK YOU!  And for the "burn
outs"... take a break!  Go do something else for awhile (unless your whole
world is Perl).  No one is forcing you to read and address every post here.
Newbies will learn and advance... they won't need your help for long... a
new crop of Newbies is sure to follow.  If you can't accept that, then we
really DO need to split this group up.

One last thought... when you were first learning how to ride a bike, did you
do it ALL ON YOUR OWN, or did someone hang on to the back of the seat for
awhile?  Newbies just need a little help... until they learn how to balance
on there own!
--
Mark  Stackhouse

***********************************************************************

homepage: http://www.execpc.com/~stackhou

"The best things in life aren't things."
--Art Buchwald

***********************************************************************




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

Date: 14 Mar 1998 13:53:46 -0600
From: Justin Banks <justinb@cray.com>
Subject: Re: ls -l to an array and pull 3 columns on data
Message-Id: <o8nu3912gmt.fsf@ebony.cray.com>

collin@rogowski.de (Collin Rogowski) writes:

> On Fri, 13 Mar 1998 08:01:30 -0600, grindrod@tfn.com wrote:
> 
> @files = `ls -l`;
> foreach (@files) {
>   @rows = split/\s/$_/9;
>   print $rows[0]; print $rows[5]; #...
> }

Filenames can contain spaces, though, can't they? I think the readdir 
and stat recommendation was a better idea (not to mention your example
isn't correct).

-justinb

--
Justin Banks     \ if the answer is the same whether you're programming 
Silicon Graphics \ in Perl, C, or Visual Modula 17++ with JavaBeans and 
Eagan, Minnesota \ Digital Satellite TV Support, it's not a Perl question.
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc 


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

Date: Sat, 14 Mar 1998 15:09:09 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: mkdir won't work...
Message-Id: <fl_aggie-1403981509090001@aggie.coaps.fsu.edu>

In article <350AC4A0.2BC84984@rtweb.net>, Randall Stephenson
<tjbtech@rtweb.net> wrote:

+ I have tried both commands such as `mkdir [dir]` and mkdir($dir,0777),

mkdir($dir,0777) || die $!;

I suspect that whomever is running the script can not make a directory
where you want it to...

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: 14 Mar 1998 14:11:52 -0600
From: Justin Banks <justinb@cray.com>
Subject: Re: Oraperl and CGI - Does it work?
Message-Id: <o8nra452fsn.fsf@ebony.cray.com>

chris_talley@ple.af.mil writes:

> Hello all!
> 
> Before I embark on this escapade I wanted to see if it will actually work.  I
> recently tried to write a script with Tcl/Oratcl that will work in a cgi-bin,
> it failed misserabely.  Now I am planning on trying to do it with
> Perl/Oraperl, however I don't want to waste my time if it won't work.  I
> looked into DBD::Oracle but it requires Oracle 7 which we won't be migrating
> to for a couple months, I know, we're behind the times.
> 
> What all this boils down to is will Oraperl work in a cgi-bin environment?

Yes. Those that come later, though, will wish your management had
been more up to date, though, so you could have 

use CGI;
use DBI;
 ...

(they'll have to do the conversion, and it won't be fun.)

-justinb

-- 
Justin Banks     \ if the answer is the same whether you're programming 
Silicon Graphics \ in Perl, C, or Visual Modula 17++ with JavaBeans and 
Eagan, Minnesota \ Digital Satellite TV Support, it's not a Perl question.
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc 


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

Date: Sat, 14 Mar 1998 18:25:13 -0500
From: Joe Gottman <joegottman@nospam.worldnet.att.net>
Subject: Re: Ordering Numbers
Message-Id: <6ef3pn$r78@bgtnsc02.worldnet.att.net>



Jesse Rosenberger wrote:

> How could you have perl take a set of numbers (1,2,3,4) and put them
> into a random order???
>

   Try the following:
   $random{'1'} = $random{'2'} = $random{'3'} = $random{'4'}= ''; # Note
the braces.
   @random =  keys %random;

According to the FAQ, the keys of a hash appear in seemingly random
order.

--
Joe Gottman
joegottman@nospam.worldnet.att.net

[Remove nospam to reply]




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

Date: 14 Mar 1998 21:19:36 GMT
From: "Nicholas Jones" <Nick.Jones@btinternet.com>
Subject: Perl guru required for scripting job
Message-Id: <01bd4f8f$e2b56be0$b42e63c3@genie>

I need a perl guru to script an automatic system for adding names to
primary DNS and sending secondary requests off via PGP-encrypted email.
e.g.

"add fred.com" to add one name or 
"add < longlist"

pgp 2.6.3 - can run on my Linux box or yours.





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

Date: Sat, 14 Mar 1998 20:23:59 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Perl4 vs Perl 5
Message-Id: <350AE60E.222E33CD@usa.net>

OK, we'll keep it in the newsgroup.

Matt Elrod wrote:

> Sneex <chasecreek.systemhouse@usa.net> wrote:
> }Mailed & Potsed:
> }
> }Obviously.
>
> Redundantly.
>
> }Also obviously pointing out that no matter how SECURE you say it is, if you
> }have just one user on it and Perl 4, whether that user means to or not Perl
> }4 will come out to BITE them - hard. Is that a good reason?
>
> No.  It is about as useless as advising someone to search Dejanews only to
> turn up dozens of postings, containing your keywords, advising people to
> search Dejanews.

Just because you can't search DejaNews doesn't mean it's not good advice;or
would you rather keep REPOSTING all previous answers until this
NG is as about as useful as alt.warz or alt.binaries?

> Having never been bitten, perhaps Ian and I, and dozens of intimidated
> lurkers, would benefit from a more complete explanation of what makes Perl4
> less secure than Perl5.
>

Fair enough - A search of DejaNews would turn up, with zillions ofother things -
the fact that Perl prior to Perl 5.003 has a security-
related bug in it where a person without knowing can over flow a buffer
and gain root access to the system while the program is running...

OK?  (Anyone care to correct me?)  And no, I am not trying to
intimidate you or anyone else; when I jokingly asked for an account
I am simply referring the readers attention to the fact that the security
problem doesn't have to come from 'outside' and it doesn't have to
be malicious (did I spelt that right?)

> Note that Ian did not explain whether or not his project was being
> developed for a system connected to the net or a network.
>

Doesn't matter, if a user is on that system (notice I didn'tsay whether it was a
real perl programmer or just a
casual tinker-type user) Perl 4 is an accident waiting
to happen.  I am not saying don't use it, but be aware
of the risk, unnecessary IHMO, you are taking.

Have plenty of backups.  The problem isn't whether I
break into your system  but how badly you break
your own system (and no, I am not speaking of you per se,
I am referring to those other 'lurkers' reading this thread
and wondering how safe can safe be.)  Well, I have been
around computers in one shape or another for a long time
and I still make mistakes, we all do.  If anyone can say they
don't they aren't doing anything.

> Matt

 /^Not Fighting$/,
Sneex :)



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

Date: Sat, 14 Mar 1998 15:34:41 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl4 vs Perl 5
Message-Id: <fl_aggie-1403981534410001@aggie.coaps.fsu.edu>

In article <witC10kbM8jH092yn@islandnet.com>, creator@islandnet.com (Matt
Elrod) wrote:

+ Having never been bitten, perhaps Ian and I, and dozens of intimidated
+ lurkers, would benefit from a more complete explanation of what makes Perl4
+ less secure than Perl5.

Go lookup the CERT notifications. Perhaps:

<url:http://www.cert.org/pub/advisories/CA-97.17.sperl.html>

Quote: Note that Perl4 is no longer supported.

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: 14 Mar 1998 21:11:16 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Perl4 vs Perl 5
Message-Id: <6eerpk$1bf@news-central.tiac.net>

In article <witC10kbM8jH092yn@islandnet.com>,
Matt Elrod <creator@islandnet.com> wrote:

>Having never been bitten, perhaps Ian and I, and dozens of intimidated
>lurkers, would benefit from a more complete explanation of what makes Perl4
>less secure than Perl5.
>
>Note that Ian did not explain whether or not his project was being
>developed for a system connected to the net or a network.

There are some documented buffer overruns and quite probably the mktmp
race all of which can make perl (especially if it's run suid to a powerful
user) one place to try cracking a system.

One benefit I see to perl 4 is that is is no longer being developed (the
down side being that it's not supported that actively either).  This makes
it very stable.  So it might be possible to spend more time doing "real"
work than upgrading from 5.00x_xx to 5.00y.zz, figuring out where all the
new warnings came from, whether modules need re-installing, re-compiling
etc.  Perl 4.036 is pretty useful as a super-shell - I know a site which
use it for post-processing data on DOS systems and 5 year old code still
seems to work just fine on a 5 year old interpreter.  For small to
medium/small projects it is possible to write lucid and maintainable code
if you have a little self discipline. 

"A Perl 5 system" is a more complex beast to install, as the number of
modules you probably want to end up adding to get a useful system means
tracking both core perl version and module versions - recent perl 5
distributions *aren't* a problem to build and install, you just seem to
end up with more bits & pieces on ths system.  Perl 5 does have CPAN and
offers support for OO programming and is easier to extend and use for
larger projects.

In my opinion the change in technical and "spiritual" atmosphere between
perl 4 and 5 can be guaged by comparing the first and second editions of
Programming Perl.

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 14 Mar 1998 15:34:14 -0800
From: creator@islandnet.com (Matt Elrod)
Subject: Re: Perl4 vs Perl 5
Message-Id: <KpwC10kbMI4N092yn@islandnet.com>

Sneex <chasecreek.systemhouse@usa.net> wrote:

}Just because you can't search DejaNews doesn't mean it's not good advice;

I am quite capable of searching Dejanews and it is good advice, however,
it is good advice that I have read countless times in this newsgroup
and every time it is given, yet another message is archived in Dejanews
containing nothing but this pearl of wisdom and a question containing
the very keywords clueless but motivated newbies are looking for.

}would you rather keep REPOSTING all previous answers until this
}NG is as about as useful as alt.warz or alt.binaries?

For every FAQ, there are 5 RTFM responses. For every clueless newbie who
works up the courage to ask a FAQ, there are a dozen cowards lurking
around hoping some guru will post the answer with, perhaps, some sample
code they can reverse engineer or paste into their scripts.

Wouldn't the group, and Dejanews, be more useful if for every FAQ, someone
reposted a single well written, if repetitive answer? It is the nature of
Usenet that people come and go and the same questions get frequently
asked.

}I am not saying don't use it, but be aware of the risk, unnecessary IHMO,
}you are taking.

More good advice but not as good as ...

}Go lookup the CERT notifications. Perhaps:
}
}<url:http://www.cert.org/pub/advisories/CA-97.17.sperl.html>

Thanks.

 perl -v

 This is perl, version 4.0

 $RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
 Patch level: 36
 + suidperl security patch

So, having determined that you have the suid security patch, is there any
reason not to use Perl4 for simple projects that do not require the full
functionality of Perl5?

}Quote: Note that Perl4 is no longer supported.

True.  But this isn't that important if you don't require support.

Mike added:

}Perl 4.036 is pretty useful as a super-shell - I know a site which use it
}for post-processing data on DOS systems and 5 year old code still seems to
}work just fine on a 5 year old interpreter.

Indeed. Thanks for your comprehensive explanation of the pros and cons
snipped for brevity.

I think Ian's question has now been answered. If you are writing a complex
script that might benefit from, or require, the added power and support of
Perl5, use Perl5.

If you are writing print "Hello World"; a patched version of Perl4 is
faster, uses less system overhead, (an important consideration if your
site gets a lot of traffic), and quite adequate.

Matt  "But let your communication be Yea, yea; nay, nay: for whatsoever is
      more than these cometh of evil." -- Matthew 5:37


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

Date: Sat, 14 Mar 1998 23:51:45 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Perl4 vs Perl 5
Message-Id: <350B16C2.FC228EA7@usa.net>

Since you had to jump into the Bible for this last one I will surrender :)

All of your comments are well taken.  So what  I will do is what many others
are doing now - ignoring this group and nothing will be posted.  Since I feel
like the enemy now, I will go.

As I am sure no one will miss me nothing is lost...  I guess I will remove any
thoughts from my head of creating a 'newbies Newbies area on my server at
webmaster.fccj.org...

I bow to your superior intellect :)

/^Poof Gone Forever$/
Sneex   : (


Matt Elrod wrote:

> Matt  "But let your communication be Yea, yea; nay, nay: for whatsoever is
>       more than these cometh of evil." -- Matthew 5:37





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

Date: Sat, 14 Mar 1998 18:26:58 -0500
From: "Tom" <nelson24@insight.att.com>
Subject: Reading excel files under Unix
Message-Id: <6ef3n5$ra5@newshub.netnews.att.com>

I am looking for a module or any information that may be helpful
for reading MS excel files with perl on Unix systems.

Thanks in advance
Tom





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

Date: Sat, 14 Mar 1998 21:47:41 +0000
From: Grahame S Cooper <G.S.Cooper@iti.salford.ac.uk>
Subject: Re: Redirecting to a script on another server.
Message-Id: <350AFAFD.FB8DBED@iti.salford.ac.uk>



Sneex wrote:

> Hmmm  Was it the Capital L in
> print "Location: blah blah blah \n\n";

No, that doesn't seem to cause a problem. It was the '&' where
there should have been a '?'.

Thanks for the assistance,

Grahame

>
>
> Just curious :)
> Sneex
>
> Grahame S Cooper wrote:
>
> > Please accept my most humble apologies. I have just picked up
> > my jacket from the dry cleaners' and lo and behold, my brain
> > was in the pocket all the time!
> >
> > I have seen the silly error now and everything works fine.
> >
> > Cheers,
> >
> > Grahame
> >
> > Sneex wrote:
> >
> > > Off topic, see CGI-related ng:
> > >
> > > However, I have several security scripts
> > > which like to play tennis with each other; so
> > > if you could post some code of how you
> > > are trying this maybe we could point
> > > out something.
> > >
> > > The short answer is it works for me,
> > > what are you doing wrong or otherwise?
> > >
> > > Could be a firewall issue, or any number of
> > > other things...
> > >
> > > HTH,
> > > Sneex :)
> > >
> > > Grahame S Cooper wrote:
> > >
> > > > This could be a Perl question or a CGI question.
> > > > Apologies if it is off topic.
> > > >
> > > > I want to redirect from a Perl CGI script to another one
> > > > on a different server.
> > > >
> > > > I have tried using the Location: directive, but it
> > > > doesn't seem to work for this purpose, and I can't see
> > > > how I would specify whether to use PUT or GET, etc.
> > > >
> > > > Has anyone done this themselves and have a quick answer?
> > > >
> > > > Cheers
> > > >
> > > > --
> > > > --------------------------------------------------
> > > > Dr Grahame S Cooper
> > > > Director
> > > > Information Technology Institute
> > > > University of Salford
> > > > Salford, M5 4WT, ENGLAND
> > > >
> > > > (Remove the anti spam field to EMail me.)
> > > > ==================================================
> >
> > --
> > --------------------------------------------------
> > Dr Grahame S Cooper
> > Director
> > Information Technology Institute
> > University of Salford
> > Salford, M5 4WT, ENGLAND
> >
> > (Remove the anti spam field to EMail me.)
> > ==================================================



--
--------------------------------------------------
Dr Grahame S Cooper
Director
Information Technology Institute
University of Salford
Salford, M5 4WT, ENGLAND

(Remove the anti spam field to EMail me.)
==================================================




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

Date: Sat, 14 Mar 1998 13:07:48 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: self 'seek'ing script
Message-Id: <350AC774.DF13A0B@negia.net>

ok, lately i have seen several examples of scripts which 'open' and
read themselves using the idiom:

open(SELF, $0) || die $!;
@lines = <SELF>;

this seems to work just fine, but are there risks invlolved due to the
nature of $0?

it has always been my practice to use 'seek' instead:

seek DATA,0,0;
@lines = <DATA>;
__END__

my question is - aside from the odd behavior of this, which i pointed out
in my 'less than popular' stumper a couple of weeks ago - does this have
inherent pifalls?

admittedly these techniques would typically be used once in a script,
but my simple benchmark shows that seek is considerably faster:

#!/usr/bin/perl -w
use Benchmark;
timethese (10000, {
  'open' => 'open SELF, $0; @lines = <SELF>;',
  'seek' => 'seek DATA,0,0; @lines = <DATA>;',
});
__END__
 

Benchmark: timing 10000 iterations of open, seek...
      open:  7 secs ( 6.29 usr  0.00 sys =  6.29 cpu)
      seek:  2 secs ( 1.72 usr  0.00 sys =  1.72 cpu)

it also let's you do some fun obfuscations, since it seems to me that
most people expect this to rewind only as far as '__END__'.

later,

-- 
dan boorstein <danboo@negia.net>


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

Date: Sat, 14 Mar 1998 20:42:40 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: self 'seek'ing script
Message-Id: <350AEA71.E51993B6@usa.net>

I would say no, re Risks from $0, because $0 can be assigned to...

Other than that is the script self changing, with
virus-like activity???

Makes a person go Hmmmm...



Dan Boorstein wrote:

> ok, lately i have seen several examples of scripts which 'open' and
> read themselves using the idiom:
>
> open(SELF, $0) || die $!;
> @lines = <SELF>;
>
> this seems to work just fine, but are there risks invlolved due to the
> nature of $0?
>
> it has always been my practice to use 'seek' instead:
>
> seek DATA,0,0;
> @lines = <DATA>;
> __END__
>
> my question is - aside from the odd behavior of this, which i pointed out
> in my 'less than popular' stumper a couple of weeks ago - does this have
> inherent pifalls?
>
> admittedly these techniques would typically be used once in a script,
> but my simple benchmark shows that seek is considerably faster:
>
> #!/usr/bin/perl -w
> use Benchmark;
> timethese (10000, {
>   'open' => 'open SELF, $0; @lines = <SELF>;',
>   'seek' => 'seek DATA,0,0; @lines = <DATA>;',
> });
> __END__
>
>
> Benchmark: timing 10000 iterations of open, seek...
>       open:  7 secs ( 6.29 usr  0.00 sys =  6.29 cpu)
>       seek:  2 secs ( 1.72 usr  0.00 sys =  1.72 cpu)
>
> it also let's you do some fun obfuscations, since it seems to me that
> most people expect this to rewind only as far as '__END__'.
>
> later,
>
> --
> dan boorstein <danboo@negia.net>





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

Date: Sat, 14 Mar 1998 22:04:19 -0800
From: Dave Leather <dave.leather@btinternet.com>
Subject: Single logons
Message-Id: <350B6F63.6A28@btinternet.com>

Can any body help me? I am using perl for win32 under NT 4.0 and I want 
to beable to change passwords on the NT domain, and a remote unix server.
Any idea's.


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

Date: Sat, 14 Mar 1998 23:56:48 GMT
From: "Matthew S. Britt" <msbritt@us.itd.umich.edu>
Subject: sockets
Message-Id: <Pine.SUN.3.96.980314185253.6600C-100000@ren.us.itd.umich.edu>

Is there a way to 'peek' into a created socket to see if there is anyone
waiting to accept.  I want the program to check every x seconds, and if no
one is there, to do other work.  Is there a way to do this? 

thanks...

_______________________________________________________________________________
Matthew Britt 			Web Page:  http://www.umich.edu/~msbritt



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

Date: Sat, 14 Mar 1998 17:01:13 -0600
From: stvhoof@netvision.net.il
Subject: threads
Message-Id: <6ef24j$h6f$1@nnrp1.dejanews.com>

Is there any Perl module that allows you to use "threads" or "light-weight
processes"?  Thanks,

Tzadik

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Sat, 14 Mar 1998 23:14:38 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: threads
Message-Id: <350B0E0F.23972288@usa.net>

While risking being flamed again for saying this -

Did ya see www.perl.com  and search on Threads???

/^HTH$/
Sneex :)



stvhoof@netvision.net.il wrote:

> Is there any Perl module that allows you to use "threads" or "light-weight
> processes"?  Thanks,
>
> Tzadik
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading





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

Date: 14 Mar 1998 22:20:20 GMT
From: "Henning Glatter-Gotz" <hgg@techsoftdesign.com>
Subject: Re: Where can I get the PERL for Windows NT and 95?
Message-Id: <01bd4fb0$64ac6520$8b065c18@preinstalledcom.tampabay.rr.com>

Try http://www.perl.com/CPAN-local/doc/FAQs/nt/Perl_for_Win32_FAQ.html

Henning

Husky <huskystudio@geocities.com> wrote in article
<6e8bta$a0k@news.microsoft.com>...
> If I want to test my perl scripts in IIS on NT or PWS on Win95.
> Where can I get the perl software for these OS?
> Thanks...
> 
> 
> 


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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

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

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2100
**************************************

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