[11952] in Perl-Users-Digest
Perl-Users Digest, Issue: 5552 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 3 17:07:18 1999
Date: Mon, 3 May 99 14:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 3 May 1999 Volume: 8 Number: 5552
Today's topics:
Re: "learning perl" does not seem to be written well <tchrist@mox.perl.com>
a perl/c++ API <mcti@my-dejanews.com>
Re: Can I get multiple line or cut/paste input? <aqumsieh@matrox.com>
Re: comparing and contrasting dir trees (Mads Toftum)
Re: Debug - Single step ? <aqumsieh@matrox.com>
Filehandle Question <steve@berlingske.dk>
Re: Filehandle Question <t-armbruster@ti.com>
Re: Fill out someone else's form? <emschwar@rmi.net>
Re: finding the right doc WAS Re: using perl to manage (Tad McClellan)
Re: Finding x^y? (I R A Aggie)
Re: Finding x^y? (Tad McClellan)
Re: Finding x^y? (Larry Rosler)
Grab the user name under apache? <dnichols@fhcrc.org>
Re: Grab the user name under apache? <agilbert@dorian-group.com>
How to get perl to get data via FTP and other TCP/IP pr <adsfjlk@fdk.org>
How to implement array of structure in perl icyt@my-dejanews.com
I can't create cookie. <e.pavis@silicomp.com>
Re: IPC left overs <ryanpc@my-dejanews.com>
Re: Newsfeed and Local Weather <emschwar@rmi.net>
Re: Newsfeed and Local Weather (I R A Aggie)
Re: Newsfeed and Local Weather (Larry Rosler)
Re: Newsfeed and Local Weather <flavell@mail.cern.ch>
perl_parse exit codes shawn_worsencroft@intercept.com
Permutations <kenrose@home.com>
Problems with not getting a \n from socket. <rconner@mail.intrix.com>
redirecting w/ apache and SSI <agilbert@dorian-group.com>
Re: redirecting w/ apache and SSI <t-armbruster@ti.com>
Re: redirecting w/ apache and SSI duke@no.spam.ee
Re: remove all chars of a type except first and last. <t-armbruster@ti.com>
Re: remove all chars of a type except first and last. (Larry Rosler)
Re: sending email <cassell@mail.cor.epa.gov>
Re: sorting data in perl (John Klassa)
This is an EASY ONE! <ericg@novointeractive.com>
Re: This is an EASY ONE! (Steve Linberg)
Re: What's the difference between Perl and CGI? <juex@my-dejanews.com>
which UNIX should I use? <bogart@exis.no.spam.net>
Re: which UNIX should I use? <t-armbruster@ti.com>
Re: Who is Just another Perl hacker? <jdf@pobox.com>
Re: Who is Just another Perl hacker? <dgris@moiraine.dimensional.com>
Re: Who is Just another Perl hacker? (Greg Bacon)
Re: Who is Just another Perl hacker? (Greg Bacon)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 May 1999 13:57:02 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <372dff8e@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Ala Qumsieh <aqumsieh@matrox.com> writes:
:Well, maybe. I really thought the Perl5 Interactive book (by Jon
:Orwant, published by Waite Group) was pretty good, and simple. It
:showed you lots of examples *WITH THEIR OUTPUTS* and an explanation of
:each. This is something which the Camel lacks (hint hint).
You mean like we put in the Ram? (hint hint) :-)
--tom
--
X-Windows: It could be worse, but it'll take time.
--Jamie Zawinski
------------------------------
Date: Mon, 03 May 1999 20:25:48 GMT
From: Lacrosse_20 <mcti@my-dejanews.com>
Subject: a perl/c++ API
Message-Id: <7gl0o6$jga$1@nnrp1.dejanews.com>
Hello everyone-
We have developed a program in C++ which is currently stand-alone. We want
this C++ program to run as a server (i.e. not kickoff everytime you call it,
but just handle job requests on an ongoing basis). I'd like to have a PERL
script call it when it needs to run a job (handle the i/o to the main server
prog). Does anyone know of a specific API (e.g. CORBA...but not) that would
best be used for interfacing PERL with C++?
DISCLAIMER: (I'm aware that this post contains the word C++, (multiple times
even), but I feel that the PERL guru's would be better equipped to handle this
question since our implementation is specific to PERL...so in case you were
wondering, THAT's why I'm posting here)
Thank you in advance for your suggestions.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 3 May 1999 14:53:20 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Can I get multiple line or cut/paste input?
Message-Id: <x3y1zgynfxb.fsf@tigre.matrox.com>
Ala Qumsieh <aqumsieh@matrox.com> writes:
> This will stop reading as long as there are three dots followed by a
> \n. The dots do not have to be at the beginning of the line.
>
> Too bad $/ can't take a regexp or else one would've been able to do:
>
> $/ = /^...$/;
Ahem .. of course a dot is special in a regexp. So the above will match
*any* line that contains only 3 characters, possibly followed by a
newline character. But, that wasn't the point, was it? :-)
------------------------------
Date: Mon, 03 May 1999 19:33:03 GMT
From: mt@dev.null (Mads Toftum)
Subject: Re: comparing and contrasting dir trees
Message-Id: <372df91e.5874187@news.inet.tele.dk>
Although it is not exactly what you're looking for, you might want to
take a look at L6 - availabe from
ftp://opensores.thebunker.net/pub/mirrors/l6/ and other sites.
It descends the directory tree and computes checksums on all files and
dirs - to catch changed files simply save the output and run it
through diff.
vh
Mads Toftum, QDPH
som pe USENET reprfsenterer sig selv og ingen andre.
------------------------------
Date: Mon, 3 May 1999 14:56:32 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Debug - Single step ?
Message-Id: <x3yzp3mm17j.fsf@tigre.matrox.com>
Phillip Grobler <info@grobler.co.za> writes:
> How can I single step thrugh a perl program ?
Learn to use the debugger.
Read the perldebug documentation.
------------------------------
Date: Mon, 3 May 1999 22:14:30 +0200
From: "Steve Ball" <steve@berlingske.dk>
Subject: Filehandle Question
Message-Id: <7gl03l$2t4$1@watson.dk.uu.net>
I am 6 hours into learning Perl, having fun - and have a question, not
answered by my reference tome (Ellie Quigley, Perl by Example)
I have a perl script (surprise), runs with command line (still to get to the
ARGV part! ;-) ).
myscript.pl steve.file
Summarized code:
---------
#This line was here initially, but didn't work
#open (MYFILE, "myfile.txt") || die "Error $1\n";
while (<>){
...
open (MYFILE, "myfile.txt") || die "Error $1\n";
while (<MYFILE>){
($a,$b)=split(' ');
...
}
...
}
-------------
My first attempt had the filehandle open(MYFILE, "myfile.txt") before the
while(<>) as commented out... however, the scalars $a and $b only went
through the "myfile.txt" file on just the first iteration of the while
loop... being blank thereafter.
I solved the problem by moving the open(MYFILE, "myfile.txt") line to inside
the while(<>), thus opening for each iteration of while(<>).
My question is: why does the MYFILE 'close'... and if so, is the above
implementation - reopening MYFILE for each iteration of the while loop -
correct? It just seems clumsy.
Thanks for your help,
Steve Ball
------------------------------
Date: Mon, 3 May 1999 15:36:41 -0500
From: "Tim Armbruster" <t-armbruster@ti.com>
Subject: Re: Filehandle Question
Message-Id: <fRnX2.13$zh2.991@dfw-service1.ext.raytheon.com>
Steve Ball wrote in message <7gl03l$2t4$1@watson.dk.uu.net>...
>I am 6 hours into learning Perl, having fun - and have a question, not
>answered by my reference tome (Ellie Quigley, Perl by Example)
>while (<>){
> ...
OK, you maybe should read more into what the above line does. In my own
words, it opens the file given in ARGV, reads it line by line, and does the
while loop once for eache line. The line can be accessed implicitly or
explicitly via the $_ variable.
>
> open (MYFILE, "myfile.txt") || die "Error $1\n";
>
If you _were_ to open a file this way, you would probably use $! for the
error message, not $1
Try the following code:
while(<>)
{
($a,$b) = split(' ');
print "A is: $a B is: $b \n";
}
>
>Thanks for your help,
>
No problem
------------------------------
Date: 03 May 1999 12:19:22 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Fill out someone else's form?
Message-Id: <xkfu2tukod1.fsf@valdemar.col.hp.com>
petcrows@bigfoot.com (Jonathan Higbee) writes:
> Perhaps what I need is a way to browse the web using Perl,
> so I can plug what a user enters in a form on my page, into
> the form on someone else's page.
>
> Any specific ideas & examples I could learn from?
LWP::Simple is what you want. It's on CPAN.
-=Eric
------------------------------
Date: Mon, 3 May 1999 09:59:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: finding the right doc WAS Re: using perl to manage passwords?
Message-Id: <k3akg7.oi2.ln@magna.metronet.com>
Jonathan Feinberg (jdf@pobox.com) wrote:
: Tom Christiansen <tchrist@mox.perl.com> writes:
: > In comp.lang.perl.misc, Dan Baker <dtbaker@bus-prod.com> writes:
: > :what will be the preferred documentation method of the future?
: >
: > Voice mail, with on of those push-button menus.
: You have reached Person Pages Interactive, formerly Man Pages. Our
: menu options have changed. Please listen to the following options,
: and select the most appropriate one.
You can make a comment at any time by pressing the pound key.
Press the star key if you have zero or more questions, or if
you want to multiply your question by something.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 3 May 1999 18:26:42 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Finding x^y?
Message-Id: <slrn7irqo0.s2m.fl_aggie@stat.fsu.edu>
On Mon, 3 May 1999 10:54:23 -0700, Larry Rosler <lr@hpl.hp.com>, in
<MPG.119782af21fcfb029899a3@nntp.hpl.hp.com> wrote:
+ In article <MPG.1197805176a008a29899a1@nntp.hpl.hp.com> on Mon, 3 May
+ 1999 10:44:20 -0700, Larry Rosler <lr@hpl.hp.com> says...
+ > Just because the poster's guess at the solution was wrong doesn't make
+ > him/her a jerk...
+ I'm wrong. I looked at the other branch of this thread, and *he* is
+ indeed a jerk. :-(
No, you aren't. Making wrong guesses didn't make him a jerk.
James - cool...got the CC prompt working...excellent...but no CC sent...
------------------------------
Date: Mon, 3 May 1999 10:08:57 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Finding x^y?
Message-Id: <plakg7.oi2.ln@magna.metronet.com>
JWefler (wef@wwa.comx) wrote:
: Oh, my humblest apologies my most righteous sire...
Humph.
If you are so clueless as to be unable to find operators in
the man page about operators, how can you be so clued as to
have divined Daniel's title?
You got access to that ESP module or something?
: I guess I should have made this more clear, since you are obviously
: suffering from some kind of brain dysfunction or psychological
: disorder...
But I'll bet he knows how to read.
Do you?
: Take the "x" off of the end of my e-mail address and shove
: it up your tightly wound arsehole!
: Why is it whenever I post to this n/g I get some kind of smart arsed
: reply like this one?
I think your attitude just may be contributing to that a little bit...
: Daniel Grisinger wrote:
: > *plonk*
<aol> Me too! </aol>
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 3 May 1999 13:26:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Finding x^y?
Message-Id: <MPG.1197a63a9bb6d5519899a6@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <slrn7irqo0.s2m.fl_aggie@stat.fsu.edu> on 3 May 1999 18:26:42
GMT, I R A Aggie <fl_aggie@thepentagon.com> says...
> On Mon, 3 May 1999 10:54:23 -0700, Larry Rosler <lr@hpl.hp.com>, in
> <MPG.119782af21fcfb029899a3@nntp.hpl.hp.com> wrote:
> + In article <MPG.1197805176a008a29899a1@nntp.hpl.hp.com> on Mon, 3 May
> + 1999 10:44:20 -0700, Larry Rosler <lr@hpl.hp.com> says...
> + > Just because the poster's guess at the solution was wrong doesn't make
> + > him/her a jerk...
>
> + I'm wrong. I looked at the other branch of this thread, and *he* is
> + indeed a jerk. :-(
>
> No, you aren't. Making wrong guesses didn't make him a jerk.
I agree. Making wrong guesses didn't make him a jerk. That was my
original point in response to Uri, who called him a jerk.
But my second point was made by his second post, which uses several
obscenities that I don't care to reproduce here. Your newsreader will
show you.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 03 May 1999 20:08:25 +0000
From: Douglas Nichols <dnichols@fhcrc.org>
Subject: Grab the user name under apache?
Message-Id: <372E0239.470FE5A3@fhcrc.org>
I would like to grab the name of the user that loggin with a
valid user_name. I am using perl and have apache 1.3.4.
Since they have logged in through the browser I should be
able to find this information from apache somewhere?
I have a section in httpd.conf:
</directory...>
.
.
require valid-user
So I need somewhere in my perl script to get the user_name..
Thanks in advance.
--
Cheers
Douglas Nichols
dnichols@fhcrc.org
----------------------------------------------------------------------------
------------------------------
Date: Mon, 3 May 1999 15:20:19 -0500
From: "Arlo Gilbert" <agilbert@dorian-group.com>
Subject: Re: Grab the user name under apache?
Message-Id: <7gl0je$s1u$1@remarQ.com>
$your_own_variable = $ENV{'REMOTE_USER'};
This should do the trick for retrieving remote user information. It only
works in either the directory that is password protected or subdirectories
of it...basically, if somebody exits the protected directory and goes to an
unprotected one, you will no longer be able retrieve their user info.
Douglas Nichols <dnichols@fhcrc.org> wrote in message
news:372E0239.470FE5A3@fhcrc.org...
> I would like to grab the name of the user that loggin with a
> valid user_name. I am using perl and have apache 1.3.4.
>
> Since they have logged in through the browser I should be
> able to find this information from apache somewhere?
>
>
> I have a section in httpd.conf:
> </directory...>
> .
> .
> require valid-user
>
> So I need somewhere in my perl script to get the user_name..
>
>
>
> Thanks in advance.
>
> --
> Cheers
>
> Douglas Nichols
> dnichols@fhcrc.org
> --------------------------------------------------------------------------
--
------------------------------
Date: 3 May 1999 18:22:35 GMT
From: Perl Worthington <adsfjlk@fdk.org>
Subject: How to get perl to get data via FTP and other TCP/IP protocols?
Message-Id: <7gkphb$8gv$2@agate.berkeley.edu>
Hello, If I wanted to catalogue files on servers, say FTP sites, then Perl
could get the data by issuing a shell command, since FTP is a standard UNIX command.
but how about these a non standard protocol, say like carracho servers and hotline servers. to access these files,
you use a mac/pc clien to access servers running on macos or windows. How
would figure out how to get unix/perl to emulate/recognize these kind of protocols? Is this possible?
Thanks
nickysantoro at yahoo dot com
------------------------------
Date: Mon, 03 May 1999 20:00:21 GMT
From: icyt@my-dejanews.com
Subject: How to implement array of structure in perl
Message-Id: <7gkv8i$i6s$1@nnrp1.dejanews.com>
Hi,
I need to create a person information array in PERL. If we implemented in C
language will be something like this:
--------------------------------------
struct person {
char name[16];
char sex;
short age;
};
struct person pTable[10];
/* access pTable */
index =5;
pTable[index].age = 40;
-----------------------------------
How should I define pTable in PERL and how to access data in the table ? I
know I need to do HASH and I need a list, but I don't know how to glue it
together.
Can I get help with a sample code ? Thanks,
icyt
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 03 May 1999 20:51:31 +0200
From: Edouard PAVIS <e.pavis@silicomp.com>
Subject: I can't create cookie.
Message-Id: <372DF033.25C7EF1C@silicomp.com>
Hi,
I've read many faq's and manual's about perl, and it seems very simple
to use cookie. But I'm not able to send a simple cookie.
This code doesn't create any Cookie but just print on the screen "The
Cookie must be send.....Normaly....."
(I use the CGI.pm library and the HTTP server is IIS4).
#################################################################
#!/bin/perl
use CGI;
$p1 = new CGI;
$cookie = $p1->cookie(-name=>'test_cook',
-value=>'COOKIE_EXAMPLE',
-expires=>'+3M',
-path=>'/',
-domain=>'.imaginet.fr',
-secure=>0);
print $p1->header(-cookie=>$cookie),
$p1->start_html(-title=>'Page1'),
$p1->h1('Page1'),
'The Cookie must be send.....Normaly.....',
$p1->end_html();
#################################################################
Could you help me.
Thanks
Edouard
<e.pavis@silicomp.com>
------------------------------
Date: Mon, 03 May 1999 18:33:23 GMT
From: Ryan PC Gibson <ryanpc@my-dejanews.com>
Subject: Re: IPC left overs
Message-Id: <7gkq5j$dc6$1@nnrp1.dejanews.com>
thanks for the ptr. "ipcrm" exists in solaris too!
- ryan
> If this is linux, the command ipcrm will work. For example:
>
> ipcrm shm <id>
> ipcrm msg <id>
> ipcrm sem <id>
>
> -brad
>
> In article <7f2k1n$jt4$1@nnrp1.dejanews.com>,
> ryanpc@hotbot.com wrote:
> > hello:
> >
> > so i got this program that uses shared memory via IPC::Shareable calls to
> > store results of HTTP requests. i am ending up with a lot of "orphaned" IPC
> > shared memory segments and semaphores. after running the script eery
minute
> > for 12 hours i run "ipcs" from the command line and see a list of about
> > twenty shared mem. segments and semaphores created by processes that are
long
> > since dead. occasionaly, also, the script will fail to run via cron due to
> > this error:
> >
> > semget returned undef: No space left on device at /home/ryan/cgi/wps/wps
line
> > 219
> >
> > ...which i am attributing to memspace since disk space is fine.
> >
> > is there a way of "killing" these orphaned segments/semaphores? are they
> > even a problem (ie does solaris reclaim that space if PID is not running?)
> >
> > any direction/suggestion/thoughts given would be lovely
> >
> > -----------== Posted via Deja News, The Discussion Network ==----------
> > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
> >
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 03 May 1999 12:11:50 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Newsfeed and Local Weather
Message-Id: <xkfwvyqkopl.fsf@valdemar.col.hp.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> ifyouwontputindoublespacestoseparatesentencesandyouwontputincapitals
> toindicatetheirstartitisquiteabithardertoparsethanwedeserve.
itshouldbenotedforthebenefitoftheoverlypedanticthattheuseoftwospacesaftera
sentenceendingpunctuationmarkisentirelyamatterofhousestylethoughitdoesseem
tobemorecommonwhenusingmonospacedtypebutitshardlyuniversaleventhere.
-=Eric
------------------------------
Date: 3 May 1999 18:28:23 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Newsfeed and Local Weather
Message-Id: <slrn7irqr5.s2m.fl_aggie@stat.fsu.edu>
On 03 May 1999 12:11:50 -0600,
Eric The Read <emschwar@rmi.net>, in
<xkfwvyqkopl.fsf@valdemar.col.hp.com> wrote:
+ Tom Christiansen <tchrist@mox.perl.com> writes:
+ > ifyouwontputindoublespacestoseparatesentencesandyouwontputincapitals
+ > toindicatetheirstartitisquiteabithardertoparsethanwedeserve.
+
+ itshouldbenotedforthebenefitoftheoverlypedanticthattheuseoftwospacesaftera
+ sentenceendingpunctuationmarkisentirelyamatterofhousestylethoughitdoesseem
+ tobemorecommonwhenusingmonospacedtypebutitshardlyuniversaleventhere.
A Plague of Newbies Upon Both Your Houses.
James
------------------------------
Date: Mon, 3 May 1999 11:53:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newsfeed and Local Weather
Message-Id: <MPG.1197907919e642349899a4@nntp.hpl.hp.com>
In article <xkfwvyqkopl.fsf@valdemar.col.hp.com> on 03 May 1999 12:11:50
-0600, Eric The Read <emschwar@rmi.net> says...
> Tom Christiansen <tchrist@mox.perl.com> writes:
> > ifyouwontputindoublespacestoseparatesentencesandyouwontputincapitals
> > toindicatetheirstartitisquiteabithardertoparsethanwedeserve.
>
> itshouldbenotedforthebenefitoftheoverlypedanticthattheuseoftwospacesaftera
> sentenceendingpunctuationmarkisentirelyamatterofhousestylethoughitdoesseem
> tobemorecommonwhenusingmonospacedtypebutitshardlyuniversaleventhere.
theadventofHTMLhasmadeitevenworsebecauseinordinarytextHTMLtreatstwospace
sthesameasonesonooneseesthedistictionandnobodyuses toseparate
sentencesinanycasebuttheyshould!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 3 May 1999 21:05:34 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Newsfeed and Local Weather
Message-Id: <Pine.HPP.3.95a.990503210129.14031R-100000@hpplus01.cern.ch>
On Mon, 3 May 1999, Larry Rosler wrote:
> theadventofHTMLhasmadeitevenworsebecauseinordinarytextHTMLtreatstwospace
> sthesameasonesonooneseesthedistictionandnobodyuses toseparate
> sentencesinanycasebuttheyshould!
Sorry, can't agree with that. Joking aside: the SGML/HTML way would be
to wrap sentences in a pair of opening/closing sentence tags. Whether
the rendering involved two spaces or not would be entirely a
presentation issue. Remember, some renderings aren't visual anyway.
--
"...in order to have the least helplessly submissive experience"
- Todd Fahrner
------------------------------
Date: Mon, 03 May 1999 18:25:38 GMT
From: shawn_worsencroft@intercept.com
To: craig_morris@intercept.com
Subject: perl_parse exit codes
Message-Id: <7gkpms$cub$1@nnrp1.dejanews.com>
When calling the perl_parse routine, 9 is returned.
Does anyone know where the exit codes are documented
for perl_parse? The Perl version I am using is
5.005_03, on Win32, compiled with Visual 6.0.
Thanks,
Shawn Worsencroft
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 03 May 1999 20:48:18 GMT
From: Kenneth Rose <kenrose@home.com>
Subject: Permutations
Message-Id: <372E0A4A.723A4ABC@home.com>
Hi all,
OK, have an interesting question. I've searched desperately for
something like this in Perl. A permutation library. Basically, I'm
looking for something like:
@perms = permute("ABC");
This would store the following elements in @perms:
ABC
ACB
BAC
BCA
CAB
CBA
Obviously, if there were four letters, then there would be 24 elements
(4!). Similiarly, if there were n letters, there would be n!
permutations
Does anyone know of any premade module in Perl that does this? Writing a
permutation algorithm is NOT something I'm keen on doing (I can only
think of a recursive algorithm....there's always the "Fisher Price"
algorithm, but again, why reinvent the wheel?)
Thanks again!
/<en
------------------------------
Date: Mon, 3 May 1999 11:06:40 -0700
From: "Russ Conner" <rconner@mail.intrix.com>
Subject: Problems with not getting a \n from socket.
Message-Id: <925754378.835.29@news.remarQ.com>
TIA,
I posted earlier about problems with sockets, it looks like I have the kinks
worked out, execpt that the custom server I talk to does not send a /n to
let perl know it is done talking. Therefore the standard while ( <$remote> )
{ print } does not work.
I am now doing a syscall read from page 624 of the Perl Cookbook. This does
not help either, although the code works just fine if I connect to, say a
POP3 server.
The packets are delimited by a set of [ ] so perhaps I can modify the code
below to recognize this?
my $byte;
while (sysread($handle, $byte, 1) == 1) {
print STDOUT $byte;
}
------------------------------
Date: Mon, 3 May 1999 15:23:10 -0500
From: "Arlo Gilbert" <agilbert@dorian-group.com>
Subject: redirecting w/ apache and SSI
Message-Id: <925763160.089.53@news.remarQ.com>
I'm putting a server side include in an html file and the server is parsing
the file and running the perl script with no problem. The problem is that I
need to do a redirect based upon username. I check the username and then
print a Location statement. The location statement is correct, but rather
than redirecting, it prints the URL of the place that I needed it to
redirect to.
Sincerely,
Very Frustrated
------------------------------
Date: Mon, 3 May 1999 15:41:34 -0500
From: "Tim Armbruster" <t-armbruster@ti.com>
Subject: Re: redirecting w/ apache and SSI
Message-Id: <RVnX2.14$zh2.981@dfw-service1.ext.raytheon.com>
This doesn't seem to have a lot to do with Perl. Please post to the
appropriate newsgroup. I'd redirect you to one, but I can't tell if it's an
HTML, CGI, Web Server, or Admin problem.
Arlo Gilbert wrote in message <925763160.089.53@news.remarQ.com>...
>I'm putting a server side include in an html file and the server is parsing
>the file and running the perl script with no problem. The problem is that I
>need to do a redirect based upon username. I check the username and then
>print a Location statement. The location statement is correct, but rather
>than redirecting, it prints the URL of the place that I needed it to
>redirect to.
>
>Sincerely,
>
>Very Frustrated
>
>
------------------------------
Date: 3 May 1999 20:50:02 GMT
From: duke@no.spam.ee
Subject: Re: redirecting w/ apache and SSI
Message-Id: <7gl25q$e2r$1@kadri.ut.ee>
: print a Location statement. The location statement is correct, but rather
: than redirecting, it prints the URL of the place that I needed it to
: redirect to.
it's quite hard to answer without seeing the code. But it probably
prints a "Content-type" header before the actual "Location" statement.
D.
------------------------------
Date: Mon, 3 May 1999 15:15:10 -0500
From: "Tim Armbruster" <t-armbruster@ti.com>
Subject: Re: remove all chars of a type except first and last.
Message-Id: <4xnX2.11$zh2.981@dfw-service1.ext.raytheon.com>
Try:
my @lines = ('This is one annoying:"line "that" ha""s st""uff "to be
removed"',
'This is another annoying:"line "has st""uff to"" be"
removed"');
foreach $line (@lines) {
while ($line =~ s/"(.*)"(.*)"/"\"$1$2\""/e) {}
}
print "$_\n" foreach @lines;
Vicuna wrote in message <7gk54o$q9f$1@nnrp1.dejanews.com>...
>I need remove all characters of a certain type, except for the first and
>
>my @lines = ('This is one annoying:"line "that" has stuff to be removed"',
> 'This is another annoying:"line "has stuff to be removed"');
>
>foreach (@lines) {
> s/(".*")/my_tr($1)/e;
>}
>
>sub my_tr {
> my $in = shift;
> $in =~ tr/"//d;
> return qq("$in");
>}
>
>print "$_\n" foreach @lines;
------------------------------
Date: Mon, 3 May 1999 13:54:52 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: remove all chars of a type except first and last.
Message-Id: <MPG.1197acf3f8ae90a49899a8@nntp.hpl.hp.com>
In article <4xnX2.11$zh2.981@dfw-service1.ext.raytheon.com> on Mon, 3
May 1999 15:15:10 -0500, Tim Armbruster <t-armbruster@ti.com> says...
...
> while ($line =~ s/"(.*)"(.*)"/"\"$1$2\""/e) {}
Unnecessary use of /e.
while ($line =~ s/"(.*)"(.*)"/"$1$2"/) {}
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 03 May 1999 11:19:27 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: sending email
Message-Id: <372DE8AF.D97C763E@mail.cor.epa.gov>
Terra Landry wrote:
>
> I want to send out an email to multiple recipients.. I have my emails.. but
> I'm not sure how to send the email.. if you could reply ASAP I'd greatly
> appreciat it!!
Try this:
perldoc -q mail
Lo and behild, in perlfaq9 there's a host [pardon the pun] of useful
info on this. Short version: use sendmail [or a win32 analogue], as
per the code in the FAQ.. or else use one of the Mail::* modules at
CPAN.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541) 754-4468
mathematical statistician fax: (541) 754-4716
------------------------------
Date: 3 May 1999 19:49:12 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: sorting data in perl
Message-Id: <7gkujo$os9$1@aurwww.aur.alcatel.com>
On Mon, 03 May 1999 04:13:09 GMT, cyberunity@my-dejanews.com wrote:
> and I would like to sort this array so that the output should be like:
Check your online perlfaq (perlfaq4, in particular), as well as
http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html.
--
John Klassa / Alcatel USA / Raleigh, NC, USA
------------------------------
Date: Mon, 03 May 1999 12:06:36 -0700
From: Eric Gafner <ericg@novointeractive.com>
Subject: This is an EASY ONE!
Message-Id: <372DF3BC.3B59E1D7@novointeractive.com>
I think there is an easy way to do this,
but can't find it on the web or in "Programming Perl".
All I want to do is use a scalar as a regular
expression. That way I can search a line of text
to see if it contains the string value of the scalar.
I know there are probably other ways to do this,
but I am a newbie and want to learn this trick.
thanks!!
Please Reply to: chucil@yahoo.com
------------------------------
Date: Mon, 03 May 1999 15:46:01 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: This is an EASY ONE!
Message-Id: <linberg-0305991546010001@ltl1.literacy.upenn.edu>
In article <372DF3BC.3B59E1D7@novointeractive.com>, Eric Gafner
<ericg@novointeractive.com> wrote:
> I think there is an easy way to do this,
> but can't find it on the web or in "Programming Perl".
You didn't look very hard, then.
> All I want to do is use a scalar as a regular
> expression. That way I can search a line of text
> to see if it contains the string value of the scalar.
It is very easy to do this, and it is well-documented. You should get in
the habit of doing this kind of thing yourself. Questions like this that
are about the basic fundamentals of a language are usually answered in
hundreds of easily-accessible locations.
To help you on your way, I will tell you (though others will undoubtedly
spill the beans for you) that the answer you seek lies in Programming
Perl, 2nd edition, somewhere between pages 57 and 76. If you haven't read
through all of that, carefully and line-by-line, you should, and you'll
find out lots more than just the answer to this one very basic question.
HTH. HAND.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: Mon, 3 May 1999 11:53:49 -0700
From: "J|rgen Exner" <juex@my-dejanews.com>
Subject: Re: What's the difference between Perl and CGI?
Message-Id: <7gkr8k$sg8@news.dns.microsoft.com>
<joeyandsherry@mindspring.com> wrote in message
news:7gk990$hf$1@nntp5.atl.mindspring.net...
> I have been apparently posting to the wrong newsgroups,
>
> What's the difference between Perl and CGI?
Sorry, but do they have anything in common?
Seriously, you are asking "What is the difference between a truck and a
house"?
You can use the truck to haul the building materials for the house, but
that's about all they have in common. You could just as well use a pickup or
your family car or a semi instead. And of course on the other end you can
use your pickup for a vacation, too.
Similar Perl is just one of dozens of options to write CGI programs and of
course Perl can be used for many other purposes, too (just like a truck can
deliver groceries, too).
jue
--
J|rgen Exner
------------------------------
Date: Mon, 03 May 1999 14:33:56 -0500
From: Ed Bogart <bogart@exis.no.spam.net>
Subject: which UNIX should I use?
Message-Id: <372DFA24.632FF99E@exis.no.spam.net>
Hi,
I have an old 586/150 box at home (1.4 GHD, 32M Ram) that I want to set up to
run Perl. I am now using An SGI 02 running Irix 6.5 and Apache at work and would
like to build and environment that is not too dissimilar for home. I am even
willing to _spend_ $$ for the os (especially now that RedHat Linux can be had
for only $40.) So, what would be the best choice of UNIX flavors that would run
on my box?
Ed
------------------------------
Date: Mon, 3 May 1999 15:51:48 -0500
From: "Tim Armbruster" <t-armbruster@ti.com>
Subject: Re: which UNIX should I use?
Message-Id: <q3oX2.15$zh2.1041@dfw-service1.ext.raytheon.com>
Ed Bogart wrote in message <372DFA24.632FF99E@exis.no.spam.net>...
>Hi,
>
>I have an old 586/150 box at home (1.4 GHD, 32M Ram) that I want to set up
to
>run Perl. I am now using An SGI 02 running Irix 6.5 and Apache at work and
would
>like to build and environment that is not too dissimilar for home. I am
even
>willing to _spend_ $$ for the os (especially now that RedHat Linux can be
had
>for only $40.)
Redhat 5.2 can be downloaded for free many places, but I recommend getting a
CD, which can be ordered at www.cheapbytes.com for around 5 bucks. I also
highly recommend Redhat. They have a great thing going, with increasing
ease of use and availability of documentation. Most of the common hardware
is supported, but I suggest checking out your system first. In addition, it
comes with a wide variety of freeware for all of your basic computing needs.
Also Redhat 6.0 is almost out, and I expect it to be even greater. Go to
www.linux.org or www.redhat.com for more info.
Also, in the future, post to the appropriate newsgroup. This has nothing to
do with Perl.
>So, what would be the best choice of UNIX flavors that would run
>on my box?
>
>Ed
------------------------------
Date: 03 May 1999 14:17:33 -0400
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Who is Just another Perl hacker?
Message-Id: <m3btg25876.fsf@joshua.panix.com>
Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
> gbacon@itsc.uah.edu (Greg Bacon) writes:
>
> > In article <m1hfpvh2jq.fsf@halfdome.holdit.com>,
> > merlyn@stonehenge.com (Randal L. Schwartz) writes:
> > : So, in answer to your question, feel free to declare yourself a JAPH,
> > : but most of us around here agree that I'm JAPH # 0. :)
> >
> > So do JAPH numbers work like Erdos number?
>
> Nope, if they did everybody who had ever received an email
> from Randal would qualify for 1.
I don't see the analogy. The Erdvs number reflects co-authorship, not
correspondence. I think that by that measure, tchrist and lwall have
Schwartz numbers of 1, whereas gnat has a 2, etc.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 03 May 1999 12:39:14 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Who is Just another Perl hacker?
Message-Id: <m37lqqatgt.fsf@moiraine.dimensional.com>
Jonathan Feinberg <jdf@pobox.com> writes:
> Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
>
> > gbacon@itsc.uah.edu (Greg Bacon) writes:
> >
> > > So do JAPH numbers work like Erdos number?
> >
> > Nope, if they did everybody who had ever received an email
> > from Randal would qualify for 1.
>
> I don't see the analogy. The Erdvs number reflects co-authorship, not
> correspondence. I think that by that measure, tchrist and lwall have
> Schwartz numbers of 1, whereas gnat has a 2, etc.
Hmmmm.... I had a reason for writing that. Let's see, it has
to be around here somewhere.
<time passes>
Oh! There it is, it fell under my desk. Let's see here.
Oh, yup- co-authorship and correspondence both start with
the letter `c'. Good enough for me. :-)
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: 3 May 1999 19:34:12 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Who is Just another Perl hacker?
Message-Id: <7gktnk$466$2@info2.uah.edu>
In article <m3btg25876.fsf@joshua.panix.com>,
Jonathan Feinberg <jdf@pobox.com> writes:
: Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
: > gbacon@itsc.uah.edu (Greg Bacon) writes:
: > > So do JAPH numbers work like Erdos number[s]?
: >
: > Nope, if they did everybody who had ever received an email
: > from Randal would qualify for 1.
:
: I don't see the analogy. The Erdvs number reflects co-authorship, not
: correspondence. I think that by that measure, tchrist and lwall have
: Schwartz numbers of 1, whereas gnat has a 2, etc.
Well... it could be both in the sense of the minimum distance (in terms
of a thread tree) from a post that inspired RRaannddaall to create a
new JAPH.
Greg
--
If crime fighters fight crime, and firefighters fight fire, what do freedom
fighters fight? They never mention that part to us, do they?
-- George Carlin
------------------------------
Date: 3 May 1999 19:35:18 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Who is Just another Perl hacker?
Message-Id: <7gktpm$466$3@info2.uah.edu>
In article <m3lnf6aw7h.fsf@moiraine.dimensional.com>,
Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
: gbacon@itsc.uah.edu (Greg Bacon) writes:
: > How does one compute one's JAPH number? :-)
:
: Perhaps-
:
: my $JAPHID = ($number_of_clpm_posts /
: $number_of_questions_received_asking_how_your_sig_works)
: *
: ( 0 ** 0 ); # just for greg :-)
Oh, so we should just go ahead and leave everyone's JAPH number
undefined? :-) :-) :-)
Greg
--
The circle algorithm was invented by mistake when I tried to save one
register in a display hack!
-- Minsky
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5552
**************************************