[7335] in Perl-Users-Digest
Perl-Users Digest, Issue: 960 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 2 10:07:11 1997
Date: Tue, 2 Sep 97 07:00:29 -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 Tue, 2 Sep 1997 Volume: 8 Number: 960
Today's topics:
Re: "U.S." =~ m/\bU\.S\.\b/ fails <fawcett@nynexst.com.spam-me-not>
Re: Better than Soundex <pcunnell@csfp.co.uk>
Can we use a MS Acces DB with a Perl Script ? <samuel.chenal@ans.ch>
Re: Can we use a MS Acces DB with a Perl Script ? (Jeremy D. Zawodny)
Re: editing perl <tom@mitra.phys.uit.no>
Re: formatnames, filehandles and strict (Jeremy D. Zawodny)
Re: FTP with perl <tom@mitra.phys.uit.no>
Getting values from HTML forms... <rmariano@u.washington.edu>
Re: Getting values from HTML forms... (Jeremy D. Zawodny)
Re: Help - Perl / cgi <gordon.leslie.mcdorman@sap-ag.de>
Re: Help - Perl / cgi (Aaron Sherman)
Re: Help with Perl hooks on INN 1.5.1, please (Garzik)
Re: Include external subroutines (Jeremy D. Zawodny)
Re: Password verification with a shadow file ?? <ajs@ajs.com>
Re: perl and XEmacs <rsi@earthling.net>
Re: Perl for Win32 - Capturing output from backticks (Parillo)
Perl interface to Cadence DFII WAL (Waveform Access Lib <peter.riocreux@cs.man.ac.uk>
Problem: Chop and Line Issues (John S Flowers)
Re: Programming question (Burt Lewis)
Re: Randal and Intel, Was: Scrambling using tr (Paul Colquhoun)
Script Time <mweber@vt.edu>
Re: Script Time (Jeremy D. Zawodny)
Taint problem with setuid script <jasuther@dux.dundee.ac.uk>
Time question.. <guitarplayer@hotmail.com>
Re: Where can I get perl and how do I install it? (Jeremy D. Zawodny)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 02 Sep 1997 07:56:15 -0400
From: Tom Fawcett <fawcett@nynexst.com.spam-me-not>
Subject: Re: "U.S." =~ m/\bU\.S\.\b/ fails
Message-Id: <8ju3g47wv4.fsf@nynexst.com.spam-me-not>
"Jon Wahl" <jjwahl@eznet.net> writes:
> I tried it too and it seems that Perl has a problem with the second \b word
> boundary. According to the Camel Book, 'The special character string \b
> matches at a word boundary, which is defined as the "nothing" between a
> word character (\w) and a non-word character (\W), in either order. (The
> characters that don't exist off the beginning and end of your string are
> considered to be non-word characters.)' Which, as I read it means that
> your pattern should match.
A period is not considered part of a word, so there is no word boundary
between period and end-of-string.
------------------------------
Date: Tue, 02 Sep 1997 09:31:43 +0100
From: Paul Cunnell <pcunnell@csfp.co.uk>
To: david@telekinesys.co.uk
Subject: Re: Better than Soundex
Message-Id: <340BCEEF.167EB0E7@csfp.co.uk>
[mailed & posted]
David Greaves wrote:
>
> Hi
> I'm after an algorithm thats better than Soundex at generating keys for
> words in spoken language (ascii/western encoding) documents.
>
> I'm also interested in language/rule based stuff like removing 'ing' so
> that word stems can be created: (handling->handl) <> handle :(
I think you're after Martin Porter's stemming algorithm, which
I remember worked extremely well for the BBC Domesday project's
free text keyword searching. (Martin & I both worked on the
retrieval software). An implementation of the algorithm
_appears_ to be on CPAN - e.g. (since you have a .co.uk address):
ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/authors/id/IANPX/Stem-0.1.tar.gz
Martin may be contacted theough Muscat (www.muscat.co.uk), who
have some pretty nifty web indexing and query technology by
the way, for anyone who is interested.
>
> Does anyone know anything about this?
> References... gratefully received.
>
> Thanks in advance
>
> David
>
> PS if you reply to the group and cc me, I'd be grateful as, like many, I
> don't read that often.
I'm cc'ing you as long as you agree to post a summary. Deal ?
Paul.
--
Paul Cunnell CSFB RDG (pcunnell@csfp.co.uk) +44 171 888 2946
------------------------------
Date: Tue, 02 Sep 1997 11:31:45 +0200
From: Samuel Chenal <samuel.chenal@ans.ch>
Subject: Can we use a MS Acces DB with a Perl Script ?
Message-Id: <340BDD00.B7E51326@ans.ch>
I'd like to know if we can use a MS Acces DB to store data from a perl
script. It would be great if you had an exemple for me.
Thanks
Samuel Chenal
------------------------------
Date: Tue, 02 Sep 1997 12:20:10 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Can we use a MS Acces DB with a Perl Script ?
Message-Id: <340e0457.401123805@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 02 Sep 1997 11:31:45 +0200, Samuel Chenal
<samuel.chenal@ans.ch> wrote:
>I'd like to know if we can use a MS Acces DB to store data from a perl
>script. It would be great if you had an exemple for me.
I don't have an example handy, but have a look at the ODBC.pm Perl
module.
http://www.roth.net/odbc/
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: 02 Sep 1997 12:32:24 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: editing perl
Message-Id: <nqosovouhtz.fsf@mitra.phys.uit.no>
> Michael T Hammond <hammond@u.arizona.edu> wrote:
> >I'd like to be able to edit Perl bits with emacs and then try them out
> >from within emacs. How do I do this?
[emacs solution snipped]
ajs@lorien.ajs.com (Aaron Sherman) suggested:
> 1 G ! G perl -Mstrict -w <return>
I think I'd rather use
:%w !perl -w - <args> <return>
which won't change the buffer.
> -AJS
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Tue, 02 Sep 1997 12:15:07 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: formatnames, filehandles and strict
Message-Id: <340d0312.400798748@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 02 Sep 1997 09:54:38 +0200, denis@mathi.uni-heidelberg.de
wrote:
>hi,
>
>how can i use formatnames and filehandles with strict...
>i got a errormessage:
>
>Bareword "PROBLEM" not allowed while "strict subs"
>for the formatfiles and
>
>Global symbol "OUT_FILE" requires explicit package name
>for the filehandles?
Well, you could turn that checking off. I believe with:
no strict 'subs';
But you might want to post a code sample in case you're doing
something differently than Perl expects.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: 02 Sep 1997 12:43:55 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: FTP with perl
Message-Id: <nqorab8uhas.fsf@mitra.phys.uit.no>
mweber@vt.edu (Matt Weber) wrote:
> > Is there an easy perl script or module for FTPing something? It
> > needs to be able to run on its own....log itslef in....transfer
> > files and close the socket. The running on its own part will be
> > done with crontabs. Any suggestions?
scott@radix.net (Scott Houck) writes:
> Maybe you should check out Expect.
What on earth for? There's Net::FTP, you know. Works like a charm.
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Tue, 2 Sep 1997 02:37:54 -0700
From: Ramon Mariano Jr <rmariano@u.washington.edu>
Subject: Getting values from HTML forms...
Message-Id: <Pine.A41.3.96a.970902023634.20128A-100000@dante34.u.washington.edu>
I have an HTML form where one of the input fields is named "price". It's
just a normal text input field where the user types in a numerical value.
Now, in my perl script, I take the value of "price" and manipulate it
using very simple math. Here's the line in my script that seems to be the
source of my problems:
my $totalPrice = $FORM{'price'};
In other words, I'm attempting to store the value typed into the form
field into a variable called "$totalPrice". However, this method doesn't
seem to work since all of the subsequent calculations using the
"$totalPrice" variable doesn't compute correctly. For testing purposes, I
substituted the "$FORM{'price'}" to an arbitrary constant like this:
my $totalPrice = 30;
After doing that, everything seems to run fine. I'm guessing that the
"price" value the perl script gets from the HTML form is a string rather
than an integer and therefore is the reason I cannot mathmatically
manipulate it. Am I right about this? At any rate, can someone enlighten
me and tell me how to solve this problem?
Ramon
rmariano@u.washington.edu
------------------------------
Date: Tue, 02 Sep 1997 12:22:46 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Getting values from HTML forms...
Message-Id: <340f0495.401185954@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 2 Sep 1997 02:37:54 -0700, Ramon Mariano Jr
<rmariano@u.washington.edu> wrote:
>I have an HTML form where one of the input fields is named "price". It's
>just a normal text input field where the user types in a numerical value.
>Now, in my perl script, I take the value of "price" and manipulate it
>using very simple math. Here's the line in my script that seems to be the
>source of my problems:
>
> my $totalPrice = $FORM{'price'};
The library that you are using to get values from the browser may be
buggy. I'd suggest picking up CGI.pm from your local CPAN site.
>In other words, I'm attempting to store the value typed into the form
>field into a variable called "$totalPrice". However, this method doesn't
>seem to work since all of the subsequent calculations using the
>"$totalPrice" variable doesn't compute correctly. For testing purposes, I
>substituted the "$FORM{'price'}" to an arbitrary constant like this:
Can you display (or log) the value *before* you attempt calculations
with it?
> my $totalPrice = 30;
>
>After doing that, everything seems to run fine. I'm guessing that the
>"price" value the perl script gets from the HTML form is a string rather
>than an integer and therefore is the reason I cannot mathmatically
>manipulate it. Am I right about this?
No. Perl doesn't distinguish (in normal cases) between the two. It
tries to do the Right Thing based on the context in which you use the
variable.
>At any rate, can someone enlighten
>me and tell me how to solve this problem?
I've offered two suggestions. Hopefully one of them will shed some
light into the problem area.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 2 Sep 1997 07:56:12 GMT
From: Gordon McDorman <gordon.leslie.mcdorman@sap-ag.de>
Subject: Re: Help - Perl / cgi
Message-Id: <un2lww3mr.fsf@sap-ag.de>
>>>>> "Robbo" == Robbo <dforever@enterprise.net> writes:
Robbo> After a recent hard drive failure Perl5 is not working
Robbo> correctly on my machine.
[...]
Robbo> What happens is as soon as I un comment require
Robbo> "cgi-lib.pl" the server returns the following error message
Just a silly comment, but you did remember to re-install cgi-lib?
(it's not part of the standard Perl distribution -- not to mention
that you should probably be using cgi.pm instead)
When you run your script from the command line, and not from the
browser, do you get an error?
--
--------------------------------------------------------------
The opinions expressed above are mine, not my employer's.
gordon.leslie.mcdorman@sap-ag.de
------------------------------
Date: 2 Sep 1997 08:18:53 -0400
From: ajs@lorien.ajs.com (Aaron Sherman)
Subject: Re: Help - Perl / cgi
Message-Id: <5uh07e$ljv@lorien.ajs.com>
Robbo <dforever@enterprise.net> wrote:
>
>#!/usr/bin/perl5
#!/usr/bin/perl -w -Mstrict
># require "cgi-lib.pl";
You should be using CGI.pm from CPAN (it comes with 5.004). The reason
you are having a problem is because cgi-lib.pl does not exist, which
you would see in the error message if you ran this from the command-line
or looked in the server log.
Enjoy!
-AJS
------------------------------
Date: 2 Sep 1997 09:28:52 -0400
From: hambone@havoc.gtf.gatech.edu (Garzik)
Subject: Re: Help with Perl hooks on INN 1.5.1, please
Message-Id: <5uh4ak$hgg$1@havoc.gtf.gatech.edu>
In article <01bcb753$2df794a0$fc01fd0a@telsarlt.harmonic.com>,
Stan A. Rogge <srogge@telsarpc.harmonic.com> wrote:
>Perl 5 does not use dbmopen and dbmclose. It uses tie and untie. Also,
>you must define the type dbm you are using. Here is an example:
>
>use SDBM_File;
>[...]
You cannot use dbmopen, nor tie, without patching innd and nnrpd to
allow the use of the "use" clause.
Note that Perl 5 *does* use dbmopen and dbmclose, they are merely
aliases to tie and untie, for the AnyDBM module.
Jeff
--
Often statistics are used as a drunken man uses lampposts -- for support
rather than illumination.
------------------------------
Date: Tue, 02 Sep 1997 13:13:10 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Include external subroutines
Message-Id: <341310ad.404281455@igate.hst.moc.com>
[cc'd automagically to original author]
On Mon, 01 Sep 1997 10:16:21 +0200, Ake Johansson
<ets96aja@student.hk-r.se> wrote:
>Hello, I have a simple question I would appreciate if someone could help
>me with.
>
>I have made several Perl programs that are very similar to each other,
>my question is if it's possibly to put a subroutine in an external file
>and use something like "include" to call it from several other Perl
>programs?
>
>I would not like to make a module, since I'm not very familar with OO
>programing, I just want to put a subroutine in an external file...
Modules don't need to be OO.
You can create a separate file called "Blah.pm" and put the line:
package Blah;
at the top of it.
To use it in your program, just say:
use Blah;
See the perlmod docs for more info.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 2 Sep 1997 08:00:15 -0400
From: Aaron Sherman <ajs@ajs.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Password verification with a shadow file ??
Message-Id: <Pine.LNX.3.95.970902074653.22001B-100000@lorien.ajs.com>
On Mon, 1 Sep 1997, Tom Phoenix wrote:
> On 1 Sep 1997, Aaron Sherman wrote:
>
> > Tom Phoenix <rootbeer@teleport.com> wrote:
> >
> > >Why not? Here's one idea: Set up a root-privileged script (or daemon)
> > >which, when given a username and a password attempt, reports whether or
> > >not the attempt works. It wouldn't be too hard to make it secure, and it
> >
> > It would be impossible to make it secure.
>
> I believe that you're mistaken.
>
> > But it's still never going to be "secure" just "acceptable risk".
>
> Oh. Well, by that yardstick, sleeping is no better than an acceptable
> risk. After all, you might not wake up. :-)
I guess my point, here, was that you have to do the cost/benefit analysis.
For some people shadow passwords are just something that the OS stuck in
their way, and they don't care. For these people, a simple workaround
(perhaps even shutting off shadowing) is in order.
However, if you are living in a production business environment, you have
to ask yourself how much work it's worth to make your CGI use your
standard UNIX passwords, and if that's really the right thing to do in
the first place. I would even argue that it's much safer to have the CGI
use DIFFERENT passwords (even different usernames).
But again, it's cost/benefit. If you don't care, then don't pay.
-AJS
PS: I've recently developed sleep apnea, so going to sleep IS merely an
acceptable risk (and not very acceptable at that). ;-)
------------------------------
Date: Tue, 2 Sep 1997 13:00:21 GMT
From: Rajappa Iyer <rsi@earthling.net>
Subject: Re: perl and XEmacs
Message-Id: <EFvtGq.639@nonexistent.com>
link@tss.no (Terje Bless) writes:
> In article <uowyb5jl52i.fsf@tremere.ecte.uswc.uswest.com>,
> rjray@uswest.com (Randy J. Ray) wrote:
>
> >Are regex's hard to read? Yes.
> >Does Perl improve this? No.
>
> I disagree. Perl's Regular Expression syntax is the most legible of all
> implementations I've seen thus far (but I haven't by far seen `em all so
> YMMV). The addition of embedded comments in 5.003 has once and for all
> disspelled the myth that Perl code vaguely resembles line noise.
>
>
> m{ # Start of the m(atch) operator.
> [Rr]andy # upper or lower -case in case Randy gets sloppy
>
> \s # followed by a space
>
> ([Jj]\. )? # possibly followed by middle initial, period and space
>
> [Rr]ay # Deal with caseless last name
> }x; # End of m(atch) for R.J.'s name.
>
> Compare: "[Rr]andy\s([Jj]\.\s)?[Rr]ay".
>
> They are exactly the same regex, but the first is written for maintainer
> efficiency and the second for programmer efficiency.
I disagree... I find the second far more readable (perhaps due to
practice). The first alternative is simply noise and adds no useful
information to someone who knows regexps... and if they don't, they
have no business messing with the code anyway.
I think the embedded comments are along the lines of
j = i++; /* increment i by one after assigning its value to j */
Useful only if you want idiot managers reading your code and getting
warm fuzzies. Give me idiomatic code without microdocs any day.
--
<rsi@earthling.net> a.k.a. Rajappa Iyer New York, New York.
How can you tell when sour cream goes bad?
------------------------------
Date: 2 Sep 1997 12:37:16 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: Re: Perl for Win32 - Capturing output from backticks
Message-Id: <5uh19s$fup$1@news01.li.net>
This is the output:
C:\TEMP>perl -w foo.pl2
1 Volume in drive C is PW_GTC
2 Volume Serial Number is 3381-A956
3 Directory of C:\TEMP
4
5 . <DIR> 05-14-97 5:46p .
6 .. <DIR> 05-14-97 5:46p ..
7 BONUS EXE 9,511 06-17-97 7:59a bonus.exe
8 BAANQUIZ PL2 10,507 06-18-97 7:37a baanquiz.pl2
9 MAR96HCL DOC 475,121 03-04-96 9:14a MAR96HCL.DOC
10 BAANREQ PL2 9,074 06-18-97 7:37a baanreq.pl2
Of this program running on Activeware's port
@term = `dir`;
$i = 0;
while ($i < 10) {
$i = $i + 1;
print $i, " ", $term[$i];
}
So, I assume that the other poster is right, and you are using
ordinary tics rather than back tics (upper left on my keyboard).
Greg Ward (greg@bic.mni.mcgill.ca) wrote:
: Chris Dumas (cdumas@ibm.net) wrote:
: : I am trying to calculate the freespace on a directory. The only way I
: : can think of doing it is to capture the output from the DIR command and
: : process the output.
: : $dir_out = 'dir';
: : This however fails. Does anyone know why?????
: Two possibilities: first, those aren't backticks. They're forward
: single-quotes.
: Second, even if you were using the right syntax, are you sure backticks
: work under Windoze? Backticks are presumably implemented using pipes,
: and I don't know if Windoze (even Win32) works like Unix in this area.
: RTFM. (For your Perl port, that is.)
: Greg
: --
: Greg Ward - Research Assistant greg@bic.mni.mcgill.ca
: Brain Imaging Centre (WB201) http://www.bic.mni.mcgill.ca/~greg
: Montreal Neurological Institute voice: (514) 398-4965 (or 1996)
: Montreal, Quebec, Canada H3A 2B4 fax: (514) 398-8948
------------------------------
Date: 02 Sep 1997 11:33:59 +0100
From: Peter Riocreux <peter.riocreux@cs.man.ac.uk>
Subject: Perl interface to Cadence DFII WAL (Waveform Access Library)
Message-Id: <9kbu2cj97s.fsf@cs.man.ac.uk>
Simple question really, has anyone done any work on an interface I am
already doing significan post-processing on a waveform file in perl and
want to write it out in WSF format.
Anyone care to share any experiences/code with me?
Pete
--
Peter Riocreux, Amulet Group, Dept. Computer Science, Manchester University,
Oxford Road, MANCHESTER, M13 9PL, UK. <http://www.cs.man.ac.uk/amulet/>
Voice: +44 161-2753531 Mobile: +44 966-175986 Fax: +44 161-2756236
------------------------------
Date: Tue, 02 Sep 1997 01:13:35 GMT
From: jflowers@microft.org (John S Flowers)
Subject: Problem: Chop and Line Issues
Message-Id: <340b6578.675910119@news.transbay.net>
Greetings,
I am having a small issue with the chop command (or at least I think it's
the chop command).
I have the following information in a text file:
process = machine
I am doing the following (yes, it's a kludge):
while { # a valid while (this is just pseudo)
@ProcessA = split(/=/,$AllFile[$LineNo]);
foreach $Cnt ( 0...@ProcessA ) {
$ProcessA[$Cnt] =~ tr/ //d; #Truncate spaces
}
$Process[$Counter] = $ProcessA[0];
chop($Machine[$Counter] = $ProcessA[1]); #Remove EOL character
$Counter++;
}
Now, I try to display this information:
for ( $Num = 0; ; $Num++ ) {
$FullCommandLine = qq{$Process[$Num] -q $Machine[$Num] -q |};
print $FullCommandLine;
}
For some reason, each bit of text overwrites the last bit, so my printed
line ends up looking like, " -q | -q <machine>".
Is chop doing this?
Any ideas/insight would be welcome. Please follow-up to e-mail as well.
------------------------------
Date: 2 Sep 1997 12:10:43 GMT
From: burt@ici.net (Burt Lewis)
Subject: Re: Programming question
Message-Id: <5ugvo3$lck$1@bashir.ici.net>
Sounds like you need to store some counter values (color1=on,color2=off)
in a seperate file that your script is constantly looking at to decide what
is the next color to use.
Hope this helps.
Burt Lewis
www.eastonmass.com
In article <340B79A2.75B76B51@is.usmo.com>, wolverin@is.usmo.com says...
>
>I would like to make a script that, when I add a user to the database,
>it puts it in a table and makes the table a certain color, but when I
>add another user it puts in a table but makes that table a different
>color. And when I add person 3 its sets up three like one. And when I
>add person 4 it sets it up like 2.
>
>I also would like to make a script that, when I delete a person, the
>script will redo all the table colors so that they go color one, color
>two, color one, color two, and so forth.
>
>Please e-mail me at wolverin@is.usmo.com if you know the answer.
>Thanks
>
>Tim
>
------------------------------
Date: Tue, 02 Sep 1997 19:35:49 +1100
From: paulcol+usenet@andor.dropbear.id.au (Paul Colquhoun)
Subject: Re: Randal and Intel, Was: Scrambling using tr
Message-Id: <paulcol+usenet-ya02408000R0209971935490001@linux.andor.dropbear.id.au>
In article <nqo67slw9xs.fsf@mitra.phys.uit.no>, Tom Grydeland
<tom@mitra.phys.uit.no> wrote:
|Stuart Cooper <stuartc@ind.tansu.com.au> writes:
|
|> If you want to change a lowercase string with the alphabetic-complement like
|> Justin does; I suggest:
|>
|> #! /usr/local/bin/perl -w
|> $_="Intel Put Randal Inside";
|> $ZTOA=join('',reverse(('A'..'Z')));
|> eval "tr/a-z/$ZTOA/";
|> print "$_\n";
|
|Let's try that. And let's add the same transformation again, which
|should reverse the transformation:
|
|% perl
|$_="Intel Put Randal Inside";
|$ZTOA=join('',reverse(('A'..'Z')));
|eval "tr/a-z/$ZTOA/";
|print "$_\n";
|eval "tr/a-z/$ZTOA/";
|print "$_\n";^D
|IMGVO PFG RZMWZO IMHRWV
|IMGVO PFG RZMWZO IMHRWV
|
|Whoops. Perhaps you meant
|
|$ZTOA = join '', reverse('A'..'Z','a'..'z');
At which point you also need
eval "tr/a-zA-Z/$ZTOA/";
^^^
--
Reverend Paul Colquhoun, paulcol+sig@andor.dropbear.id.au
Universal Life Church http://andor.dropbear.id.au/~paulcol
"Say, can I use that quote in my book?"
-- Bartlett
------------------------------
Date: Tue, 02 Sep 1997 07:41:49 -0400
From: Matt Weber <mweber@vt.edu>
Subject: Script Time
Message-Id: <340BFB7D.79B@vt.edu>
I would like to put a line of text on my output page that says how long
it took to run the script...any suggestions? See altavista's addurl for
an example.
M. Weber
--
http://weberworld.com
[Live Broadcasts 24 hrs a day!]
------------------------------
Date: Tue, 02 Sep 1997 12:26:08 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Script Time
Message-Id: <34100556.401378772@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 02 Sep 1997 07:41:49 -0400, Matt Weber <mweber@vt.edu> wrote:
>I would like to put a line of text on my output page that says how long
>it took to run the script...any suggestions? See altavista's addurl for
>an example.
You could call the time() function at the beginning and end of your
script and compute the difference.
---snip---
my $start_time = time;
...
my $end_time = time;
my $elapsed_time = $end_time - $start_time;
print "Took $elapsed_time seconds.\n";
---snip---
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 02 Sep 1997 14:37:43 +0100
From: "James Sutherland, IT Services" <jasuther@dux.dundee.ac.uk>
Subject: Taint problem with setuid script
Message-Id: <340C16A7.D1548336@dux.dundee.ac.uk>
Help!
I have a setuid script which will be started by the httpd process on my
WWW server, and is owned by root. This then checks the authentication,
changes to running as that user, and finally create a file passed as an
environment variable.
The problem, though, is that perl refuses to let this run as it is a
setuid script and creates a file named by an environment variable.
Really, I would just like to run the script with taint checking disabled
- the file being named this way is *not* a problem, since it is only
created if the user who set that variable (authenticated by their logon
password through Solaris) is allowed to do so him/herself.
How can I either (a) disable this check, or (b) clear the tainted status
of that variable? (Yes, I could go and change the source code and build
myself a version of perl which ignores the setuid bit on files, but I
*really* don't like that idea...
James Sutherland
IT Services
University of Dundee
------------------------------
Date: Tue, 02 Sep 1997 03:57:50 -0700
From: CrAzY <guitarplayer@hotmail.com>
Subject: Time question..
Message-Id: <340BF12E.290C@hotmail.com>
Is this the best or most effecient way of getting the local time (as for
just hour, minute, am/pm)???
Does anyone know of any problems with this way of doing it, is there a
faster way, because I have a lot of traffic that keeps the last updated
time(s) for each person in a session file (in a chat) to know when they
last chatted, etc. I tried using the
"use Time::localtime;"
and it was poor. for example at 2:03 AM, it would just say 2:3 and that
was it, I didn't play with it, but should I use that? and if so, How can
I simply make it print the time like the following code, or is this as
good as it gets for performance. (I need all the little speed
improvements I can get)
($min, $hour) = (localtime(time))[1,2,3];
if (length ($min) < 2)
{
$min = "0" . $min;
}
$ampm = "AM";
$ampm = "PM" if ($hour > 11);
$hour = $hour - 12 if ($hour > 12);
$hour = 12 if ($hour == 0);
$current_time = "$hour:$min $ampm";
Is this a good way? I'm using perl 5.004_01..
------------------------------
Date: Tue, 02 Sep 1997 12:13:24 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Where can I get perl and how do I install it?
Message-Id: <340c02d1.400733624@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 02 Sep 97 06:37:15 GMT, stevebo@onramp.net (Steve Silberberg)
wrote:
>I have an old version of Perl that I downloaded and couldn't figure out how to
>install or "make".
>
>Can anyone point me to a Perl for Unix - Sun OS 4.1.2?
The answer lies on www.perl.com.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
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 960
*************************************