[8713] in Perl-Users-Digest
Perl-Users Digest, Issue: 2330 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 15 16:28:46 1998
Date: Wed, 15 Apr 98 13:00:30 -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 Wed, 15 Apr 1998 Volume: 8 Number: 2330
Today's topics:
Re: array of matches in s/// <beckerr@softrends.com>
Re: Bill Gates should be invited to O'Reilly's "Free So <quentin@jihad.amd.com>
Can I do this: <A HREF=laughs.pl?@laughs> <amelkote@ford.com>
Re: Can someone give me an example of rounding! (susan cassidy)
Re: compiling with 'sfio' (Chris Nandor)
Re: Email Sender <rootbeer@teleport.com>
Re: Email Sender <brianm@kodak.com>
Excite search-engine config pkey@sghms.ac.uk
Re: File download problem in IE4.0 bidyut@yahoo.com
Re: going to a specific line number in a file (Chris Hamilton)
Hash of Arrays <olm@email.csun.edu>
Re: Hash of Arrays (Andrew M. Langmead)
Re: HELP with a compare sequence <rootbeer@teleport.com>
Help: run VB Msgbox thou Perl (Win32::OLE) <tkho@technologist.com>
Re: Hide or Encrypt perl source code (Jeffrey R. Drumm)
Re: How can i create an array?? (Craig Berry)
Re: How to insert a \n each... (Craig Berry)
Re: how to post to usenet with a perl cgi... <brianm@kodak.com>
Re: i want to learn Perl. HELP! (Ed Jamison)
Re: info on cookies <rootbeer@teleport.com>
Re: IO::Select->can_read not blocking <merlyn@stonehenge.com>
Re: Learning Perl (Ed Jamison)
Macperl apps don't down off after 5 minutes - UNSTABLE? <admin@antoine-girouard.qc.ca>
Match \/ ? cotal@delphi.com
Re: MKDIR problem <andrewf@cp.pathfinder.com>
Re: Numeric validation (Ken Fox)
Re: problems with crypt (Chris Hamilton)
Re: Q: Pattern matching <rootbeer@teleport.com>
Re: RMS should be invited to O'Reilly's "Free Software (Tim Smith)
Re: Sorting problem <andrewf@cp.pathfinder.com>
Re: Which Win32 Perl <tkho@technologist.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 15 Apr 1998 17:29:17 +0000
From: Ross Becker <beckerr@softrends.com>
Subject: Re: array of matches in s///
Message-Id: <3534EE6D.7925896C@softrends.com>
Bart Lateur wrote:
> Of course I want to be able to apply more than one translation to a
> text, so it would be nice to store the English phrases as keys of a
> hash, with the translated phrases as the value.
>
> This translation scheme doesn't work:
>
> $key = 'It is now (\d+) to (\d+)\.';
> $value{}$key} = 'Il est $2 heures moins $1.';
> s/^$key/$translate{$key}/;
>
> because there won't be any variable interpolation: $1 and $2 will still
> be there, literally.
>
> 'eval' is out of the question, because the phrases are stored into an
> external data file. Tainted code is something I don't regard highly, and
> I only want to substitute actual matches, not just any variable.
Bart, I am not certain what you are saying here about eval;
when you say that the phrases are stored in an external data
file, you mean you are using a tied hash? Your comment on
only wishing to substitute actual matches, not just any
variable- if you place an "eval" on the end, it will eval
once for each match, and it will not eval if there is not a
match... so what you are talking about could be expressed as:
while (<>) {
foreach $pat (keys %myhash) {
s/$pat/$myhash{$pat}/eg;
}
}
(I might be missing an extra set of braces around the
myhash{$pat} on the RHS to get the interpretation right)
but that would eval the contents of the hash once for
each time a pattern matched within a line. Remove the
g at the end and insert a caret at the beginning in order
to only match beginning of line... does that answer your
question?
On the use of a sub- if you only need the matched values
on the LHS of your next s///, $1 and friends will still
refer to the matches from the last s///- not until you
hit the RHS of the s/// will they be overwritten...
--Ross
beckerr@softrends.com
------------------------------
Date: 15 Apr 1998 12:19:10 -0500
From: Quentin Fennessy <quentin@jihad.amd.com>
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <xim1zuzf1f5.fsf@jihad.amd.com>
>>>>> "Ben" == Ben Bullock <ben@hayamasa.demon.co.uk> writes:
Ben> I should say that the perl FAQ does not meet several free
Ben> software criteria.
What criteria are you refering to?
Ben> Development of some linux free docs such as the Network guide
Ben> apparently died off after the O'Reilly version came out.
I am not familiar with the docs you are writing about. The fact
that a project stalled or halted after a book or books were published
does not mean the publications caused the project to halt. It may
have halted anyway. Certainly it would not be competition for a
revenue stream, as free docs do not feed authors. (not directly)
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: Wed, 15 Apr 1998 15:08:39 -0400
From: "Anu N. Melkote" <amelkote@ford.com>
Subject: Can I do this: <A HREF=laughs.pl?@laughs>
Message-Id: <353505B7.3551@ford.com>
Greeting Everybody !
I am trying to pass an array from one perl script and retreving it with
QUERY_STRING in another perl script. I am doing something like this:
In the initial perl pgm:
@laughs = qw (hoho, hehe, haha);
<A HREF = 'laughs.pl?@laughs'> Print Laughs </A>;
In laughs.pl I am trying to read the array via QUERY_STRING:
@laughlist = $ENV{'QUERY_STRING'};
Now, if I print @laughlist, I see only the first element in the array
"hoho"
However, in the URL I can see all the elements like this:
http://......./laughs.pl? hoho hehe haha
How can I grab all elements of the array I passed? Thanks in advance !
Regards,
Anu Melkote
------------------------------
Date: 15 Apr 1998 08:06:25 -0700
From: susanc@news.SanDiegoCA.ncr.COM (susan cassidy)
Subject: Re: Can someone give me an example of rounding!
Message-Id: <6h2idh$r26@ssd3450.SanDiegoCA.NCR.COM>
In article <6h2b3h$qth@ssd3450.SanDiegoCA.NCR.COM>,
susan cassidy <susan.cassidy@xxx.sandiegoca.ncr.com> wrote:
>In article <6gubjs$cil$1@comdyn.comdyn.com.au>,
>Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>>In article <Pine.BSI.3.96.980410100551.16994A-100000@pentagon.io.com>,
>> Chocolate <poohba@io.com> writes:
>>> I don't nor will I have access to the web for about a week or two so I
>>> would really appreciate it if someone would tell me how to round to 2
>>
>>You don't need to have access to the web to read the perl
>>documentation. It should come with your installation of perl.
>>
>>perldoc perlfaq
>>perldoc perlfaq4
>>/Does perl have a round function
>>perldoc sprintf
>>
>>> decimal point. I don't know how much different it will be but I am not
>>> too familiar with perl5.
>>
>>different from what?
>>
>>[Snip of very long signature. You should consider trimming it a bit]
>>
>>Martien
>>--
>>Martien Verbruggen |
>>Webmaster www.tradingpost.com.au | Advertising: The science of arresting
>>Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
>>NSW, Australia | get money from it.
>
>Just a caveat, I have seen many postings in this news group recommending
>that people use sprintf/printf to round numbers. Sprintf/printf will not,
>by themselves round anything. They will truncate, which is entirely
>different. Normally you have to add half of the rightmost decimal
>position to round to one less position. E.g. if you have a number like
>12.16, and you want to round to 12.2, you have to add .005 before
>truncating to 1 position after the decimal.
>
>Hope this helps.
>--
>Susan Cassidy
>Remove xxx in replyto address when replying.
As Tom C. has pointed out, I was wrong when I said that printf truncated.
That's what happens when you are forced to use lots of other tools and
languages other than perl - it ruins your brain and causes terminal
confusion.
Sorry for the confusion.
Perl forever!
--
Susan Cassidy
Remove xxx in replyto address when replying.
------------------------------
Date: Wed, 15 Apr 1998 13:48:38 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: compiling with 'sfio'
Message-Id: <pudge-1504981348560001@ppp-24.ts-1.kin.idt.net>
In article <3534AE17.533E2D14@pilot.msu.edu>, Jeremy Hill
<hilljere@pilot.msu.edu> wrote:
# Greetings,
# I need to compile perl with 'sfio' for a
# perl script I need to get working. I've tried
# "./Configure -Duseperlio -Dusesfio" to no avail.
# Does anyone know what I am missng here? Thanks for
# any advice.
Do you have the sifo libraries built and installed on your machine?
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== New Book: MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: Wed, 15 Apr 1998 18:52:54 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Lixo <defaultuser@domain.com>
Subject: Re: Email Sender
Message-Id: <Pine.GSO.3.96.980415114715.8954F-100000@user2.teleport.com>
On Wed, 15 Apr 1998, Lixo wrote:
> system ("mail $email -s \"subject\" < file.txt");
>
> It works but the sender of this message is always "Nobody" that is the
> default user for someone who uses it by HTML pages.
> The script file belongs to "WWW" user, and I would like it to be the
> sender.
If you're using the proper commands to run another program from perl, but
the other program doesn't cooperate, then it's the other program's fault.
If you're not using the proper commands, then it's your fault. If you
aren't sure about the proper commands, you should read the program's
documentation. If you've read it and you're still not sure, you should ask
in a newsgroup about the program.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 15 Apr 1998 15:12:02 -0400
From: Brian Mathis <brianm@kodak.com>
To: Lixo <defaultuser@domain.com>
Subject: Re: Email Sender
Message-Id: <35350682.C7FD3E69@kodak.com>
This is a multi-part message in MIME format.
--------------192666A2D652AD109E0AC3CB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lixo wrote:
>
> Hi, I have a script that performs an autentication and then send an
> email message, using the comand (under Linux):
>
> system ("mail $email -s \"subject\" < file.txt");
>
> It works but the sender of this message is always "Nobody" that is the
> default user for someone who uses it by HTML pages.
> The script file belongs to "WWW" user, and I would like it to be the
> sender.
>
> Any sugestions?
> Thanks.
> Paulo Rodrigues
> par@etc.pt
To be safer, you should use the Net::SMTP module. Then you can make the
sender whomever you want, and it's completely machine independent.
There's examples of its use if you 'perldoc Net::SMTP'. You might have
to get the module from CPAN, I don't remember if it's standard or not..
Brian Mathis
--------------192666A2D652AD109E0AC3CB
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Brian Mathis
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Brian Mathis
n: Mathis;Brian
org: US&C Intranet Services
adr: Mail Code: 01269;;343 State Street;Rochester;New York;14560-1269;6/15/KO, USA
email;internet: brianm@kodak.com
tel;work: 1(716)724-7960
tel;fax: 1(716)724-2496
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
--------------192666A2D652AD109E0AC3CB--
------------------------------
Date: Thu, 16 Apr 1998 02:27:19 GMT
From: pkey@sghms.ac.uk
Subject: Excite search-engine config
Message-Id: <892664840.506.0.nnrp-04.9e98ada2@news.demon.co.uk>
Solaris 2.5.1
I have downloaded & installed 'Excite for Webservers' and it works
fine. There is one tweak I want to do though. When I get the search
results and the searched for expression appears 'n' times in a file
that file is named 'n' times. How can I get Excite to return the file
name once only regardless of the amount of times the searched for
expression appears?
Please email any help to
paul@pkamf.demon.co.uk
as I can't get news too often!
Cheers
Paul
------------------------------
Date: Wed, 15 Apr 1998 13:26:46 -0600
From: bidyut@yahoo.com
Subject: Re: File download problem in IE4.0
Message-Id: <6h2u56$c3l$1@nnrp1.dejanews.com>
Hi Guys,
I have found a turn around solution. though it serves the purpose, still i am
not happy with it. those who are interested what i did, here is the steps
below.
As i found out that hardcoding the filenames, makes IE to download the file.
So the onlyway of hardcoding is that, the perl program should rea it froma
file.
So what i did, is instead of calling the perl program directly, i called an
ASP file. This asp file created a text file and wrote the file name to be
downloaded. then by using javascript, i called the perlscript. And the
perlscript, reads the filename and sends it to browser.
This works fine with all netscape and all IE browsers.
thanks for the discussion.
bye
ragrads
bidyut
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 15 Apr 1998 19:43:20 GMT
From: chrish@squonk.net (Chris Hamilton)
Subject: Re: going to a specific line number in a file
Message-Id: <6h32ko$9ta$1@duke.squonk.net>
Pratima Easwar (pratima@synopsys.com) wrote:
: The problem I am having is I dont know how to go to say line 25 in File 2
: directly - if there is a way. I could reset to the beginning of the file
: and keep reading in lines until I get to line 25, but I feel there must be
: a more efficient way.
:
Consider this:
open (FILEHANDLE, 'generic.txt') || die;
chomp (@content = <FILEHANDLE>);
close (FILEHANDLE);
print $content[24],"\n";
By throwing the contents of a file into an array, you have direct line
access via an n-1 method. e.g. If you want line 25, you'll 'process'
subscript 24 (25-1). I'm sure that there are issues regarding very large
files, but in every case that I've ever needed to use the aforementioned
method, I haven't had any problems.
Chris Hamilton C7 F9 1E FF 4F D8 F8 87
chrish@squonk.net F8 13 5F 69 63 B5 EB A8
"You're just jealous because the 'voices' talk to me."
------------------------------
Date: Wed, 15 Apr 1998 10:56:49 -0800
From: Ovanes Manucharyan <olm@email.csun.edu>
Subject: Hash of Arrays
Message-Id: <353502EF.2CC600FF@email.csun.edu>
How can I create a hash of Arrays.
For example, will this work?
@HASH{$index}=@array;
Do I need to create this data type? I tried to use this in my code and
it only stores the first element of the @array, am I doing something
wrong??
Thanks is advance.
Ovanes
------------------------------
Date: Wed, 15 Apr 1998 19:45:13 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Hash of Arrays
Message-Id: <ErH07D.EM4@world.std.com>
Ovanes Manucharyan <olm@email.csun.edu> writes:
>How can I create a hash of Arrays.
>For example, will this work?
>@HASH{$index}=@array;
You probably want to take a look at the perlref, perldsc, perllol (and
then the perlref man page again. After the other two, it might start
to make sense) to learn about how to create a hash of arrays in Perl.
You probably want:
$HASH{$index} = [ @array ];
(make a reference to an anonomous array, and copy the contents of
@array into it. Store the reference in the hash %HASH with $index as
its corresponding key.)
>Do I need to create this data type?
"Create this data type?" this is Perl!
--
Andrew Langmead
------------------------------
Date: Wed, 15 Apr 1998 19:26:01 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: skruzich@stc.net
Subject: Re: HELP with a compare sequence
Message-Id: <Pine.GSO.3.96.980415121924.8954J-100000@user2.teleport.com>
On Wed, 15 Apr 1998 skruzich@stc.net wrote:
> exec("date +'%a'` > today");
> open(TODAY, "today") || die "Cannot open today file.\n";
> $day = <TODAY>;
Yuck! :-) Use this instead:
($day) = (localtime =~ /(\w+)/);
> if ($day =~ "Mon")
You probably want eq instead of the binding operator.
I'd recommend the Llama book (Learning Perl) for you; it should help you
to get further with Perl. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 15 Apr 1998 11:15:01 -0700
From: Tommy <tkho@technologist.com>
Subject: Help: run VB Msgbox thou Perl (Win32::OLE)
Message-Id: <3534F925.CE33414D@technologist.com>
This may be a question for OLE or VB. But my question is how to run VB's
MsgBox command thou Perl. Is there a source I can look up for the
commands for PerlW32's OLE (other than the help of MSOffice's VB
builder)?
My script works with InputBox that a input windows pop up when the
script is run. However, it does nothing when I change it to "MsgBox".
What I want is to have a window to pop up with a message and the OK and
Cancel buttons.
VB Syntax:
MsgBox(prompt[, buttons] [, title] [, helpfile, context])
Example:
MsgBox("Message", 1, "System Title")
where 1 means "OK" and "Cancel".
---------------
use OLE;
my @DATE= localtime(time);
my $MONTH= $DATE[4]+1;
my $TITLE= "Title"; # Define title.
my $MSG= "Message"; # Define message.
my $MSG_FAIL= "Please enter the date, again (mm/dd/yy).\nThank You."; #
Define message.
my $MSG_PASS= "Continue?"; # Define message.
my $DEFAULT= "$MONTH/$DATE[3]/$DATE[5]"; # Define default.
my $STYLE= "vbYesNo + vbCritical + vbDefaultButton2"; # Define buttons.
my $HELP= "DEMO.HLP"; # Define Help file.
my $CTXT= 1000; # Define topic context
my $FAIL= "1";
my $application = CreateObject OLE 'Excel.Application'
|| die print "Cannot run application: $!\n";
while ($FAIL) {
while ($FAIL) {
$RESULT= $application->InputBox("$MSG", "$TITLE", "$DEFAULT",);
$FAIL=0 if ($RESULT=~ /^\d+\/\d+\/\d+$/);
$MSG= $MSG_FAIL;
}
$RESPONSE= $application->InputBox("You have enter:\n\n $RESULT \n\n
Press OK to Continue", "$TITLE", "$RESULT");
$FAIL=1 if ($RESPONSE ne $RESULT);
}
print "R> $RESPONSE\n";
$application->Quit();
------------------------------
Date: Wed, 15 Apr 1998 18:56:19 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Hide or Encrypt perl source code
Message-Id: <3534fc77.459640928@news.mmc.org>
[posted and mailed]
On Wed, 15 Apr 1998 14:20:29 +0100, "Mike Lacey" <Mike_Lacey@Cargill.Com>
wrote:
>NetWare - NetWare allows you to make a program/script (batch file)
>executable without allowing someone to read it. Not a real system I know -
>but there you go.
>
>Mike
None of the NetWare system utiliities (flag.exe, filer.exe) allow you to set
anything but a .com or .exe file as execute only. The JRBUtils SETXONLY.EXE
utility allows you to set the X attribute on a batch file, but you can't run it
after that . . . that's because the DOS/NT command processor needs to _READ_ a
batch file to execute it.
You'll also find that this attribute breaks a lot of executables that keep
their overlays internally since they've got to be able to open their own
executables for reading.
So there YOU go . . . :-)
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: 15 Apr 1998 19:27:17 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How can i create an array??
Message-Id: <6h31ml$b0o$2@marina.cinenet.net>
Abigail (abigail@fnx.com) wrote:
: cipa@cipa.com.br (cipa@cipa.com.br) wrote on MDCLXXXVIII September
: MCMXCIII in <URL: news:6h2fc0$lut$1@nnrp1.dejanews.com>:
: ++ How can I create an array (in netscape's fasttrack perl)
: ++ And how can i define the size of a variable??
:
: RTFM.
In this case, TFM which I strongly encourage you to R is _Learning Perl_,
AKA 'The Llama Book'. It will answer your first question quite early on,
and perhaps enlighten you as to why your second question is effectively
meaningless.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 15 Apr 1998 19:22:37 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How to insert a \n each...
Message-Id: <6h31dt$b0o$1@marina.cinenet.net>
LE CORRE (lecorre@magic.fr) wrote:
: I don't know how to insert a \n new line each x char eg:
:
: $line="031317212230333646490811162224293037404104050717293537414647"; (40
: char)
Actually, that's 60 chars.
: I want to insert a \n each 10 char to display :
: 03131721223033364649
: 08111622242930374041
: 04050717293537414647
Actually, those are 20 char chunks.
: I tried $line=~ s/.{10}/\n/g; but it doesn't work.
A more efficient approach uses substr:
$line = '031317212230333646490811162224293037404104050717293537414647';
$chunk = 10;
for ($ix = 0; $ix < length($line); $ix += $chunk) {
print substr($line, $ix, $chunk), "\n";
}
: Please, answer by email.
Sorry, private consulting costs extra.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Wed, 15 Apr 1998 15:01:46 -0400
From: Brian Mathis <brianm@kodak.com>
Subject: Re: how to post to usenet with a perl cgi...
Message-Id: <3535041A.EA9EF29E@kodak.com>
This is a multi-part message in MIME format.
--------------D47E42FF67F2C0B73953E412
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Matthew D. Healy, Ph.D. wrote:
> auctionmaster@auctionaddict.com wrote in message
> <6h0bji$qqg$1@nnrp1.dejanews.com>...
> >does anyone know of any scripts that will post to usenet via cgi written in
> >perl?
>
> Please explain why -- OTHER THAN SPAMMING -- you wish to do this.
>
> I fervently hope nobody here will be foolish enough to answer this
> unless a convincing answer is forthcoming!
Um, I do believe that something like "dejanews" is an application of
this, and it's quite useful if you don't have access to a news server.
Just one example.
I hope you're not confusing "cgi" with "a perl script". It would indeed
be much more efficient to spam with "a perl script", instead of making a
"cgi" frontend for it.
Brian Mathis
--------------D47E42FF67F2C0B73953E412
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Brian Mathis
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Brian Mathis
n: Mathis;Brian
org: US&C Intranet Services
adr: Mail Code: 01269;;343 State Street;Rochester;New York;14560-1269;6/15/KO, USA
email;internet: brianm@kodak.com
tel;work: 1(716)724-7960
tel;fax: 1(716)724-2496
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
--------------D47E42FF67F2C0B73953E412--
------------------------------
Date: Wed, 15 Apr 1998 18:41:59 GMT
From: edwardt@i.really.really.hate.spam.jamison.com (Ed Jamison)
Subject: Re: i want to learn Perl. HELP!
Message-Id: <MPG.f9ebb1fe4d2e2919896b2@news.ais.net>
Again, and again, and again. Pick up Learning Perl from O'Reilly. You
wont find a better book, or collection of books, that will help you start
learning Perl.
HTH,
Edward Jamison
Long ago (Mon, 13 Apr 1998 19:55:22 -0400), in a land far far away,
deforest@mkl.com spouted nonsense similar to this...
> i have been into the Internet for a while but, only have learned HTML.
> i thought that i chould expand my learning to Perl but, i don't know how to
> get started.
> if anyone knows of any sites that could help me or books please tell me, i
> would be very greatful.
>
>
>
--
"It's trivial to make fun of Microsoft products, but it takes a real man
to make them work, and a god to make them do anything useful"
- Anonymous, A product of Earth, Circa 1990's
------------------------------
Date: Wed, 15 Apr 1998 19:13:22 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Lloyd Zusman <ljz@asfast.com>
Subject: Re: info on cookies
Message-Id: <Pine.GSO.3.96.980415120249.8954I-100000@user2.teleport.com>
On 15 Apr 1998, Lloyd Zusman wrote:
> Either Gilles Chong is saying that no env. variable is being set at
> all (your interpretation, which indeed might indicate some kind of
> server issue),
Which is to say, not a Perl-specific problem...
> or else Gilles Chong is unaware of the name of this variable and is
> trying to learn this in order to access cookies in Perl-based cgi
> scripts (my interpretation).
Which is to say, not a Perl-specific problem...
The name of the environment variable is the same no matter what language
is being used to do the work. If I were to ask in a newsgroup about
Toyotas for someone to tell me how to drive my Toyota to the Golden Gate
Bridge, they would laugh at me - there's nothing Toyota-specific about
that question. And even if some helpful person there gave me the answer
there, that person should point out that such questions are better asked
and answered in a newsgroup about San Francisco. That way, I'm able to go
to that newsgroup and learn more about SF than just that one answer, as
well.
If you choose to answer a CGI-specific question in a non-CGI newsgroup,
you should be commended for your helpfulness. It would be even more
helpful of you to suggest to the poster that similar questions - and their
answers - appear in another newsgroup and its FAQ list. An on-topic
newsgroup is always a better place to find an answer.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 15 Apr 1998 18:25:20 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
To: David Boyce <David.Boyce@fmr.com>
Subject: Re: IO::Select->can_read not blocking
Message-Id: <8c1zuzlz83.fsf@gadget.cscaper.com>
>>>>> "David" == David Boyce <David.Boyce@fmr.com> writes:
David> In the following sample code, trimmed down from a program which
David> monitors a set of logfiles, the intent is to use 4-arg select
David> (via the IO::Select module) to block until output is ready.
Files are *always* "ready to read". Even if there are 0 bytes to
read. You'll need to rethink your strategy.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 138 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@teleport.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: Wed, 15 Apr 1998 18:43:20 GMT
From: edwardt@i.really.really.hate.spam.jamison.com (Ed Jamison)
Subject: Re: Learning Perl
Message-Id: <MPG.f9ebb6cc853813c9896b3@news.ais.net>
Long ago (Tue, 14 Apr 1998 12:20:43 -0700), in a land far far away,
sundeep@cadence.com spouted nonsense similar to this...
> Hi All
> I'm trying to learn Perl but 'm not able to find any pointers where I
> can start. Can somebody give some good pointers for begineers. Is it a
> necessity for one to be good in Unix Scripts before learning Perl.
>
> Help appreciated
> -Sundeep
>
Refer to your topic, my friend.... Learning Perl, from O'Reilly, by
Randall Schwartz, is the book to get. You'll not find better.
HTH,
Edward Jamison
--
"It's trivial to make fun of Microsoft products, but it takes a real man
to make them work, and a god to make them do anything useful"
- Anonymous, A product of Earth, Circa 1990's
------------------------------
Date: Wed, 15 Apr 1998 15:15:42 -0500
From: Administrator <admin@antoine-girouard.qc.ca>
Subject: Macperl apps don't down off after 5 minutes - UNSTABLE?
Message-Id: <35351569.5C4D@antoine-girouard.qc.ca>
OK - we know we are doing something wrong! The macperl apps don't shut
down automatically after 5 minutes! And my server admnin is in a tizzy.
Most scripts are still running the next morning - sometimes it is the
same ones over and over. (They are saved as cgi-scripts!?) What I don't
understand is why can't I shut them down even when I double click on
them, receive the menu to shut them down, and click on shut down from my
station, in my directory! The sys admin has to do it himself. ... The
next morning he arrives, looks in teh finder menu and sees 5 or 10
macperl apps still running! There must be a way to limit their time.
MORE INTERESTING
>From time to time, I get response from netscape that says that "The
document contains no data". It seems to be these that cause the trouble.
I rename them, (try to) erase them or otherwise and resave the app with
my back up file - this seems to overcome the problem - sometimes. (I
have run the check syntax and ran the perl app before I try testing it
from the net.)
I'm wondering if I should save my apps as perl droplets, but they don't
seem to work.
For the moment my sys admin :-( has banished macperl from the main
server to another IP where I am to test and solve the problem with
macperl before he lets Macperl back in!
please reply to J.T-Johnston by e-mail
eslcafe@callisto.si.usherb.ca
------------------------------
Date: Wed, 15 Apr 1998 13:23:54 -0600
From: cotal@delphi.com
Subject: Match \/ ?
Message-Id: <6h2tvp$brg$1@nnrp1.dejanews.com>
What syntax would you use to match \/, as in abc\/def
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 15 Apr 1998 14:08:32 -0400
From: "Andrew F. Lee" <andrewf@cp.pathfinder.com>
Subject: Re: MKDIR problem
Message-Id: <Pine.GSO.3.95.980415140741.1054A-100000@cp.pathfinder.com>
On Tue, 7 Apr 1998, bjf wrote:
> Greetings :-)
>
> I'm having a problem ... I need to create a new directory in a script ... Ie
> ...
>
> mkdir($dir, 777);
mkdir($dir, 0777);
Use the 0 to indicate an octal value.
>
> This won't work ... But when I tried ...
>
> mkdir($dir, 766);
>
> It worked OK ... But, I need to make the permission set to 777 ... Not 766,
> can anyone tell me what I'll have to do to make the permission set to 777?
> (Via script, not UNIX, FTP, whatever)
>
> Sorry about my English by the way (Not my first language)
>
> Thanks for reading this ...
>
> BJF
>
>
>
>
-------------------------------------------------------------
Andrew F. Lee | |
Software Engineer | parenttime.com |
email: andrewf@pathfinder.com | 1271 Avenue of the Americas |
Phone: (212) 522-2769 | New York, N.Y. 10020 |
-------------------------------------------------------------
When I say, "Ignore the man behind the curtain."
That is because there is no man behind the curtain.
------------------------------
Date: 15 Apr 1998 18:05:55 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Numeric validation
Message-Id: <6h2su3$6rc1@eccws1.dearborn.ford.com>
fdc@cliwe.ping.de (Frank D. Cringle) writes:
> kfox@pt0204.pto.ford.com (Ken Fox) writes:
> > I'd prefer the FAQ say:
> >
> > if (/\D/) { print "has nondigits\n" }
> > if (/^\d+$/) { print "is a whole number\n" }
> > if (/^-?\d+$/) { print "is an integer\n" }
> > if (/^[+-]?\d+$/) { print "is a +/- integer\n" }
> > if (/^-?\d+\.?\d*$/) { print "is a real number\n" }
>
> $_ = '1.2e40';
> if (/^-?\d+\.?\d*$/) { print "$_ is a real number\n" }
> else { print "oops, $_ is not a real number\n" }
> $_ += 0;
> if (/^-?\d+\.?\d*$/) { print "$_ is a real number\n" }
> else { print "oops, $_ is not a real number\n" }
> if (/^-?\d+(\.(\d+(e[+|-]?\d+)?)?)?$/i) { print "$_ is a real number\n" }
> else { print "oops, $_ is not a real number\n" }
And your point is? The real purpose of the FAQ here is to provide
the idea that regexps can be used to check numbers and secondly to
give some common examples. I don't like people just cutting and
pasting from the FAQ into "real" code, but we might as well make it
easy to do if we can. (Less pain in c.l.p.m maybe?)
Your example seems harder to read than the existing FAQ, obscures
the regexps and provides weird contradictory output.
If you're trying to tell me that the regexps are wrong, tell that
to the FAQ owner -- the regexps were copied verbatim from the FAQ.
- Ken
--
Ken Fox (kfox@ford.com) | My opinions or statements do
| not represent those of, nor are
Ford Motor Company, Powertrain | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section | "Is this some sort of trick
| question or what?" -- Calvin
------------------------------
Date: 15 Apr 1998 19:44:46 GMT
From: chrish@squonk.net (Chris Hamilton)
Subject: Re: problems with crypt
Message-Id: <6h32ne$9ta$2@duke.squonk.net>
Matthew Cravit (mcravit+usenet@mcravit.vip.best.com) wrote:
: If you need something more secure, and you're encrypting stuff for things
: other than a password, the MD5, or Crypt::{IDEA,DES} modules might be worth
: a look.
:
IMHO: MD5 is the quickest and easiest way to go.
---
Chris Hamilton C7 F9 1E FF 4F D8 F8 87
chrish@squonk.net F8 13 5F 69 63 B5 EB A8
"You're just jealous because the 'voices' talk to me."
------------------------------
Date: Wed, 15 Apr 1998 18:57:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Andreas Pidde <pidde@uni-koblenz.de>
Subject: Re: Q: Pattern matching
Message-Id: <Pine.GSO.3.96.980415115439.8954G-100000@user2.teleport.com>
On Wed, 15 Apr 1998, Andreas Pidde wrote:
> Input: Test\ string
>
> 1) print ":$1:\n" if ( /\b((\S|\\\s)+)/ );
> only prints :Test\: - why?
Because the + is greedy. It matches \S as many times as it can. At that
point, there's neither \S or \\\s, so it's done. If you wish for \\\s to
be preferred, just list it first in the alternative (as you showed in one
of your examples).
The Hip Owls book (Mastering Regular Expressions) is highly recommended
for understanding these things. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 15 Apr 1998 11:13:27 -0700
From: tzs@halcyon.com (Tim Smith)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6h2tc7$971$1@halcyon.com>
Barry O'Neill <boneil@nothanks.cableinet.co.uk> wrote:
>> (2) If by having something free of mine in the proprietary code, the
>> proprietary product is improved, I have helped the users of that proprietary
>> product.
>
>Not really.
Huh? If something I do makes, say, Microsoft Word a better program so that
its users find it more useful, it sure seems to me that I've helped those
users. Please explain how I have not.
--Tim Smith
------------------------------
Date: Wed, 15 Apr 1998 14:13:07 -0400
From: "Andrew F. Lee" <andrewf@cp.pathfinder.com>
Subject: Re: Sorting problem
Message-Id: <Pine.GSO.3.95.980415140959.1054C-100000@cp.pathfinder.com>
On Tue, 7 Apr 1998, Ovanes Manucharyan wrote:
> I am having problems sorting ascii.
> My sorting sub is included at the bottom. I got this off Tom
> Christiansen's help page about sorting.
>
> It works fine for numbers, but whenever I try to use it to sort other
> ascii, it doesn't do it completely.
>
> It's supposed to sort the array that is passed into it.
>
> sub sortdata {
> @f = ();
> for (@biglist) { push @f, (split ':')[-1] }
> @new = @biglist[ sort { $f[$a] <=> $f[$b] } 0 .. $#biglist ];
> }
Naturally that works for numbers ...
sub sortdata {
@f = ();
for (@biglist) { push @f, (split ':')[-1] }
@new = @biglist[ sort { $f[$a] cmp $f[$b] } 0 .. $#biglist ];
}
Now it works for ascii ... remember eq vs. =, gt vs. >, <=> vs. cmp
> Can anyone help me?
> --
> ----------------------------------------------------
> Ovanes Manucharyan olm@csun.edu
> California State University, Northridge
> ----------------------------------------------------
>
>
>
>
-------------------------------------------------------------
Andrew F. Lee | |
Software Engineer | parenttime.com |
email: andrewf@pathfinder.com | 1271 Avenue of the Americas |
Phone: (212) 522-2769 | New York, N.Y. 10020 |
-------------------------------------------------------------
When I say, "Ignore the man behind the curtain."
That is because there is no man behind the curtain.
------------------------------
Date: Wed, 15 Apr 1998 11:02:57 -0700
From: Tommy <tkho@technologist.com>
Subject: Re: Which Win32 Perl
Message-Id: <3534F651.40B5D91F@technologist.com>
I have both ActiveState (Perl 5.00307) and Gurusamy Sarathy (Perl 5.00402) port.
Some of my scripts, such as those with "times()" can't be run on ActiveState Port
but GS Port.
Correct me if I am wrong: ActiveState Port is not fully compatible with UNIX
script, however, ActiveState package (PIIS*.zip) come with the Perl's dll that can
be configured to run under MS Personal web server and IIS. GS does not support IIS
nor PWS.
BTW, you can have both ports installed in your Win95 system. What you do are:
1) Fully install either port. (I install ActiveState as the basic).
2) Unzip the .exe and its .dll of the other port (For GS are perl.exe,
perlglobe.exe and cw3230mt.dll. For ActiveState are perl.exe, perlglobe.exe,
perl300.dll). Rename the "perl.exe" to a different name, such as "Perl504.exe".
Next, save them to the Perl's bin.
3) edit lib/config.pm from:
($] == 5.00307) or die sprintf
"Perl lib version (5.00307) doesn't match executable version (%.5f)\n", $];
to:
($] == 5.00307||$] == 5.00402) or die sprintf
"Perl lib version (5.00307) doesn't match executable version (%.5f)\n", $];
I run my ActiveState Port by using "perl $1" and GS Port by using "perl504 $1".
FYI: Following are the unsupported functions of ActiveState Port build 3.16:
Unsupported network routines
============================
getnetbyname()
getnetbyaddr()
getnetent()
getprotoent()
getservent()
sethostent()
setnetent()
setprotoent()
setservent()
endhostent()
endnetent()
endprotoent()
endservent()
socketpair()
Unsupported System V compatible IPC routines
============================================
msgctl()
msgget()
msgrcv()
msgsnd()
semctl()
semget()
semop()
shmctl()
shmget()
shmread()
shmwrite()
Unsupported I/O routines
========================
ioctl()**
Unsupported filesystem routines
===============================
chroot()
fcntl()**
link()
lstat()**
readlink()**
symlink()
umask()**
Unsupported security-related routines
=====================================
getpgrp()
getppid()
getpriority()
getpwnam()
getgrnam()
getpwuid()
getgrgid()
getpwent()
getgrent()
setpwent()
setgrent()
endpwent()
endgrent()
setpgrp()
Unsupported process-related routines
====================================
fork()
setpriority()
times()
wait()
waitpid()
Unsupported miscellaneous routines
==================================
alarm()
dump()**
syscall()
Stuart McDow <smcdow@arlut.utexas.edu> wrote:
> The "Gurusamy Sarathy" version is known as the "core" version. It uses
> the same code base as the Un*x versions. I'm using the core 5.004_2
> version for win32, and I've had no problems with it. It comes bundled
> with many nifty packages, most importantly (to me), Tk. I've developed
> a few very GUI intensive applications that run on serveral versions of
> Un*x *and* on mswin32 machines. Without changing any code. It makes
> for very, very portable applications. I've never had any problems
> (execpt those that come with running under a broken operating system)
> with the core mswin32 release.
>
> I don't know much about the ActiveState port, but it does seem to
> diverge somewhat from the core distribution. Someone more
> knowledgeable should make that comparision. I suspect it would be
> easier to add modules with the core version, but I haven't had to mess
> with that yet.
Tommy Ho
tkho@technologist.com
------------------------------
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 2330
**************************************