[11755] in Perl-Users-Digest
Perl-Users Digest, Issue: 5355 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 11 22:07:29 1999
Date: Sun, 11 Apr 99 19:00:23 -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 Sun, 11 Apr 1999 Volume: 8 Number: 5355
Today's topics:
A regexp solution without look-ahead/look-behind? (Dmitry Epstein)
Re: A regexp solution without look-ahead/look-behind? (Sam Holden)
Active Perl for NT and Mail from Web pages <gcd_jones@dial.pipex.com>
Re: Active Perl for NT and Mail from Web pages (Bill Moseley)
Re: Compiling Perl Scripts (Sam Holden)
Re: Count Linenumber (Jason Q.)
Re: Count Linenumber <uri@home.sysarch.com>
Re: Count Linenumber (Larry Rosler)
Re: Count Linenumber (Sam Holden)
Re: Couple of Questions <cmcurtin@interhack.net>
Re: dir list utility (David Efflandt)
Re: file upload with cgi-lib.pl <ffchopin@worldnet.att.net>
Re: form to email mails twice (David Efflandt)
Re: form to email mails twice (Larry Rosler)
Re: Hash symbol '%' a stylized what? (Sam Holden)
Help! Help! Simple question! <cuksa@cuksa.monisys.ca>
how to print random words from array on one line tzoko1000@my-dejanews.com
Re: implement useradd in perl (Sam Holden)
Re: Is it possible to have "..." appear while processin (Sam Holden)
Re: LWP::UserAgent and POST <gisle@aas.no>
Re: Multiple page forms (David Efflandt)
Re: Pays to use single, rather than double, quotes? <gisle@aas.no>
Re: Pays to use single, rather than double, quotes? (Larry Rosler)
Re: Pays to use single, rather than double, quotes? <tchrist@mox.perl.com>
Re: Perl Development Environment <dermot.musgrove@virgin.net>
Re: Perl Development Environment <tchrist@mox.perl.com>
Re: Perl Development Environment <tchrist@mox.perl.com>
Re: Perl Development Environment (Aaron)
Re: Privacy for ...A followup question (Luca Filipozzi)
Problem with file handle(s) <softsci@eagle.ca>
Re: Problem with file handle(s) <ffchopin@worldnet.att.net>
Re: protecting perl scripts (Dmitry Epstein)
Re: question about hash keys (M.J.T. Guy)
Re: question about hash keys (M.J.T. Guy)
Re: question about hash keys (Larry Rosler)
Re: start a background process and let it go.. (Sam Holden)
Re: Win32 Mail Client <seugenio@man.amis.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 10 Apr 1999 20:59:44 GMT
From: mitiaNOSPAM@nwu.edu.invalid (Dmitry Epstein)
Subject: A regexp solution without look-ahead/look-behind?
Message-Id: <3710bb71.14051986@news.acns.nwu.edu>
I am writing a keyword search engine. Most engines either don't allow
non-alphanumerics in keywords or simply ignore the issue. I want to
make so that any character can be used (apart from a small set used
for the query syntax).
The problem is that when I use this idiom:
/\b$pattern\b/g
it fails if the pattern has a non-alphanumeric character at the
beginning or at the end, e.g. the keyword '@home' would fail in a word
context because the boundary between '@' and the previous character is
not a word boundary.
One solution is to use zero-width look-ahead/look-behind:
/(?<=\W)$pattern(?=\W)/g
but I don't want to do this, because this feature is not supported in
versions prior to 5.005.
Using this:
/\W$pattern\W/g
won't work if two matches are next to each other in the search string,
e.g. in the string ' @home @home ' only the first word would be
matched. Inserting extra spaces is kind of awkward.
Does anyone have other ideas?
Thanks,
Dmitry
--
Remove NOSPAM and .invalid from mitiaNOSPAM@nwu.edu.invalid
------------------------------
Date: 12 Apr 1999 01:37:15 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: A regexp solution without look-ahead/look-behind?
Message-Id: <slrn7h2jib.1kh.sholden@pgrad.cs.usyd.edu.au>
Dmitry Epstein <mitiaNOSPAM@nwu.edu.invalid> wrote:
>
>The problem is that when I use this idiom:
>
> /\b$pattern\b/g
>
>it fails if the pattern has a non-alphanumeric character at the
>beginning or at the end, e.g. the keyword '@home' would fail in a word
>context because the boundary between '@' and the previous character is
>not a word boundary.
You could check the first and last characters of $pattern and use the
appropriate case of 'b'.
--
Sam
Even if you aren't in doubt, consider the mental welfare of the person
who has to maintain the code after you, and who will probably put parens
in the wrong place. --Larry Wall
------------------------------
Date: Mon, 12 Apr 1999 00:50:43 +0100
From: "Gareth Jones" <gcd_jones@dial.pipex.com>
Subject: Active Perl for NT and Mail from Web pages
Message-Id: <7erck4$mci$1@plug.news.pipex.net>
Hi, I', fairly new to perl and I'm trying to get the contents of a webpage
form emailed through a mail server.
I have:
Active Perl 506e,
a box running NT 4 SP3 with
email server software running locally,
less hair than I started with!
I am trying to achieve:
a script that can be used instead of sendmail that can be passed a few
params like from: to: and the contents and will just send it to an existing
mail server via smtp (validity checking would be nice later but not bothered
yet) without having to put anything in the winnt directory or registry for
each user.
I have tried looking around and have just got confused as everything seems
to need something else.
I was going to use the basic script on active states web page:
use Net::SMTP;
$smtp = Net::SMTP->new('raid'); # connect to an SMTP server
$smtp->mail( 'someone@somewhere.com' ); # use the sender's address here
$smtp->to('someone@somewhere.com'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
#
$smtp->datasend("To: user@there.com\n");
$smtp->datasend("From: user@here.com\n");
$smtp->datasend("\n");
# Send the body.
#
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
but this needs net::smtp which I think is part of libnet I tried
downloading libnet and got the instructions:
perl Makefile.PL
make
make test
make install
I ran the first one fine then got lost on the second, it's not a dos command
so I tried it as a perl script which did nothing but didn't error so I tried
the second and third this way and they came back with errors so I'm lost.
If I need to install libnet how do I do it?
Any help would be greatly appreciated
Thanks,
Gareth
------------------------------
Date: Sun, 11 Apr 1999 17:15:14 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Active Perl for NT and Mail from Web pages
Message-Id: <MPG.117adaec1ac497f198972f@206.184.139.132>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <7erck4$mci$1@plug.news.pipex.net>, gcd_jones@dial.pipex.com
says...
> Hi, I', fairly new to perl and I'm trying to get the contents of a webpage
> form emailed through a mail server.
> but this needs net::smtp which I think is part of libnet I tried
> downloading libnet and got the instructions:
If you are using ActiveState's perl, use PPM to install libnet.
http://www.activestate.com/packages/default.prk?list=1
has a list of modules you can load with PPM
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: 12 Apr 1999 01:52:39 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Compiling Perl Scripts
Message-Id: <slrn7h2kf7.1kh.sholden@pgrad.cs.usyd.edu.au>
On Sun, 11 Apr 1999 16:50:04 GMT, JDDemme <jddemme@technologist.com> wrote:
>EXE's are platform-dependant, so no..... But, if you want a
>platform-independant program(not script), your best bet is JAVA.... You may
>be able to find a program to convert perl code to java code.........
>Maybe.....
>If you do, please let me know.
Java needs a VM with a large amount of library classes...
Perl needs an interpreter with a large amount of modules...
How does Java gain you anything?
I would expect that perl is available on more platforms than Java is.
--
Sam
People get annoyed when you try to debug them.
--Larry Wall
------------------------------
Date: Mon, 12 Apr 1999 00:12:36 GMT
From: pigs_can_fly@mindless.com (Jason Q.)
Subject: Re: Count Linenumber
Message-Id: <3711395a.1645460@news.cyberway.com.sg>
I'm no expert at perl but I use this (seemingly simple) way to count
the number of lines.
open (FILE, "file.txt") || die;
@array = <FILE>;
close (FILE);
$lines = $#array+1;
My question is, why don't the experts recommend this way?
Jason Q.
----------------------------------------------------------------------
Frank de Bot <debot@xs4all.nl> wrote:
>How can I count the number of lines WITHOUT a loop in a file?
>and how can I count the number of lines WITHOUT a loop that are
>containing something in a file?
>Thanks.
>
>
>--
> \\\|///
> \\ - - //
> ( @ @ )
>/----------------------oOOo-(_)-oOOo--------------------\
>| |
>| |
>| My Email: debot@xs4all.nl |
>| Homepages: http://www.searchy.net/ |
>| http://www.debot.nl/ppi/ |
>| |
>| |
>\-------------------------------Oooo--------------------/
> oooO ( )
> ( ) ) /
> \ ( (_/
> \_)
>
>
------------------------------
Date: 11 Apr 1999 21:36:28 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Count Linenumber
Message-Id: <x71zhqr55v.fsf@home.sysarch.com>
>>>>> "JQ" == Jason Q <pigs_can_fly@mindless.com> writes:
JQ> open (FILE, "file.txt") || die;
JQ> @array = <FILE>;
JQ> close (FILE);
JQ> $lines = $#array+1;
JQ> My question is, why don't the experts recommend this way?
1. you read in the entire file into memory at once which can be a memory
hog and even use up more cpu.
2. the line count is better done with @array than your expression.
3. if all you want is line counts, use wc
uri (a so-called expert)
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Sun, 11 Apr 1999 18:31:22 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Count Linenumber
Message-Id: <MPG.117aecc12ea3851989892@nntp.hpl.hp.com>
In article <3711395a.1645460@news.cyberway.com.sg> on Mon, 12 Apr 1999
00:12:36 GMT, Jason Q. <pigs_can_fly@mindless.com >says...
> I'm no expert at perl but I use this (seemingly simple) way to count
> the number of lines.
>
> open (FILE, "file.txt") || die;
> @array = <FILE>;
> close (FILE);
>
> $lines = $#array+1;
$lines = @array; # A lot clearer!
> My question is, why don't the experts recommend this way?
Because it is inefficient. It reads the entire file into memory,
splitting it up into members of an array, which is then not used.
Possible improovements might be to dispense with the array:
$lines = () = <FILE>;
Or to read the file into a string and count the newline characters:
$lines = do { local $/; (my $file = <FILE>) =~ tr/\n// };
Or to do the following, which gives a solution that works efficiently no
matter how big the file is: RTTFAQ!
perlfaq5: "How do I count the number of lines in a file?"
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 12 Apr 1999 01:42:32 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Count Linenumber
Message-Id: <slrn7h2js8.1kh.sholden@pgrad.cs.usyd.edu.au>
On Mon, 12 Apr 1999 00:12:36 GMT, Jason Q. <pigs_can_fly@mindless.com> wrote:
>I'm no expert at perl but I use this (seemingly simple) way to count
>the number of lines.
>
>open (FILE, "file.txt") || die;
>@array = <FILE>;
>close (FILE);
>
>$lines = $#array+1;
>
>
>My question is, why don't the experts recommend this way?
Probably because it reads the whole file into memory, which is a
particularly bad thing to do for those big files that seem to
lie around in /var/log...
$lines++ while <FILE>; #or just use $.
is shorter and doesn't slurp the whole file into memory.
--
Sam
Perl was designed to be a mess (though in the nicest of possible ways).
--Larry Wall
------------------------------
Date: 11 Apr 1999 18:30:49 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: Couple of Questions
Message-Id: <xlx4smmlrhi.fsf@gold.cis.ohio-state.edu>
>>>>> Tom Christiansen <tchrist@mox.perl.com> writes:
TomC> You sent me a stealth CC. *BAD*! Look at my header line above.
TomC> Go thou and do likewise.
Okay... let's see...
TomC> Message-ID: <370f7a51@csnews>
You sent an illegitimate Message-ID. (RFC 1036 explicitly requires
the host-part of Message-IDs to be fully qualified.) *BAD*! Look at
my header. Go thou and do likewise.
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: 12 Apr 1999 00:15:29 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: dir list utility
Message-Id: <slrn7h2emb.gv.efflandt@efflandt.xnet.com>
On 10 Apr 1999 07:46:07 GMT, BLUESRIFT <bluesrift@aol.com> wrote:
>>What about just using opendir/readdir?
>>
>>see the docs ;
>>
>>perldoc -f opendir
>>perldoc -f readdir
>>
>>HTH.
>
>Actually, I have already tried that and am able to get a listing when I supply
>an absolute path eg /absolutepath/ but when I substitute a valid http:// path
>no listing is produced. What am I doing wrong?
You are using a URL path when this only works with system paths. So you
need to generate the list from some starting point and then substitute the
URL path for the start of the system path (or construct html output with
complete links).
>print "Directory Listing\n";
>opendir THEDIR, "http://www.myplace.com/" || &dienice('nodir',$!);
>@allfiles = readdir THEDIR;
>closedir THEDIR;
>foreach $file (@allfiles) {
>print "$file\n";
>}
>print "-list complete-\n";}
>
>Thanks!
>Rob Bell
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: Sun, 11 Apr 1999 21:51:59 -0400
From: "Jason Simms" <ffchopin@worldnet.att.net>
Subject: Re: file upload with cgi-lib.pl
Message-Id: <7erjkt$nj5$1@bgtnsc01.worldnet.att.net>
> I am having great difficulties in working out how to use cgi-lib.pl to
> do File Uploading. I have put together the following script based the
> documentation for cgi-lib.pl however I am unsure as to where exactly
> these files are ending up, if they are actually being saved anywhere at
> all. Do I have to print the data out somewhere? If so, how? Any help
> would be excellent!
Are you learning CGI programming from one of those SAMS books? They are (or
at least were) a big proponent of cgi-lib.pl, which is now outdated in favor
of the more robust and user-freindly cgi.pm. Two pieces of advice:
1. Learn to use cgi.pm. To do this, use the Official Guide to Programming
with CGI.pm, by Lincoln Stein (he wrote the module, also). I think you will
see that it will make life a little easier, and the book even has sample
scripts dealing with file uploads.
2. Please take any further CGI question to
comp.infosystems.www.authoring.cgi, where you will find your questions are
much more on-topic.
Good luck!
Jason Simms
------------------------------
Date: 12 Apr 1999 00:26:31 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: form to email mails twice
Message-Id: <slrn7h2fb3.gv.efflandt@efflandt.xnet.com>
On Fri, 09 Apr 1999 14:38:54 -0400, steve schwarz <firetips@taconic.net> wrote:
>hi
>
>i'm very new to perl, i have a very simple form whose sole purpose is to
>take data from a field and email to an adress. it works but it emails
>twice (the first mailing is correct, the second mailing shows a portion
>of what is supposed to be sent).
>
>the form in the html doc looks like this
>
>
>
><form method="post" action="http://www.firetips.com/cgi-bin/link.cgi">
><pre><b>
>enter address here HTTP://WWW.<input type="text" name="http" size=20>
><input type="submit" value="Request">
>
></b></pre>
> </form>
>
>
>
>
>
>
>THE perl doc looks like this
>
>#!/bin/perl
> require "cgi-lib.cgi";
> &ReadParse(*form_data);
>
> require "ftsubs.cgi";
>
>$mailprogram = "/bin/sendmail -t";
>
>open (MAIL,"|$mailprogram");
>print MAIL "To: $mail\n";
>print MAIL "Subject: 'Link Request'\n\n";
>print MAIL qq!
> $form_data{'http'} \n
> http://www.$form_data{'http'} \n
>
>!;
>close MAIL;
>
>
>
>
>
>THE ftsubs.cgi document which is required is this
>
>#!/bin/perl
>
>$mail = "firetips\@firetips.com";
I don't think you want to escape the @ here (it may do the opposite of
what you think it does). But to be on the safe side try single quotes:
$mail = 'firetips@firetips.com';
>am i doing something wrong in my script that is causing the mail program
>to mail twice or is there possibly a problem with the network
>
>
>mike cardeiro
>
>
>
>
> -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
> http://www.newsfeeds.com/ The Largest Usenet Servers in the World!
>---------== Over 72,000 Groups, Plus Dedicated Binaries Servers ==--------
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: Sun, 11 Apr 1999 18:15:38 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: form to email mails twice
Message-Id: <MPG.117ae909a7e21ecf989891@nntp.hpl.hp.com>
In article <slrn7h2fb3.gv.efflandt@efflandt.xnet.com> on 12 Apr 1999
00:26:31 GMT, David Efflandt <efflandt@xnet.com >says...
> On Fri, 09 Apr 1999 14:38:54 -0400, steve schwarz <firetips@taconic.net> wrote:
...
> >$mail = "firetips\@firetips.com";
>
> I don't think you want to escape the @ here (it may do the opposite of
> what you think it does).
I'll wager that he thinks it stops perl from trying to interpolate a
non-existent array named @firetips. What do *you* think it does (and
what would it do without the backslash)? Did you try it on a recent
version of perl, before posting?
> But to be on the safe side try single quotes:
>
> $mail = 'firetips@firetips.com';
That works too, and is preferable IMO. But the other way is correct
also.
By the way, if you are going to comment on one bit in a long post (in
this case one line out of 67), it is kind to isolate the text, as I have
done.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 12 Apr 1999 01:50:00 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Hash symbol '%' a stylized what?
Message-Id: <slrn7h2ka8.1kh.sholden@pgrad.cs.usyd.edu.au>
On Sun, 11 Apr 1999 17:08:10 GMT, Bart Lateur <bart.lateur@skynet.be> wrote:
>John Callender wrote:
>
>>$ is a stylized 's' for 'scalar'
>>@ is a stylized 'a' for 'array'
>
>Wacky. However, it is very likely that it's actually inherited from
>shell scripting. Which shell? dunno.
But still a useful way for a beginner to remember quickly what those
strange symbols that lie strewn thoughout the perl code mean...
>
>>but I can't remember what, if anything, the hash's '%' was supposed to
>>represent, and I haven't been able to track down the original source.
>
>"The other thing"? :-)
The mod operator... Often used in hash implementations...???
--
Sam
Another result of the tyranny of Pascal is that beginners don't use
function pointers.
--Rob Pike
------------------------------
Date: Sun, 11 Apr 1999 20:16:14 -0400
From: CUKSA <cuksa@cuksa.monisys.ca>
Subject: Help! Help! Simple question!
Message-Id: <37113B4D.5594D9E2@cuksa.monisys.ca>
Hi.
I using DB to store some information using perl CGI.
It creats files but I can't access that DB file from other CGI script.
I looked at file and it is owned as nobody, so I try to change to
read & write mode for all, but it won't allow me to do it.
I come up with another idea that is to create DB file before run cgi
script as read & write mode, but that way, my CGI script won't open
that DB file.
Please help me, if anybody knows about this.
part of my code look like this:
tie (%myDB, DB_File, "mailinglist.db", O_RDWR|O_CREAT, 0666,
$DB_HASH)
|| die "Can\'t open db file\n";
Thanks in advance.
------------------------------
Date: Sun, 11 Apr 1999 23:16:41 GMT
From: tzoko1000@my-dejanews.com
Subject: how to print random words from array on one line
Message-Id: <7eragj$c8u$1@nnrp1.dejanews.com>
Hello,
I'm new to perl and I can't find a solution to a problem for 2
days. I bet it's something very easy :)
I have a database file, I extract it to an array and I want to take random
words from the array.
the database file is like this :
word1
word2
word3
etc.
I open it and store it to an array with this
open(INF,"urls.txt") or &dienice("Can't open survey.out");
@ary = <INF>;
close(INF);
I want to print out randomly something like this :
word3 with word1 blah blah word2
I do it with this
print "$ary[rand(@ary)] with $ary[rand(@ary)] blah blah $ary[rand(@ary)]
\n";
the problem is it prints out
word3
with word1
blah blah word2
Ivan
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 11 Apr 1999 23:26:51 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: implement useradd in perl
Message-Id: <slrn7h2btq.ptm.sholden@pgrad.cs.usyd.edu.au>
Jonathan Ho <t0.ho@student.qut.edu.au> wrote:
>How do i write the perl shell script to implement the "useradd " command?
The same way you would write it in c or sh.
Work out what it needs to do... Which is probably add a new entry to the
passwd and group files... Create the apropriate home directory. Copy the
appropriate files into the startup directory. POssibly create a mail
spool (though your mail delivery system may do that when it firsts get mail)...
And whatever else you need to do on your system using your policies.
The you implement those things in perl. The documentation in the perlfunc
man page would be particularly useful for a lot of the above.
--
Sam
You can blame it all on the internet. I do...
--Larry Wall
------------------------------
Date: 11 Apr 1999 23:29:08 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <slrn7h2c24.ptm.sholden@pgrad.cs.usyd.edu.au>
On 11 Apr 1999 02:31:29 GMT, I R A Aggie <fl_aggie@thepentagon.com> wrote:
>On Sat, 10 Apr 1999 10:50:37 -0500, Poohba <poohba@io.com>, in
><Pine.BSF.4.05.9904101039090.19025-100000@schultz.io.com> wrote:
>
>+ I say ... i mean the dots keep coming til program is complete.
>
>while($some_long_assed_loop) {
> print ".";
> something;
> another;
> and_another;
>}
>print "finished!\n";
Because output is buffered try adding $|=1; at the top...
--
Sam
I took the initiative in creating the Internet.
--Al Gore
------------------------------
Date: 11 Apr 1999 22:48:53 +0200
From: Gisle Aas <gisle@aas.no>
Subject: Re: LWP::UserAgent and POST
Message-Id: <m3yajyubm2.fsf@eik.g.aas.no>
hombre@nowhere.no (S E Lehtinen) writes:
> I have had such similar problem that the standard LWP library does not
> support https GET nor POST, although the documentation shortly
> mentions those. Should they work without any special tricks if SSLeay
> is installed?
Yup!
--
Gisle Aas
------------------------------
Date: 12 Apr 1999 02:01:45 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Multiple page forms
Message-Id: <slrn7h2ktk.hr.efflandt@efflandt.xnet.com>
On Fri, 09 Apr 1999 21:16:24 GMT, Alan Gilman <nospam@gctech.net> wrote:
>Is there a clear set of directions on how to create multiple page forms.
>I have many good working HTML forms using Perl on my Web server, but I
>would like to know how to gather information from multiple form pages
>before creating the final input.
>
>--
>To reply directly change nospam to news.
>Alan Gilman
>Gilman Computer Technologies
>Read TorahBytes! http://torahbytes.org/
Future CGI questions should be posted to a cgi newsgroup.
As long as you do not have anything private you need to pass from form to
form, simply generate and process the forms from a single script, using
hidden fields to pass data from previous forms. If they have to enter
something like a credit card number (assuming a secure server) have them
do that on the last form. You can differentiate which form is being
received by the script by using different names for the submit button or
different values for a hidden variable. You can still keep some things
separated by using a subroutine for eadh form while taking advange of
other subroutines and variables for common parts (like parsing form data
and printing page headers).
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: 12 Apr 1999 00:40:01 +0200
From: Gisle Aas <gisle@aas.no>
Subject: Re: Pays to use single, rather than double, quotes?
Message-Id: <m3d81a7pdq.fsf@eik.g.aas.no>
lr@hpl.hp.com (Larry Rosler) writes:
> In article <3711031d$0$27373@nntp1.ba.best.com> on 11 Apr 1999 20:16:29
> GMT, John Callender <jbc@shell2.la.best.com >says...
> > One more dumb question about single- vs. double-quoted strings: If I
> > know that I don't want interpolation of variables or interpretation of
> > backslash escapes, is it in my interest to use single quotes rather
> > than double quotes to delimit my strings? What I mean is, is there some
> > kind of performance benefit to my script, over and above whatever
> > benefit I get from not having to escape literal $'s and @'s in my
> > double-quoted string?
>
> There is a minuscule performance benefit to single quotes.
I doubt this. They both compile down to the same op-codes.
(For perl4 there was a difference.)
--
Gisle Aas
------------------------------
Date: Sun, 11 Apr 1999 16:20:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Pays to use single, rather than double, quotes?
Message-Id: <MPG.117ace01824b8ea098988f@nntp.hpl.hp.com>
In article <m3d81a7pdq.fsf@eik.g.aas.no> on 12 Apr 1999 00:40:01 +0200,
Gisle Aas <gisle@aas.no >says...
> lr@hpl.hp.com (Larry Rosler) writes:
> > There is a minuscule performance benefit to single quotes.
>
> I doubt this. They both compile down to the same op-codes.
>
> (For perl4 there was a difference.)
I was referring to the time to compile the string, not the time to
access it which is of course the same.
The following benchmark seems to show a tiny speed edge to compiling the
single-quoted string, but it is near the noise level. I have run it
several times, and observed differences between 0 and 3% (higher
percentage if you subtract out the control measurement, but still very
noisy).
#!/usr/local/bin/perl -w
use Benchmark;
timethese(1 << (shift || 0), {
DQ => q { my $x = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" },
SQ => q { my $x = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' },
XX => q { my $x = '' },
});
__END__
Benchmark: timing 1048576 iterations of DQ, SQ, XX...
DQ: 3 wallclock secs ( 3.69 usr + 0.00 sys = 3.69 CPU)
SQ: 2 wallclock secs ( 3.58 usr + 0.00 sys = 3.58 CPU)
XX: 3 wallclock secs ( 2.75 usr + 0.00 sys = 2.75 CPU)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 11 Apr 1999 18:44:47 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Pays to use single, rather than double, quotes?
Message-Id: <371141ff@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
lr@hpl.hp.com (Larry Rosler) writes:
:Benchmark: timing 1048576 iterations of DQ, SQ, XX...
: DQ: 3 wallclock secs ( 3.69 usr + 0.00 sys = 3.69 CPU)
: SQ: 2 wallclock secs ( 3.58 usr + 0.00 sys = 3.58 CPU)
: XX: 3 wallclock secs ( 2.75 usr + 0.00 sys = 2.75 CPU)
I don't thing that's significantly meaningful.
timing 1048576 iterations of DQ, SQ, XX...
DQ: 6 wallclock secs ( 1.48 usr + 0.00 sys = 1.48 CPU)
SQ: 4 wallclock secs ( 1.46 usr + 0.00 sys = 1.46 CPU)
XX: 3 wallclock secs ( 1.41 usr + 0.00 sys = 1.41 CPU)
Plus, benchmarks on fixed data prove very little. It's like
knowing the speed but not the velocity or acceleration.
What happens when the strings are 1/10th that length? Or 10x the
length? Or 100x?
I like to use "" because they stand out better. I reserve the
tick for a package separator.
--tom
PS: Just kidding. :-)
--
It is Unix. It is possible to overcome any number of these bogus features. --pjw
------------------------------
Date: Sun, 11 Apr 1999 22:25:17 +0000
From: Dermot Musgrove <dermot.musgrove@virgin.net>
Subject: Re: Perl Development Environment
Message-Id: <3711214D.1C1FC7C5@virgin.net>
Dimitri Ostapenko wrote:
>
> JDDemme wrote:
>
> > Does a good perl dev environment exist?
> > For linux?
> >
> > I'm sick of going to Elvis(vi) then out and typing ./XXXXX!!!! then back to
> > elvis, and out to command line.
> >
> > Thanks,
> > JDDemme
> > jddemme@technologist.com
>
> Ever tried MultiEdit (http://www.softexport.com/multiedit.htm) ?
>
Or NEdit (free) from ftp://ftp.fnal.gov/pub/
--
Dermot Musgrove
email dermot.musgrove at virgin.net
URL http://freespace.virgin.net/dermot.musgrove/
------------------------------
Date: 11 Apr 1999 18:36:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl Development Environment
Message-Id: <37114009@csnews>
In comp.lang.perl.misc, jddemme@technologist.com writes:
:Does a good perl dev environment exist?
:For linux?
You'd be amazed at the benefit you'll derive from developing a
basic facility with the basic, interoperable, Unix toolset.
--tom
--
"The price of wisdom is realizing of how little of it
you actually possess." --me
------------------------------
Date: 11 Apr 1999 18:39:59 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl Development Environment
Message-Id: <371140df@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, aaron@soltec.net (Aaron) writes:
>I think more of what we mean is
>integrated debugger - when I say integrated, I want to step through the <SNIP>
I already have that, using vi.
>possibly a class hierchary panel (like in some of the Visual microsoft t<SNIP>
I already have that, using pmeth, pmexp, etc.
>I would like the ability to use whatever editor I wished. I like VIm so<SNIP>
I already have that, with $EDITOR.
>as I type this out, I'm thinking that possibly it wouldn't be terribly h<SNIP>
>though speed, would it be fast enough?
>I've never written a GUI app for *nix so I'm not sure
GUIs are virtually useless. Learn tools. They're configurable,
scriptable, automatable, cron-able, interoperable, etc. We don't
need no brain-dead winslurping monolithic claptrap.
Speaking of which: you have generated a severely malformed posting.
Please check your newsreader's settings.
--tom
--
If you want to see useful Perl examples, we can certainly arrange to have
comp.lang.misc flooded with them, but I don't think that would help the
advance of civilization. :-) --Larry Wall in <1992Mar5.180926.19041@netlabs.com>
------------------------------
Date: 12 Apr 1999 01:30:13 GMT
From: aaron@localhost.pants.org (Aaron)
Subject: Re: Perl Development Environment
Message-Id: <7erib5$6lj$1@hirame.wwa.com>
All,
let me address the posting issue
the malformed headers in my posting come becuase I sometimes post via the email gateway
with that said
let me address the main issues
> >integrated debugger - when I say integrated, I want to step through the <SNIP>
>
> I already have that, using vi.
how? are you saying you shell out and run it, or am I missing something?
>
> >possibly a class hierchary panel (like in some of the Visual microsoft t<SNIP>
>
> I already have that, using pmeth, pmexp, etc.
i've never heard of these tools, is that because I haven't read enough of the documentation
>
> >I would like the ability to use whatever editor I wished. I like VIm so<SNIP>
>
> I already have that, with $EDITOR.
don't we all,
what I meant (and I may not have been clear enough) was that I would prefer that any tool have a configurable editor (Microsoft Visual C++ doesn't have that option and neither does Perlbuilder)
> GUIs are virtually useless. Learn tools. They're configurable,
> scriptable, automatable, cron-able, interoperable, etc. We don't
> need no brain-dead winslurping monolithic claptrap.
I guess what I meant by GUI isn't what I conveyed.
what I mean by GUI is akin to the "GUI" like nature of VIm
let me know,
am I being silly/uninformed here
I think that having a nice editor (or in my opinion) some more built in Perl features in VIm would be a boon to all of us. I don't like to use Emacs so I can't take advantage of the Perl stuff that comes included for that editor and maybe that's where I'm missing out. But, dammit, I prefer VI.
-Aaron
------------------------------
Date: Sun, 11 Apr 1999 15:42:16 -0700
From: lucanntp@ise.bc.ca.spamsucks (Luca Filipozzi)
Subject: Re: Privacy for ...A followup question
Message-Id: <MPG.117ac51fe490829a98978a@news.bctel.net>
In article <7eqtga$45f$0@208.231.50.134>, x@x.com says...
> If I access my personal web site (which is running SSL) can the admin see
> the content of my web site. Also, if I use basic HTTP authentication
> (.htaccess, etc.) will the admin be able to intercept my password and log on
> to my SSL site?
>
> (I am not interested in goofing off at work; I just have to occasionally
> check my web site to see if one of my clients had and emergency.)
Your "other" clients... the ones for your personal business, right? I'm
sure your employer would agree with that, not.
BTW, don't think your sysadmin could look at the pages if you have
connected securely. The important part is whether you sysadmin can sniff
your username and or password as you connect. So, to get around that, you
need a java applet that you download and send your username/password that
way.
Ask your employer if you are allowed to moonlight using their
equipment... i'd like to hear what they say.
--
Luca Filipozzi <lucanntp@ise.bc.ca.spamsucks>
------------------------------
Date: Sun, 11 Apr 1999 21:00:22 -0400
From: "Kumar Sundaram" <softsci@eagle.ca>
Subject: Problem with file handle(s)
Message-Id: <7ergnm$j14$1@mur2.odyssey.on.ca>
Hello World,
I am trying to write a perl cgi script that will log visitor's ip
address, host name,
browser info, etc and write them to a html file in a nicely layed out table.
I also want to include an invisible counter in the script and everytime it
hits #25
the script should automatically start overwrite the log info file (html
file). I didn't
have any problems making the log info file to work separately. As soon as,
I try to
add that counter (different file handle now) I get problem that my log info
file is not
updating the new logs. Can any one help me by providing some tips here?? or
showing me some example code. As a beginner Perl programmer, I'm getting
confused with using several different
file handles at once. Additional Info: I am running Windows NT with Personal
web server 4.0 and Perl 5 installed. Thanx very much in advance! Any
comments/suggestions would be appreciated.
Kumar Sundaram
Email your comments to kumarsundaram@usa.net
------------------------------
Date: Sun, 11 Apr 1999 21:19:26 -0400
From: "Jason Simms" <ffchopin@worldnet.att.net>
Subject: Re: Problem with file handle(s)
Message-Id: <7erho4$g8v$1@bgtnsc01.worldnet.att.net>
[This followup was posted to comp.lang.perl.misc and a copy was sent to the
cited author.]
> I am trying to write a perl cgi script that will log visitor's ip
> address, host name,
> browser info, etc and write them to a html file in a nicely layed out
table.
> I also want to include an invisible counter in the script and everytime it
> hits #25
> the script should automatically start overwrite the log info file (html
> file). I didn't
> have any problems making the log info file to work separately. As soon
as,
> I try to
> add that counter (different file handle now) I get problem that my log
info
> file is not
> updating the new logs. Can any one help me by providing some tips here??
or
> showing me some example code. As a beginner Perl programmer, I'm getting
> confused with using several different
> file handles at once. Additional Info: I am running Windows NT with
Personal
> web server 4.0 and Perl 5 installed. Thanx very much in advance! Any
> comments/suggestions would be appreciated.
Honestly, what you want isn't very difficult, but you will find better
answers to your questions in the comp.infosystems.www.authoring.cgi
newsgroup. Also, though, when you post there, be sure and include your
code - all of it, if possible - with nice comments on what you think you're
trying to do with it. This way, they will be able to give you much quicker
and more specific answers to your problems.
Jason Simms
------------------------------
Date: Sat, 10 Apr 1999 21:08:53 GMT
From: mitiaNOSPAM@nwu.edu.invalid (Dmitry Epstein)
Subject: Re: protecting perl scripts
Message-Id: <3711bcc0.14386586@news.acns.nwu.edu>
On Wed, 24 Mar 1999 10:47:57 -0800, "David L. Cassell"
<cassell@mail.cor.epa.gov> wrote:
>Greg Bacon wrote:
<snip>
>> --
>> Politically Correct term: 'G(g)od(dess)(es)'
>> -- The Bruns
>
>Hey Greg, nice sig. I would have thought you would have turned that into
>a regex though... :-)
[Gg]od(?:s?|(?:dess(?:es)?)?)
--
Remove NOSPAM and .invalid from mitiaNOSPAM@nwu.edu.invalid
------------------------------
Date: 11 Apr 1999 23:03:33 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: question about hash keys
Message-Id: <7er9o5$eae$1@pegasus.csx.cam.ac.uk>
Vincent Vanbiervliet <vvb@ibm.net> wrote:
>If you try
> print "$h{123} $h{'123'}";
>the output will be
> c c
>The reason is that whatever is between the { and } can be written with or
>without the quotes, it is always interpreted as quoted.
Nope. It is only automatically quoted if it's a *word*.
>Thus, as a key, both 123 and '123' are regarded the same, so on line 3 you
>modify the value you defined on line 1.
That's true, but not for the reason you give. 123 and '123' are the
same as keys because keys are always converted to strings. Same
reason as undef and '' are the same key.
Mike Guy
------------------------------
Date: 11 Apr 1999 23:06:04 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: question about hash keys
Message-Id: <7er9ss$eel$1@pegasus.csx.cam.ac.uk>
Ala Qumsieh <aqumsieh@matrox.com> wrote:
>
>Note: If your keys are all numeric, it might be worthwile using a
>regular array. Access time is faster for arrays, and they take up less
>space.
Make that "If your keys are all *small* integers ... ".
Mike Guy
------------------------------
Date: Sun, 11 Apr 1999 16:27:50 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: question about hash keys
Message-Id: <MPG.117acfd283c2d2dc989890@nntp.hpl.hp.com>
In article <7er9ss$eel$1@pegasus.csx.cam.ac.uk> on 11 Apr 1999 23:06:04
GMT, M.J.T. Guy <mjtg@cus.cam.ac.uk >says...
> Ala Qumsieh <aqumsieh@matrox.com> wrote:
> >
> >Note: If your keys are all numeric, it might be worthwile using a
> >regular array. Access time is faster for arrays, and they take up less
> >space.
>
> Make that "If your keys are all *small* integers ... ".
Make that "If your keys are all *small* *non-negative* integers ... ".
Negative integers make lousy array accessors. Different semantics.
my @a; $a[-1] = 0; # Doesn't work.
The addition needed to bias negative integers to zero would probably
outweigh the speed advantage of array access compared to hash access.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 12 Apr 1999 01:56:32 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: start a background process and let it go..
Message-Id: <slrn7h2kmg.1kh.sholden@pgrad.cs.usyd.edu.au>
On Sun, 11 Apr 1999 17:19:51 -0400, Pat Trainor <ptrainor@title14.com> wrote:
>
> I have a main script that must call another script. The parent
>needs to continue regardless of any returns from the child. The child will
>take longer that the parent to close.
>
> What are the suggestions on how best to do this? I've tried many
>incarnations with no success.
perldoc -f fork
perldoc -f exec
perldoc -f system
man sh #to see what & when used in system...
--
Sam
In case you hadn't noticed, Perl is not big on originality.
--Larry Wall
------------------------------
Date: Mon, 12 Apr 1999 01:16:02 GMT
From: "Sheila Eugenio" <seugenio@man.amis.com>
Subject: Re: Win32 Mail Client
Message-Id: <01be8482$056088a0$2bbe10ac@amipnet>
What mail utility are you using? I am using BLAT and it works fine for me.
Greg Griffiths <greg2@surfaid.org> wrote in article
<3710C11F.6E7EC0D9@surfaid.org>...
> I'm trying to get the equiverlent of Sendmail to work under a win32
> environment, but keep hitting errors, does someone have a nippet of code
> that will allow me to send an email in this environment ?
>
------------------------------
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 5355
**************************************