[6572] in Perl-Users-Digest
Perl-Users Digest, Issue: 197 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 28 20:07:21 1997
Date: Fri, 28 Mar 97 17:00:26 -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 Fri, 28 Mar 1997 Volume: 8 Number: 197
Today's topics:
'flock' equivelent for NT <pokorny@svkhk.cz>
[Q]: Pattern matching quandry... <mystery@itis.com>
Re: Concurrency Issues. <rootbeer@teleport.com>
Date-Time Conversion: backwards (Lee)
Re: does open(FH, "pgm arg1 arg2") take only 1 arg? (Tad McClellan)
Re: Does perl have constants? <mcampbel@tvmaster.turner.com>
Re: Does perl have constants? (Michael Shields)
Re: File Locking <tchrist@mox.perl.com>
Re: Forward- and Backslashes as Pathname Delimiters (Donald H. Locker)
Re: Get a week number from a file (John Jiang)
Help with Meta Tag (Parillo)
HELP: how to run perl under dos ? <josin@dimensional.com>
How run Perl locally? <kjetilpa@a.sol.no>
Re: How run Perl locally? (Tad McClellan)
Re: How to sort an arrary? <merlyn@stonehenge.com>
In need of a Perl script <jimreese@voicehouse.com>
Learning Perl and need some help. <sloscialo@chubb.com>
Re: Microsoft Running Naked Through the Streets? (Nate Patwardhan)
Re: New CGI column for an online magazine <kevlar@ns.net>
passing variables using SSI problem <basvreek@channels.nl>
Re: password-verification <seay@absyss.fr>
Perl hourly fees? <poon@sgi.com>
Re: Perl hourly fees? (Tad McClellan)
Re: Perl parser module w/ state? <tchrist@mox.perl.com>
Re: perl5 for sgi irix4.0.5?? (I R A Aggie)
perl5 string splitting question <patl@tencor.com>
Re: Problems Installing Perl 5 <scotth@sgi.com>
Q: sorting by date <r27975@email.sps.mot.com>
Re: Server Error-what's up? <rootbeer@teleport.com>
SourceSafe for PERL <steve@prilnari.com>
Re: Unix and ease of use (WAS: Who makes more ...) <tim@a-sis.com>
Re: where can I get oearl for OS/2 <seay@absyss.fr>
Win32: dbmopen wierdness (Tom Quick)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 Mar 1997 10:36:38 +0100
From: Jan Pokorny <pokorny@svkhk.cz>
Subject: 'flock' equivelent for NT
Message-Id: <333B9126.6AFA@svkhk.cz>
hello,
i'm a perl beginer and i am using it for cgi in netscape enterprise
server for windows nt. it doesn't support 'flock' command. could anybody
advise me how to sunstitute this command for nt envieroment?
thank you in advance,
jan pokorny@svkhk.cz
------------------------------
Date: Fri, 28 Mar 1997 09:06:27 -0500
From: Prince Mystery <mystery@itis.com>
Subject: [Q]: Pattern matching quandry...
Message-Id: <333BD063.6231@itis.com>
I have a variable that contains a pattern match string. When placed in
a search, it should return values for $1, $2, and $3.
The problem that I'm encountering is that this variable will, on
occasion, change the order upon which $1, $2, and $3 should be
examined. Is there a way to hard code in the pattern string which
specific substring values correspond with the predefined variables ($1,
et al)?
Thomas
------------------------------
Date: Fri, 28 Mar 1997 08:40:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Fred Van Andel <vanandel@intergate.bc.ca>
Subject: Re: Concurrency Issues.
Message-Id: <Pine.GSO.3.96.970328083906.1699L-100000@kelly.teleport.com>
On Fri, 28 Mar 1997, Fred Van Andel wrote:
> Newsgroups: comp.lang.perl.misc, comp.lang.perl
comp.lang.perl is no more. It has been removed. It doesn't exist. Just
ignore the newsgroup behind the curtain. There is no comp.lang.perl. Ask
your newsadmin to read the frequent posting about Bogus newsgroup names in
news.announce.newgroups.
> How do I create perl code that will allow for simultanous reading and
> writing of files by 2 different processes.
I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. Hope this helps!
http://www.stonehenge.com/merlyn/WebTechniques/
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Fri, 28 Mar 1997 15:39:57 GMT
From: DeathToSpam@dev.null.com (Lee)
Subject: Date-Time Conversion: backwards
Message-Id: <333be5ab.50756794@news.earthlink.net>
I haven't written any code for this, but am attempting to not
re-invent the wheel.
What I need is a script-snip that will convert a date-time entry into
perl time format, i.e. convert 03/28/96 into the number of seconds
since January 1 1970 (the exact opposite of the time function).
TIA
--Lee
Internet/Intranet Counsulting and Design:
http://www.designwest.com
Nurses' Call:
http://www.nurse.org/Nurses_Call/
------------------------------
Date: Fri, 28 Mar 1997 08:39:18 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: does open(FH, "pgm arg1 arg2") take only 1 arg?
Message-Id: <m6lgh5.us.ln@localhost>
Abigail (abigail@ny.fnx.com) wrote:
: You *ALWAYS* check the return value of open. Try:
Yes you do, but...
: open (JUNK, "start.pl $arg1 $arg2 |") or die "Eeps: $!";
^
^
: At least you will get a message that it fails, and most of the
^^^^^^^^^^^^^^^^^^^^^^^^^^^
: time, it will tell you why it failed as well.
This is a 'pipe open', which is a little different.
You will only get a message if the fork() fails. "Eeps..." will
_not_ get printed if, for example, start.pl does not exist.
>From the new Perl FAQ (part 8):
-----------------------------------------------------
=head2 Why doesn't open() return an error when a pipe open fails?
It does, but probably not how you expect it to. On systems that
follow the standard fork()/exec() paradigm (eg, Unix), it works like
this: open() causes a fork(). In the parent, open() returns with the
process ID of the child. The child exec()s the command to be piped
to/from. The parent can't know whether the exec() was successful or
not - all it can return is whether the fork() succeeded or not. To
find out if the command succeeded, you have to catch SIGCHLD and
wait() to get the exit status.
On systems that follow the spawn() paradigm, open() I<might> do what
you expect - unless perl uses a shell to start your command. In this
case the fork()/exec() description still applies.
-----------------------------------------------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 28 Mar 1997 17:28:30 -0500
From: Mike Campbell <mcampbel@tvmaster.turner.com>
Subject: Re: Does perl have constants?
Message-Id: <r5k9mrd52p.fsf@tvmaster.turner.com>
shields@crosslink.net (Michael Shields) writes:
> In article <5hfe7i$rn1$1@csnews.cs.colorado.edu>,
> Tom Christiansen <tchrist@mox.perl.com> wrote:
> > *PI = \3.14159.
>
> What are the pros and cons of this vs. `sub PI { 3.14159 }'?
One advantage is that it's _directly_ interpolatable in other scalars.
$x = "foo bar $PI baz";
whereas the sub method is not. Well, not without some cleverness.
------------------------------
Date: 28 Mar 1997 18:12:33 -0000
From: shields@crosslink.net (Michael Shields)
Subject: Re: Does perl have constants?
Message-Id: <5hh1mh$8b8$1@daedalus.crosslink.net>
In article <5hfe7i$rn1$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
> *PI = \3.14159.
What are the pros and cons of this vs. `sub PI { 3.14159 }'?
--
Shields, CrossLink.
------------------------------
Date: 28 Mar 1997 17:40:55 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: File Locking
Message-Id: <5hgvr7$5em$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
dbenhur@egames.com writes:
:It's not important to lock immediately after the open.
:It is important to exclusive-lock *before* writing, or
:to shared-lock before reading.
It's also important that you not write anything
derived from data fetched with a read lock.
Classic fiasco here:
open file
get shared lock
read datum
upgrade to exclusive lock
munge datum
write datum
close file
That won't work. You have to do this:
open file
get exclusive lock
read datum
munge datum
write datum
close file
It's really a shame that people are trying this stuff
without exposure to issues like critical sections, transaction
integrity, etc.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
/* we have tried to make this normal case as abnormal as possible */
--Larry Wall in cmd.c from the perl source code
------------------------------
Date: Sun, 23 Mar 1997 13:17:43 GMT
From: dhl@mrdog.msl.com (Donald H. Locker)
Subject: Re: Forward- and Backslashes as Pathname Delimiters
Message-Id: <E7HzLK.2tE@mrdog.msl.com>
[cc'd and posted]
I hope [expect] someone will correct me if I misremember, but I recall
that system expects a list to submit. Your system list looks like one
command (P_WAIT) with one argument
('SGMLBLD.EXE /INPUT:C:\BUILD\EB424\SGML-IN.BIF'). I think it should
look like:
$pid = system(P_WAIT, SGMLBLD.EXE, /INPUT:C:/BUILD/EB424/SGML-IN.BIF);
I don't know OS/2, but I believe it accepts forward slashes as path
component delimiters.
Hope this helps!
In article <858980372.12115@dejanews.com>, <rtanikella@rfbd.org> wrote:
>Hello,
>
>Perhaps this picks up on a thread that seems to have ended a while ago,
>but here it is: In Perl for OS/2, are the forward-slash and backslash
>both recognized as pathname delimiters? I encounter errors using system
>to call programs with arguments which are set off by forward slashes. So,
>for example:
>
>$pid = system(P_WAIT, 'SGMLBLD.EXE');
>
>will correctly attempt to spawn the process (which fails because there
>are no arguments); meanwhile,
>
>$pid = system(P_WAIT, 'SGMLBLD.EXE /INPUT:C:\BUILD\EB424\SGML-IN.BIF');
>fails with an error stating: Can't spawn "SGMLBLD.EXE
>/INPUT:C:\BUILD\EB424\SGML-IN.BIF": No such file or directory at
>n:systest.p line 58. system call returned the following:--->255<---
>
[...]
--
Donald.
These opinions were formulated by a trained professional.
DO NOT TRY THIS AT HOME!
At the time, the tone will be ... BEEP!
------------------------------
Date: 28 Mar 1997 15:49:00 GMT
From: jiangj@bnr.ca (John Jiang)
Subject: Re: Get a week number from a file
Message-Id: <5hgp9c$1qk@crchh327.rich.bnr.ca>
Hello,
I did what Fredrik has suggested and I got right output from
strftime( $sec, $min, $hour, $mday, $mon, $year) except the
day of the year (which is 01) and the week of the year (which
is 00 ). But I got current date right which is 27/2/97 ...
Any advice/suggestion? Thanks.
-John
Fredrik Lindberg (flg@vhojd.skovde.se) wrote:
: >>>> John Jiang wrote:
: > How can I get a week number of the time when a file is
: > created. The week number would be something like what we got from
: > shell "date -u +%W". Thanks.
: (Can you really get the "creation time"?)
: Heres one way of doing it (I am using the modification date of
: the file in this example)
: #!/usr/bin/perl
: #
: use POSIX;
: $filename = shift; # get filename from commandline
: # stat returns a lot of information, "man perlfunc" for more
: # information about the return values
: ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
: $atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
: # A shorter version of the above call would be
: #
: # $mtime = (stat($filename))[9]; # Modification date
: # $ctime = (stat($filename))[10]; # I-node change date
: #
: # Note the paranthesis around the call.
: # Now translate this time into something strftime can handle.
: # you will find information about localtime() in the perlfunc
: # man page
: ($sec,$min,$hour,$mday,$mon,$year) = localtime($mtime);
: # And finally call strftime .. check out "man strftime" for
: # more information about this function
: print strftime("%W", $sec, $min, $hour, $mday, $mon, $year);
: __END__
: Hope this helps
: /Fredrik
--
______________________________________________
|XXXX^____. _. ^XXXX| John Jiang
|XXX \__ | | | XXX| NORTEL, Richardson
|XX | |_| |__. XX|......................|
|X __| |..\ \ | X| 972-684-8344
|X____\___/__/_/_|_____X|_____jiangj@nortel.com
------------------------------
Date: 28 Mar 1997 13:10:32 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: Help with Meta Tag
Message-Id: <5hgg08$9t8@linet06.li.net>
I am passing a variable into a subroutine, and I have checked to ensure
that the variable is getting there. I would like to jump to a different
Perl script, but it does not seem to work. Because the variable I am
passing is an e-mail address, I have also tried to substitue a %40 for the
@sign but that did not help either. Do any of you have any ideas?
Code fragment follows:
sub Go {
my ( $loginid # The login id used to identify the user
) ;
#
# Assign arguments passed into the subroutine to variables
#
$loginid = $_[0];
#
# Jump to the greeting page, passing it the Login ID.
#
print "Content-type: text/html\n\n";
print "<HTML>", "\n";
print "<HEAD>", "\n";
print "<TITLE>Jump Page</TITLE>", "\n";
print "</HEAD>", "\n";
print "<BODY>", "\n";
print "<META HTTP-EQUIV=\"REFRESH\"
CONTENT=\"URL=/scripts/test/login.pl?loginid=$loginid\">";
print "</BODY>", "\n";
print "</HTML>", "\n";
}
------------------------------
Date: Fri, 28 Mar 1997 15:31:38 -0700
From: josin alvistur <josin@dimensional.com>
Subject: HELP: how to run perl under dos ?
Message-Id: <333C46CA.18F@dimensional.com>
hi, i have a wintel box, with perl4 loaded in.
i want to be able to call my scripts from any directory, while
in a dos window.
currently, i have to execute the script from the same directory
where perl.exe resides. else, i get the msg:
"Can't locate getopts.pl in @INC at...(script name)"
i have the directory where perl.exe resides in my path. thus, i have
no trouble invoking perl itself from anywhere.
but i have trouble executing scripts from other directories...
i tried using "perlgate". thanks to it, i can just
type the name of the script, if i am in any directory. but
with the same results... (same msg as above)
thanks for any pointers. - josin
------------------------------
Date: Fri, 28 Mar 1997 16:30:35 +0100
From: Kjetil Palmquist <kjetilpa@a.sol.no>
Subject: How run Perl locally?
Message-Id: <333BE41B.6818@a.sol.no>
I have installed Perl on my Win95 computer, and wonder how I run the
example scripts included.
When the script is placed on the web-server, I understand that the line
i.e
#!/local/perl
is included in the script.
But how shall this be handled when the script is run locally on my
WinPC?
Please reply to: kjetilpa@a.sol.no
------------------------------
Date: Fri, 28 Mar 1997 15:54:03 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How run Perl locally?
Message-Id: <rlehh5.dvc.ln@localhost>
[ emailed, posted]
Kjetil Palmquist (kjetilpa@a.sol.no) wrote:
: I have installed Perl on my Win95 computer, and wonder how I run the
: example scripts included.
: When the script is placed on the web-server, I understand that the line
: i.e
: #!/local/perl
: is included in the script.
: But how shall this be handled when the script is run locally on my
: WinPC?
from the perl FAQ part 3:
-------------------------------------------------
=head2 How can I get '#!perl' to work on [MSDOS,NT,...]?
For OS/2 just use
extproc perl -S -your_switches
as the first line in C<*.cmd> file (C<-S> due to a bug in cmd.exe's
`extproc' handling). For DOS one should first invent a corresponding
batch file, and codify it in C<ALTERNATIVE_SHEBANG> (see the
F<INSTALL> file in the source distribution for more information).
The Win95/NT installation, when using the Activeware port of Perl,
will modify the Registry to associate the .pl extension with the perl
interpreter. If you install another port, or (eventually) build your
own Win95/NT Perl using WinGCC, then you'll have to modify the
Registry yourself.
Macintosh perl scripts will have the the appropriate Creator and
Type, so that double-clicking them will invoke the perl application.
I<IMPORTANT!>: Whatever you do, PLEASE don't get frustrated, and just
throw the perl interpreter into your cgi-bin directory, in order to
get your scripts working for a web server. This is an EXTREMELY big
security risk. Take the time to figure out how to do it correctly.
=head2 Can I write useful perl programs on the command line?
Yes. Read L<perlrun> for more information. Some examples follow.
(These assume standard Unix shell quoting rules.)
# sum first and last fields
perl -lane 'print $F[0] + $F[-1]'
# identify text files
perl -le 'for(@ARGV) {print if -f && -T}' *
# remove comments from C program
perl -0777 -pe 's{/\*.*?\*/}{}gs' foo.c
# make file a month younger than today, defeating reaper daemons
perl -e '$X=24*60*60; utime(time(),time() + 30 * $X,@ARGV)' *
# find first unused uid
perl -le '$i++ while getpwuid($i); print $i'
# display reasonable manpath
echo $PATH | perl -nl -072 -e '
s![^/+]*$!man!&&-d&&!$s{$_}++&&push@m,$_;END{print"@m"}'
Ok, the last one was actually an obfuscated perl entry. :-)
-------------------------------------------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 28 Mar 1997 15:18:22 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Eric Poindexter <eric@nettown.com>
Subject: Re: How to sort an arrary?
Message-Id: <8cenczhd8x.fsf@gadget.cscaper.com>
>>>>> "Eric" == Eric Poindexter <eric@nettown.com> writes:
Eric> @unsorted = (
Eric> [qw(lastname2, firstname, date, phone, location, manager)],
Eric> [qw(lastname1, firstname, date, phone, location, manager)],
Eric> );
Of course, I'm pretty sure that Eric didn't mean to put the commas
in after each element in the qw(). Hint:
qw(fred, barney, dino)
is
"fred,","barney,"dino"
Bleh.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 521 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Fri, 28 Mar 1997 10:51:01 -0500
From: Jim Reese <jimreese@voicehouse.com>
Subject: In need of a Perl script
Message-Id: <Pine.LNX.3.91.970328103150.9428A-100000@voicehouse.com>
Please forgive me if this is an inappropriate request in this newsgroup.
My name is Jim Reese. I am Sales Manager for a small memory module
manafacturer. Memory prices flucuate on a daily basis and we receive a
lot of calls every day from customers regarding the current prices.
About half of our customer list is available through e-mail. I can save
a lot of man-hours just by being able to e-mail our price lists late each
afternoon after tomorrow's prices are determined.
My employer does not have access to the internet. I, personally, have a
dial-up Unix shell account with a local provider who operates basically
as a hobby. When I inquired as to how I might accomplish what I wanted
to do the response was something like "you need someone to write you a
perl script". To say there was no interest in giving me any further help
would qualify as an understatement.
I would like to be able to upload a plain ASCII price list to my home
directory and send it out to the several hundred clients with e-mail
addresses.
If anyone is interested in helping me, please contact me by e-mail at
jimreese@voicehouse.com
I do not frequent this newsgroup and will not see any replies posted here.
I thank you in advance for any help you can provide.
Jim Reese
Sarasota, FL
------------------------------
Date: 28 Mar 1997 15:40:54 GMT
From: "Sergio Loscialo" <sloscialo@chubb.com>
Subject: Learning Perl and need some help.
Message-Id: <01bc3b8e$1b30a960$aa1012ac@sloscialo.chubb.com>
I am very new to Perl and am having trouble with what I figured
should be relatively simple to do.
I want to test a variable to see if it is null or filled only with
whitespace.
How do I do this?
Thanks,
--
Sergio Loscialo
Chubb Computer Services
------------------------------
Date: 28 Mar 1997 16:34:33 GMT
From: nvp@bill-graham.nfic.com (Nate Patwardhan)
Subject: Re: Microsoft Running Naked Through the Streets?
Message-Id: <5hgrup$s4f$1@bob-marley.nfic.com>
I R A Aggie (fl_aggie@hotmail.com) wrote:
James> In article <5hc0e7$ger$1@bob-marley.nfic.com>, nvp@bill-graham.nfic.com
James> (Nate Patwardhan) wrote:
+ I've heard rumours that Microsoft is running naked through the
+ streets. Well I suppose it's their perogative, as they own the
+ streets they're running naked through.
James> Hey, as long as no one forces me to watch Bill G. run nekkid thru
James> the streets...
It's rumoured that running through the streets will become the
industry standard. :-)
Nate Patwardhan
nvp@nfic.com
nvp@shore.net
------------------------------
Date: Fri, 28 Mar 1997 14:18:17 -0800
From: "K. Healy" <kevlar@ns.net>
Subject: Re: New CGI column for an online magazine
Message-Id: <333C43A9.41C6@ns.net>
Ross D. Perkins wrote:
>
> Hello!
>
> I have recently attained the position of a writer for Go Insider
> (http://goinside.com), a wonderful online magazine. I'm going to be
> writing a CGI-specific column, dealing with Perl and C.
>
> What I would like to know is what are the types of things that all of
> you would be interested in hearing about? Do you think that most
> people would benefit from "How To" tutorials, or commentary, or
> something else?
Why don't you start with explaining Netiquitte, like why it's rude to
post CGI questions in a perl newsgroup without a inquiry to a CGI
newsgroup first. And why it's downright offensive to seek free help
from other people without having made any attempt to help yourself using
the tools that are freely available all over the internet (Dejanews,
Alta-Vista, etc.)
BTW, this isn't directed at you but if you are putting yourself in a
position to inform people, inform them on how to use and not abuse the
'net first. We'll all be happier for it, I know that Tad M. will be at
least... ;-)
Just my $.02,
Kevin
<kevlar@ns.net>
------------------------------
Date: 28 Mar 1997 16:14:03 GMT
From: "Bas van Reek" <basvreek@channels.nl>
Subject: passing variables using SSI problem
Message-Id: <01bc3b92$f6cfaa80$1c0d6dc2@pentium>
I have the following problem :
this :
<!--#exec cgi="/cgi-bin/script.cgi?variable"-->
does not work altough i have seen it working
on an other server, both running Apache.
What setting needs to be changed ?
this <!--#exec cgi="/cgi-bin/script.cgi"--> works fine.
------------------------------
Date: Fri, 28 Mar 1997 18:22:45 +0000
From: Douglas Seay <seay@absyss.fr>
To: cubasch@nrw-online.de
Subject: Re: password-verification
Message-Id: <333C0C75.5AA7@absyss.fr>
Cubasch wrote:
>
> Hi folks!
>
> I'm totally new to perl, but I'm looking for a possibility to check a
> user's name and password - the key is that the password is always the
> same, that is, it will work for everyone. But how can I manage to check,
> wether the user has typed the right password, while he/she surfs deeper
> into the site. There are the top-level html-pages that should be
> readable for everyone and only some pages, that are readable for people
> who know the password. So first: How can I automatically show the
> 'restricted' Document, after the user has entered the right password?
> The cgi-script should not generate the whole document, but there should
> be a way to load the existing document automatically, after the user has
> entered the correct password,
> and second: How can the server 'remember', that the user (you see: there
> is no database with usernames nor passwords, since there is only one
> 'fake'-password) already has entered the correct password, so that
> he/she must not type it in each time, he/she wants to view a restricted
> site.
>
> Awaiting lots of answers,
> best regards, Roman.
Roman,
You can compare the user supplied password with
your "fake-password" with the operator 'eq'.
It returns a TRUE value if the two strings are
the same.
You are more likely to get your answer about
showing/generating a document in a CGI
newsgroup, rather than in a Perl newsgroup.
Also, if the password is sent as plain
text (you don't say), then someone with
a sniffer can grab the password as it
bounces around the internet. This is
not a good idea if you are gaurding
important stuff, like money, SSNs, etc.
- doug
------------------------------
Date: Fri, 28 Mar 1997 09:34:05 -0800
From: Patrick Poon <poon@sgi.com>
Subject: Perl hourly fees?
Message-Id: <333C010D.41C6@sgi.com>
Hi folks,
I was just wondering...what's the going rate for a Perl programmer
nowadays?
Thanks!
Patrick
--
_______________________________________________________________________
Patrick M. Poon Office: (510) 824-1731
Field Marketing Representative Email: poon@sgi.com
Silicon Graphics, Inc.
Northern California Branch
3000 Executive Parkway, Suite 410 Pager: (510) 716-5684
San Ramon, CA 94583 Text Pager: poon_p@corp.sgi.com
_______________________________________________________________________
------------------------------
Date: Fri, 28 Mar 1997 16:18:49 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl hourly fees?
Message-Id: <94ghh5.p5d.ln@localhost>
Patrick Poon (poon@sgi.com) wrote:
: Hi folks,
: I was just wondering...what's the going rate for a Perl programmer
: nowadays?
>From zero to two hundred dollars per hour.
That's my cheeky way of saying "it depends" ;-)
I expect that the great bulk of Perl programming done by Independant
Contractors is in the $40-100/hour range.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 28 Mar 1997 15:49:52 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl parser module w/ state?
Message-Id: <5hgpb0$98$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Eric Kischell <keesh@cs.cmu.edu> writes:
:Hello,
:
:I am a Perl Newbie who would like to get "his hands wet" on a project at
:work. The project parses a messy log file for specific tokens and
:creates a pretty report file. When I looked on the module archive, they
:were listed in alpha/beta stage.
:The authors have been impossible to reach.
:
:modules
:-------
:String::MatchMany TOMC
:String::Text::Parser PATM
:
:Does anyone know of modules with similar functionality?
>From the perlfaq http://www.perl.com/perl/faq/index.html
Q: How do I efficiently match many regular expressions at once?
A: The following is super-inefficient:
while (<FH>) {
foreach $pat (@patterns) {
if ( /$pat/ ) {
# do something
}
}
}
Instead, you either need to use one of the experimental Regexp
extension modules from CPAN (which might well be overkill for
your purposes), or else put together something like this,
inspired from a routine in Jeffrey Friedl's book:
sub _bm_build {
my $condition = shift;
my @regexp = @_; # this MUST not be local(); need my()
my $expr = join $condition => map { "m/\$regexp[$_]/o" } (0..$#regexp);
my $match_func = eval "sub { $expr }";
die if $@; # propagate $@; this shouldn't happen!
return $match_func;
}
sub bm_and { _bm_build('&&', @_) }
sub bm_or { _bm_build('||', @_) }
$f1 = bm_and qw{
xterm
(?i)window
};
$f2 = bm_or qw{
\b[Ff]ree\b
\bBSD\B
(?i)sys(tem)?\s*[V5]\b
};
# feed me /etc/termcap, prolly
while ( <> ) {
print "1: $_" if &$f1;
print "2: $_" if &$f2;
}
--
Tom Christiansen tchrist@jhereg.perl.com
There ain't nothin' in this world that's worth being a snot over.
--Larry Wall in <1992Aug19.041614.6963@netlabs.com>
------------------------------
Date: Thu, 27 Mar 1997 13:16:06 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: perl5 for sgi irix4.0.5??
Message-Id: <fl_aggie-ya02408000R2703971316060001@news.fsu.edu>
In article <DB.97Mar27113334@sgx.neep.wisc.edu>, db@sgx.neep.wisc.edu wrote:
[IRIX 4.0.5 is another 'flea-bitten camel carcass' :]
+ Does anyone have an inst-able (or tardist) version of perl5
+ they could point me to??
No, not off hand. If there's one to be had, you'll need to ask about
it on comp.sys.sgi.misc.
You could try <url:http://www.madness.net/cgi-bin/wrap/software/SGI_freeware>
but I don't know if any of that stuff will run under v4.
James
--
Consulting Minster for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Fri, 28 Mar 1997 15:12:03 -0800
From: Pat Lashley <patl@tencor.com>
Subject: perl5 string splitting question
Message-Id: <333C5043.3B7D@tencor.com>
Hi,
I've got a question for the wizards: What is the BEST
way to split a string into equal-sized chunks? (The
chunk size is known a-priori; but the number of chunks
in the string is not.)
I can think of several ways to perform the split; but
none of them stands out as clearly better than, or even
less ugly than, the others.
[ For the morbidly curious, I need to split an array
of 'c' structures which is obtained from an X11 property.
One or more of the structs from the array will then be
unpacked and examined. Under some conditions an element
will be deleted or modified and the whole thing packed
back into a replacement for the property value. ]
Thanks,
-Pat
------------------------------
Date: 28 Mar 1997 15:52:36 -0800
From: Scott Henry <scotth@sgi.com>
Subject: Re: Problems Installing Perl 5
Message-Id: <yd8208zk20r.fsf@hoshi.corp.sgi.com>
>>>>> "N" == Nicola Pedrozzi <pedrozzi@cscs.ch> writes:
N> Scott Henry wrote:
>> Also, on IRIX 6.x,
N> If you are on Irix 6.x then you should have an 'inst'allable perl5
N> package from SGI, should be much easier (I don't remember from which
N> CD).
For IRIX-5.3, IRIX-6.2, and later you can install Perl5 from the
Freeware CDs (now online at:
https://www.sgi.com/TasteOfDT/public/freeware.html
), or the latest versions at:
http://reality.sgi.com/scotth/info/perl5.html
Since Perl5.003 ships with 6.4, the Freeware Perl5 has a few
conflicts. I should have a fixed version out soon (busy dealing
with a new job...).
--
Scott Henry <scotth@sgi.com> / Help! My disclaimer is missing!
IRIX MTS, / GIGO *really* means: Garbage in, Gospel Out
Silicon Graphics, Inc / http://reality.sgi.com/scotth/
------------------------------
Date: Fri, 28 Mar 1997 09:23:35 -0700
From: Brad Bosley <r27975@email.sps.mot.com>
Subject: Q: sorting by date
Message-Id: <333BF086.E03@email.sps.mot.com>
I have an associative array with the date (mm/dd/yy) as the keys.
When I do a sort(keys(%ARRAY)), it will of course sort by
month/day/year. What I really need is year/month/day. I was looking
for a slick way to do this sort, without having build a 2nd array keyed
with (yy/mm/dd).
Any Suggestions?
Thanks,
Brad Bosley
Motorola SPS
------------------------------
Date: Fri, 28 Mar 1997 08:19:05 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ken Zauter <zauter@usa.net>
Subject: Re: Server Error-what's up?
Message-Id: <Pine.GSO.3.96.970328081723.1699H-100000@kelly.teleport.com>
On 28 Mar 1997, Ken Zauter wrote:
> Newsgroups: comp.lang.perl, comp.lang.perl.misc
That there comp.lang.perl newsgroup has been discontinued. It's an
ex-newsgroup. It's reading articles in the hereafter. It has joined the
flamewar celestial. :-) Ask your news admin to check out the frequent
posting about Bogus newsgroup names in news.announce.newgroups.
> Subject: Server Error-what's up?
When you're having trouble with a CGI form in Perl, you should first look
at the please-don't-be-offended-by-the-name Idiot's Guide to solving such
problems. It's available on the perl.com web pages. Hope this helps!
http://www.perl.com/perl/
http://www.perl.com/perl/faq/
http://www.perl.com/perl/faq/idiots-guide.html
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Fri, 28 Mar 1997 12:29:11 -0600
From: Steve Wells <steve@prilnari.com>
Subject: SourceSafe for PERL
Message-Id: <333C0DF7.6E08@prilnari.com>
Does anyone know of a program like SourceSafe that I can use on our
BSDI or Linux machines with PERL?
TIA,
STEVE
------------------------------
Date: 28 Mar 1997 15:14:13 GMT
From: "Tim Behrendsen" <tim@a-sis.com>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <01bc3b8a$9d914440$87ee6fce@timpent.a-sis.com>
Michael Craft <jsi@idiom.com> wrote in article <5hg5nv$9cd@idiom.com>...
>
> You want a more productive capitalism? Scrap the copyright and
> patent laws and let the little guy, who has invented *everything*,
> unleash his creativity and capitalism will have a fighting chance;
> otherwise, socialism is better in all ways than capitalism, which
> inevitably leads to monopolization if it weren't for interference
> by the state.
Uh -- patents were invented to *protect* the little guy. Otherwise,
everytime the "little guy" invented something, the "big guy" would
simply use the idea, and blow out the little guy because of much
greater resources.
--
==========================================================================
| Tim Behrendsen (tim@a-sis.com) | http://www.cerfnet.com/~timb |
| "Judge all, and be prepared to be judged by all." |
==========================================================================
------------------------------
Date: Fri, 28 Mar 1997 18:10:01 +0000
From: Douglas Seay <seay@absyss.fr>
To: Christian Ascheberg <Christian.Ascheberg@welfen-netz.com>
Subject: Re: where can I get oearl for OS/2
Message-Id: <333C0979.7162@absyss.fr>
Christian Ascheberg wrote:
>
> hi,
>
> (I'm new here)
>
> where can I get pearl for OS/2?
First of all, it is "perl", not "peArl". Or I should say
that the A was dropped long ago.
Go to the CPAN site of your choice. I happen to use
ftp.pasteur.fr:/pub/computing/unix/perl/CPAN but you
can get the list from http:/www.perl.com/ and look
for CPAN. Just download the most recent version of
Perl (5.003 is stable, 5.004 has just gone beta).
OS/2 is one of the standard platforms for Perl.
While I've never built it for OS/2, it should build
without any problems.
While getting this, you should get the FAQ and
read it. It is well done and will help you avoid
a lot of stress. If you do much work in Perl,
buy the camel (ISBN 1-56592-149-6) because it is
also well done and has lots of good stuff.
Hope this helps.
- doug
------------------------------
Date: Fri, 28 Mar 1997 14:12:55 GMT
From: T.Quick@cs.ucl.ac.uk (Tom Quick)
Subject: Win32: dbmopen wierdness
Message-Id: <333bd19d.13073113@bas-a.bcc.ac.uk>
The perils of using Perl5 (win32) with a unix text-book:
Anyone know what the third 'file access permissions' parameter passed
to the dbmopen function should be for a windows perl script?
The compiler doesn't object to a 'chmod' style hex value, but this is
of course meaningless to Windows, and my dbm doesn't seem to exist...
Have tried the obvious places, honest...!
Tom Quick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Information Systems Research Group
Department of Computer Science
University College London
Gower Street Tel: +44 (0)171-419-3679
London WC1E 6BT Fax: +44 (0)171-387-1397
UK http://www.cs.ucl.ac.uk/staff/T.Quick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
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 197
*************************************