[7201] in Perl-Users-Digest
Perl-Users Digest, Issue: 826 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 8 05:16:25 1997
Date: Fri, 8 Aug 97 02:00:34 -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 Fri, 8 Aug 1997 Volume: 8 Number: 826
Today's topics:
Bad file number <mike@wolonline.net>
Re: BASE64 problem with special word <aas@bergen.sn.no>
Re: Can perl return more than one gif? <seay@absyss.fr>
Cookies and PERL <jpm@iti-oh.comNOSPAM>
Re: Cookies and PERL <merlyn@stonehenge.com>
Re: Counting Files <burleigh@hackberry.chem.niu.edu>
Re: Counting Files (Eric Bohlman)
Re: EASY PROBABLY: removing names from paths <enzrowi@nzsf00.epa.ericsson.se>
Re: File locking <tom@mitra.phys.uit.no>
Re: Getting Missing File Title return when executing sc <rootbeer@teleport.com>
Re: howto import other perl file into current one?? <helen.bergquist@pobox.com>
HTTP proxy server in perl? (Darrell Berry)
Re: HTTP proxy server in perl? <merlyn@stonehenge.com>
Re: HTTP proxy server in perl? <rootbeer@teleport.com>
Re: More on angle operator's ignorance (Stefan Frank (sf))
Re: No Perls of wisdom here... <rootbeer@teleport.com>
Re: Opening tcp connections.... <seay@absyss.fr>
Re: pattern match/replace (Charles DeRykus)
Re: perl rpm ? <seay@absyss.fr>
Persistent Hash <deepak@creative.net>
Problem in running Perl with Novell web server 3.10 (Lee Chun Ho)
Re: Process forking <rootbeer@teleport.com>
Re: Range operator question (Heinrich Mislik)
SEARCHABLE INDEX FOR THE LIST <ely@ml.com>
Re: SEARCHABLE INDEX FOR THE LIST <rootbeer@teleport.com>
Re: Searching for "similar" words (Eric Bohlman)
semaphores: semctl: how to pass ARG <dhoover@textwise.com>
Re: silencing system() <seay@absyss.fr>
Re: sleep not mixing well with other signal handlers <shimpei@socrates.caltech.edu>
Re: Sorting With Perl <rootbeer@teleport.com>
The eternal question: Has anyone gotten DynaLoader to w <dan_aug97@unitech.com>
Re: Using Perl/Netscape in a Standalone environment <beadles@nt.com>
Why is `command @ARRAY` rejected by Perl, sometimes. <rovf@earthling.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 07 Aug 1997 18:18:02 -0400
From: "Michael S." <mike@wolonline.net>
Subject: Bad file number
Message-Id: <33EA499A.430D@wolonline.net>
greetings,
I'm tring to execute a csh script from perl5 using system()
system("/dir/cshscript"); , and I countinue to get
/dev/fd/#: Bad file number.
I would appreciate some assistance.
------------------------------
Date: 07 Aug 1997 14:20:26 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: BASE64 problem with special word
Message-Id: <hvi1iyyk5.fsf@bergen.sn.no>
ip <ip@cybernet.dk> writes:
> I have a serious problem with the base64 encoding/decoding rutine.
I suggest that you use the MIME::Base64 module. Your BASE64.PL seems
to be based on some older version of this module.
> the word: Artifax
>
>
>
> gives strange output when decoding it.
Are you sure you want to decode it. It does not look like a base64
encoded string to me.
--
Gisle Aas <aas@sn.no>
------------------------------
Date: Thu, 07 Aug 1997 14:20:21 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Can perl return more than one gif?
Message-Id: <33E9BD85.586001C7@absyss.fr>
R. Terpilowski wrote:
>
> Hi, I'm pretty new to programming with perl. Right now I am trying to
> write a script that will return more than one image back to a web page.
Danger Will Robbinson, CGI question approaching.
<extending electrically chaged claws>
> Is
> this possible? I am calling the script with a <img src="program.cgi> tag.
> and in the program I have a line that says print
> "Location: dir/of/image.gif\n\n"; that prints one image.
You are the one doing the CGI, not me. Does the CGI protocol allow
this? I would think so, but I don't know for sure.
> But can I output
> another image to that page also with the same program. Thanks for your
> help.
Yes, Perl will let you print what you want. You could print 10 gifs if
you wanted. Will that be understood by the browser at the other end?
That I don't know. Go to a WWW group and ask this sort of question
there. The FAQ for this group has a list of several sources of info for
CGI questions.
Remember that Perl is not CGI.
- doug
------------------------------
Date: 7 Aug 1997 13:23:31 GMT
From: "Joshua Marotti" <jpm@iti-oh.comNOSPAM>
Subject: Cookies and PERL
Message-Id: <01bca335$0b3b4880$36601ec6@bach>
Does anyone have a list of all of the internet variables that perl uses...
including environmental hash variables...
for example $ENV{'USER_ADDR'} = the current users address...
--
Josh,
Gavin Dragon...
Remove NOSPAM from address...
------------------------------
Date: 07 Aug 1997 07:16:24 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: "Joshua Marotti" <jpm@iti-oh.com>
Subject: Re: Cookies and PERL
Message-Id: <8cd8nqnknb.fsf@gadget.cscaper.com>
>>>>> "Joshua" == Joshua Marotti <jpm@iti-oh.comNOSPAM> writes:
Joshua> Does anyone have a list of all of the internet variables that
Joshua> perl uses... including environmental hash variables... for
Joshua> example $ENV{'USER_ADDR'} = the current users address...
Perl has access to *all* the environment (not "environmental"... UGH!)
variables.
If you are really asking "what are the variables available to a program
through the Common Gateway Interface [CGI]?", you'll need to consult
your webserver's documentation for that, or the CGI specification.
But really, this question is better handled in
comp.infosystems.www.authoring.cgi, since it isn't really about Perl
at all. Be sure you read the FAQ there first.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 390 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: Thu, 07 Aug 1997 18:37:10 -0500
From: Darin Burleigh <burleigh@hackberry.chem.niu.edu>
Subject: Re: Counting Files
Message-Id: <33EA5C26.1DDE@hackberry.chem.niu.edu>
Paul Denman wrote:
>
> Hello,
>
> I have written a small program to count the number of files in a given
> directory
> which have the suffix of '.dat' :
>
> #!/usr/local/bin/perl5
>
> $dir_Name = 'C:\perl5\paul\dir_info\data';
>
> opendir DIRNAME, $dir_Name or die "Directory Not Found.";
> @file_List = grep /.dat/, readdir DIRNAME;
> closedir DIRNAME;
>
> print "".@file_List . " files which match our criteria in the directory " .
> $dir_Name;
>
> Does anyone know of a quicker way? (IE one command which will return the
> number of files in a given directory)
>
> Cheers,
>
> Paul Denman
> pdenman@ims.ltd.uk
you can count the number of files with this:
$nfile = @file_list
you can do the whole thing in one line with
$nfiles = int( @file_list = <*.dat> );
print "there are $nfile files are @file_list\n";
--
==========================================================
- darin
burleigh@hackberry.chem.niu.edu
\\//\\//.\\//\\//.\\//\\//. http://hackberry.chem.niu.edu/HOME/dcb/
'2 kinds of green, look out!' - dieter rot
------------------------------
Date: Fri, 8 Aug 1997 00:28:19 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Counting Files
Message-Id: <ebohlmanEEKJz8.FLD@netcom.com>
Darin Burleigh (burleigh@hackberry.chem.niu.edu) wrote:
: Paul Denman wrote:
: > Does anyone know of a quicker way? (IE one command which will return the
: > number of files in a given directory)
: you can do the whole thing in one line with
: $nfiles = int( @file_list = <*.dat> );
: print "there are $nfile files are @file_list\n";
Not quicker; that glob has to start a new process and wait for it to finish.
------------------------------
Date: Fri, 08 Aug 1997 07:37:56 +1200
From: Ross Williamson <enzrowi@nzsf00.epa.ericsson.se>
Subject: Re: EASY PROBABLY: removing names from paths
Message-Id: <33EA2414.4901@nzsf00.epa.ericsson.se>
Or instead of rindex you can use something like
$filename =~ m/(.*)\/(.*)$/;
Then take $2
Ross
Tom Phoenix wrote:
>
> On Tue, 5 Aug 1997, Shaun O'Shea wrote:
>
> > I have an array of file paths and I want to remove everything except the
> > file name and extension.
>
> Maybe you want the File::Basename module.
>
> > i.e how do I remove everything BEFORE the LAST "/"
>
> You can find the location of the last '/' character by using rindex(),
> documented in perlfunc(1). Hope this helps!
>
> --
> Tom Phoenix http://www.teleport.com/~rootbeer/
> rootbeer@teleport.com PGP Skribu al mi per Esperanto!
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
--
+-----------------------------------------------------------------+
Ross Williamson - Support Engineer - Ericsson New Zealand
Phone (04)460-1061 - Mobile 025 956 265
Where do forest rangers go to "get away from it all"?
------------------------------
Date: 07 Aug 1997 11:35:42 +0000
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: File locking
Message-Id: <nqozpqufcoh.fsf@mitra.phys.uit.no>
Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer) writes:
> Set-uid scripts, not in any language.
How far do you trust your compiler?
> Casper
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Thu, 7 Aug 1997 06:38:04 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: FREAKSHO <FREAKSHO@mail.carnivore.net>
Subject: Re: Getting Missing File Title return when executing script..
Message-Id: <Pine.GSO.3.96.970807063311.18326E-100000@kelly.teleport.com>
On 6 Aug 1997, FREAKSHO wrote:
> Could someone give me some insight why my script is returning a Missing
> File title when executing a script?
What's a "Missing File title"? :-) If your error message is a Perl error
message, you should be able to find a helpful explanation in the
perldiag(1) manpage. If it's not a Perl error message, it's probably not a
Perl error. If it's a server error, you may find more help in your
server's docs, FAQs, and relevant newsgroups. Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 7 Aug 1997 06:38:20 -0500
From: "Helen Bergquist" <helen.bergquist@pobox.com>
Subject: Re: howto import other perl file into current one??
Message-Id: <5sdurn$b6u$1@news.ro.com>
Hi Jin Lu!
I believe Perl's trying to remind you that things that are "used" or
"required"
need to return a true value when they are evaluated during load so that
Perl
will know that the thing's initialization has gone OK.
Since you seem to have no initialization, just stick a "1;" at the end of
the file
after reading man perlmod and see if that helps.
Denis
jin lu wrote in article ...
>I like perl language but sometimes it is difficult to understand its
>output.
>
>I have a currnt file new.pl which contains lines as following:
>
>#! /usr/local/bin/perl
>require("test.pl");
>$fun=1;
>list($fun);
>
>
>In my test.pl (in the same directory), it contains only:
>sub list{
> local $fun=@_;
> print $fun;
>}
>
>It is a simple calling another perl script. Why is not working?
>message is : "test.pl did not return a true value at new.pl line 2."
>
>Do I miss something? What a true value it talks about?? Thank you so much
>if someone can shed some lighs on it.
>
>Jin
------------------------------
Date: Thu, 07 Aug 1997 22:57:45 +0000
From: darrellb@hhcl.com (Darrell Berry)
Subject: HTTP proxy server in perl?
Message-Id: <darrellb-0708972257450001@servalan.hhcl.com>
Can anyone point me at one? Nothing fancy, I just want the skeleton to
play with...in particular I am looking for proxy code which can build a
database of visited links, rather than offer a caching service, but
anything I can hack is fine ;-)
cheers!
pls email responses...
------------------------------
Date: 07 Aug 1997 20:48:37 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: darrellb@hhcl.com (Darrell Berry)
Subject: Re: HTTP proxy server in perl?
Message-Id: <8cpvrpmj1m.fsf@gadget.cscaper.com>
>>>>> "Darrell" == Darrell Berry <darrellb@hhcl.com> writes:
Darrell> Can anyone point me at one? Nothing fancy, I just want the
Darrell> skeleton to play with...in particular I am looking for proxy
Darrell> code which can build a database of visited links, rather than
Darrell> offer a caching service, but anything I can hack is fine ;-)
One of my Web Techniques columns was exactly that.
See them on-line at http://www.stonehenge.com/merlyn/WebTechniques/.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 389 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: Thu, 7 Aug 1997 21:08:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Darrell Berry <darrellb@hhcl.com>
Subject: Re: HTTP proxy server in perl?
Message-Id: <Pine.GSO.3.96.970807210734.5101G-100000@kelly.teleport.com>
On Thu, 7 Aug 1997, Darrell Berry wrote:
> Subject: HTTP proxy server in perl?
>
> Can anyone point me at one?
I think you could use the methods in Randal's eleventh Web Techniques
column, which explains how to make an anonymizing proxy server. 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.rahul.net/jeffrey/ovs/
------------------------------
Date: 6 Aug 1997 19:37:07 GMT
From: frank@cip.informatik.uni-wuerzburg.de (Stefan Frank (sf))
Subject: Re: More on angle operator's ignorance
Message-Id: <5sajp3$rr1@winx03.informatik.uni-wuerzburg.de>
Ronald Fischer (rovf@earthling.net) wrote:
: I recently posted a message about problems with the angle operator,
: while(<>) { ... }
: in that it bails out on filenames starting with a '+' sign (giving the
: message "can't open file" although the file is clearly readable).
You could use the special -- switch to stop switch interpretation, e.g.
perl -e 'while(<>){print}' -- -file
will print the contents of '-file' if present in the current
directory.
Regards,
-- Stefan
: I checked that the same occurs on files starting with a '-' sign, but
: did not find any other "magical" characters leading to this
: behaviour. Since + and - are commonly used to indicate command line
: switches, Perl seems to be confused by them.
: I did not locate any relationship in the camel book between command
: line switches and the angle operator, that would explain this
: behaviour. And, just for completeness: I do not use the "-s" switch
: (though this would also not explain this weird behaviour).
: --
: Ronald Fischer (rovf@Earthling.net) (PGP public key available)
: http://ourworld.compuserve.com/homepages/ronald_fischer/
: [When posting a followup, mailing a courtesy copy is fine, provided it is
: clearly marked as such.]
--
------------------------------
Date: Thu, 7 Aug 1997 21:14:27 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Matthew <nospam@webfuture.com>
Subject: Re: No Perls of wisdom here...
Message-Id: <Pine.GSO.3.96.970807211317.5101I-100000@kelly.teleport.com>
On Thu, 7 Aug 1997, Matthew wrote:
> I've heard that Perl Version 5.00x supports classes (or at least some OO
> stuff). Is this true.
Yes, it's true. You _have_ heard this. :-)
See some good examples in the manpages, including especially the
perltoot(1) manpage. If you don't have that one, you should get 5.004
installed right away. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 07 Aug 1997 12:32:12 +0200
From: Doug Seay <seay@absyss.fr>
To: Premgith Vidyanandan <vidyanan@pilot.msu.edu>
Subject: Re: Opening tcp connections....
Message-Id: <33E9A42C.39188CA0@absyss.fr>
Premgith Vidyanandan wrote:
>
> Hi I'm new to perl programming and I am starting to get the hang of the
> stuff slowly, however I'm still having trouble understanding socket
> connections.. Can anyone please tell me how I can open up a tcp connection
> with another machine and read or write to it.. I tried a perl script
> given in my book but it does not seem to work and I can't seem to
> understand some of the stuff either..
>
> When $sockaddr = 'S n a4 x8' , what do they mean by it??
It is a format field for pack(). "perldoc -f pack" for the details.
Think that "perldoc IO::Socket" has the best advice for creating
sockets, if only because this module has automated everything .
- doug
------------------------------
Date: Wed, 6 Aug 1997 23:03:21 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: pattern match/replace
Message-Id: <EEILDL.792@bcstec.ca.boeing.com>
In article <5sapcd$7ok@hurricane.jriver.com>,
Dan Brian <dan@clockwork.net> wrote:
>
> Can someone solve this one? I need this substitution to occur, and it must
> occur in one line of code (I know this can be inefficient). Several lines
> could also be doable.
>
> Assuming this is my line of text:
>
> < blah blah KEYWORD blah blah KEYWORD blah blah blah > KEYWORD < blah
> KEYWORD blah blah >
>
> I then need a search/replace string that will remove KEYWORD from strings
> where it occurs withing the < > brackets. Note that the word can occur
> numerous times withing the brackets, and that there can be several bracket
> sets on the text line. I need the above string to translate to:
>
> < blah blah blah blah blah blah blah > KEYWORD < blah blah blah >
>
> Can someone offer me a clean solution?
>
1 while s/(<[^>]*?)KEYWORD(?=.*?>)/$1/;
HTH,
--
Charles DeRykus
ced@carios2.ca.boeing.axe_it.com
------------------------------
Date: Thu, 07 Aug 1997 15:34:48 +0200
From: Doug Seay <seay@absyss.fr>
To: Daan <dvreijen@solair1.inter.nl.net>
Subject: Re: perl rpm ?
Message-Id: <33E9CEF8.3E7619C4@absyss.fr>
[posted and mailed]
Daan wrote:
>
> I'm looking for the perl 5.004 rpm. I tried compiling the perl sources but
> for some reason it can't locate gcc on my machine.
On my RH4.0 system, gcc is in /usr/bin
~/source> which cc gcc
/usr/bin/cc
/usr/bin/gcc
If they aren't there for you, break out your RH4.0 CD-ROM and install
the gcc package. Many Perl modules require a C compiler, so just do it
now, so you don't have to bother doing so later.
- doug
------------------------------
Date: Thu, 07 Aug 1997 16:05:21 -0700
From: Deepak Gupta <deepak@creative.net>
Subject: Persistent Hash
Message-Id: <33EA54B1.2094@creative.net>
Hi-
I am finding the tie portion of the perl reference inadequate for
learning about persistent hashes. I believe SDBM_File is standard.
Where is the authoritative doc on this module?
------------------------------
Date: 8 Aug 1997 02:04:28 GMT
From: elvislee@asiaonline.net (Lee Chun Ho)
Subject: Problem in running Perl with Novell web server 3.10
Message-Id: <5sdurc$jha3@news.asiaonline.net>
Keywords: Novell
Hello Everyone,
I have a problem in opening file with long filename with perl script
througth the browser . The platform/tool that I run the perl script
is as follows :
Novell netware version 4.11
Novell Web server version 3.10
Perl interpreter version 5.0 (Perl5.nlm)
(which shipped with Novell Web Server version 3.10)
My scripts is listed below :
There are three files under the "sys:/web/docs/document/test" directory
1. testingf.txt ( testingfail.txt)
2. testing0.txt ( testingfail2.txt)
3. testing.txt ( testing.txt)
script contents
******************************************************
require("cgilib.pl");
print &PrintHeader;
&ReadParse;
opendir(DIRHANDLE, "sys:/web/docs/document/test");
@filelist = readdir(DIRHANDLE);
closedir(DIRHANDLE);
foreach $file(@filelist)
{
print "File: $file<br>";
open(FILE, "sys:/web/docs/document/test/$file")||print "open $file fail<br>";
foreach $line (<FILE>) {
print "$line<br>";
}
close(FILE);
}
******************************************************
The result lists below :
********************************************************
File: TESTINGF.TXT
open TESTINGF.TXT fail
File: TESTING0.TXT
open TESTING0.TXT fail
File: TESTING.TXT
contents from file "testing.txt" .
*********************************************************
As shown above , I can successfully open the file
"testing.txt" but not the others with long filename .I
also expect it lists the long filename of each files
rather than the short form.
Actually , I also have the same problem in listing the
long filename with Netbasic scripts. Does anybody kind
enough to tell me the reason ? If it is the problem
of Perl & Netbasic, is there any language that I can
use with Novell Web server that I can list and open
file with long filename ? or Is it the server configuration
problem ?
If it is not the right news group for me to post this
question , can anybody suggest me which news group I can
post it ?
Thanks
Elvis Lee
(Program, Group MIS, Elec & Eltek International Ltd.)
elvislee@eleceltek.com
------------------------------
Date: Thu, 7 Aug 1997 21:12:48 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: ChetanPatil <cpatil@home.com>
Subject: Re: Process forking
Message-Id: <Pine.GSO.3.96.970807210945.5101H-100000@kelly.teleport.com>
On Thu, 7 Aug 1997, ChetanPatil wrote:
> Newsgroups: comp.lang.perl, comp.lang.perl.misc
If your news administrator still carries comp.lang.perl, please let him
or her know that that newsgroup has not existed since 1995. If you
have such an outdated newsgroup listing, you are probably missing out
on many other valid newsgroups as well. You'll be doing yourself and
many others a favor to use only comp.lang.perl.misc (and other valid
Perl newsgroups) instead.
> I am trying to do the following:
> while (machinelist){
> $machines{$_} = 1
> fork
> if parent, next
> if child, rsh to $_, process and exit
> }
If you're forking more than one or two processes, you must check that the
fork was successful; your machine can't run an infinite number of
processes! (Some say that you should always check; I'm one of those. :-)
> The program, goes into a loop in the first while and keeps in rshing to
> the machines.
That can happen when you don't check the return value of fork. :-)
> Will this work? I think I am conceptually flawed, in a sense, does a
> child process executes from the start?
No, it does everything just as the parent process does, with the exception
of the return value from fork. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 7 Aug 1997 11:37:07 GMT
From: Heinrich.Mislik@univie.ac.at (Heinrich Mislik)
Subject: Re: Range operator question
Message-Id: <5scc13$j5e@www.univie.ac.at>
In article <EEHv6n.7Dr@world.std.com>, aml@world.std.com says...
>
>># ???? (Prints 12345678910)
>>foreach(1 .. 10) {
>> print if $x .. $_ == 4;
>>}
>
>Ok, so $x is always true. This means that the range operator will
>always start. What happens is that once the range finishes with
>"$_ == 4", it will return true again when $_ is 5.
>
I didn't take into account, that the left side will be evaluated again, as
soon as the range switches to false. Now thats clear to me.
>
>># ???? (Prints nothing)
>>foreach(1 .. 10) {
>> print if "a" .. $_ == 4;
>>}
>
>for this one, if you ran with the "-w" switch, you would see what perl
>didn't like. It is trying to evaluate the constant value "a" as a
>numeric value. Probably a bug in perl.
>
I always use -w and there were no complaints!
--
__________________________________________________________________________
Heinrich Mislik Tel: +43 1 40 65 822 455 direct line
Vienna University Computer Center Fax: +43 1 40 65 822 170
Universitaetsstrasse 7
A-1010 Vienna, Austria/Europe Email: Heinrich.Mislik@univie.ac.at
__________________________________________________________________________
------------------------------
Date: Thu, 07 Aug 1997 14:47:15 -0400
From: Eliezer Mansour <ely@ml.com>
Subject: SEARCHABLE INDEX FOR THE LIST
Message-Id: <33EA1833.41C67EA6@ml.com>
Is there a searchable index for this list ??
Ely
------------------------------
Date: Thu, 7 Aug 1997 20:56:10 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Eliezer Mansour <ely@ml.com>
Subject: Re: SEARCHABLE INDEX FOR THE LIST
Message-Id: <Pine.GSO.3.96.970807205524.5101D-100000@kelly.teleport.com>
On Thu, 7 Aug 1997, Eliezer Mansour wrote:
> Subject: SEARCHABLE INDEX FOR THE LIST
Really, there's no need to shout.
> Is there a searchable index for this list ??
You probably want one of these, or their competition. :-) Hope this
helps!
http://www.dejanews.com/
http://www.altavista.com/
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 8 Aug 1997 07:58:44 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Searching for "similar" words
Message-Id: <ebohlmanEEL4tx.Dz8@netcom.com>
Tony Cox (a.cox@rbgkew.org.uk) wrote:
: I'm writing a script that takes a keywork supplied by the user and returns
: all the antries in a database that contain the word.
: However, I'd also like to return "similar" word in case they have misspelled
: the word - that way I can present a list of all possible/likely database
: records. Is there a way of doing this with Perl other than searching using
: regexs that represent many varieties of substrings of the keyword?
There are a couple entries in the Perl Modules FAQ listing modules for
approximate string matching and approximate regular expression matching.
You'd do well to take a look at CPAN.
------------------------------
Date: Thu, 07 Aug 1997 17:38:09 -0400
From: Dean Hoover <dhoover@textwise.com>
Subject: semaphores: semctl: how to pass ARG
Message-Id: <33EA4041.617E@textwise.com>
I'm attempting to implement the "Simpler Semaphore Operations"
as found in UNIX Network Programming by W. Richard Stevens
(my copy is copyright 1990) in Perl. In the "C" code Stevens
calls semctl like this:
semctl_arg.val = initval;
if (semctl(id, 0, SETVAL, semctl_arg) < 0)
...
How would I do the equivalent using the perl semctl? Specifically,
how would I set the 4th argument as in the "C" code above? I have
searched through the Camel book, Perl 5 Unleashed, Perl 5 How-To,
and the FAQ and can't seem to figure this out. Help is appreciated.
Thanks.
Dean Hoover
------------------------------
Date: Thu, 07 Aug 1997 12:22:10 +0200
From: Doug Seay <seay@absyss.fr>
To: Jason Varsoke <jjv@caesun.msd.ray.com>
Subject: Re: silencing system()
Message-Id: <33E9A1D2.62B73A47@absyss.fr>
[posted and mailed]
Jason Varsoke wrote:
>
> system("tar cfv foo.tar *"); or similar system() statement throws its
> output to my screen. How do I redirect it from inside perl?
> I would use an open (SYSTEM, "command @args|"); but I need the return
> code from the system statement.
If you had launched it with open(), check the return code of close().
But if you just don't want the output to go anywhere, why not just
redirect the output, like with
system("tar cfv foo.tar * >/dev/null 2>/dev/null")
Since you are calling system() with a single string containing
meta-characters, it is passed to "/bin/sh -C" for handling. Let the
Bourne shell redirect your output for you. Of course, if you are using
MS-DOG or some other OS, the rules might be different.
- doug
------------------------------
Date: 7 Aug 1997 16:05:36 GMT
From: Shimpei Yamashita <shimpei@socrates.caltech.edu>
Subject: Re: sleep not mixing well with other signal handlers
Message-Id: <5scrog$is8@gap.cco.caltech.edu>
Charles DeRykus <ced@bcstec.ca.boeing.com> writes:
>Er, forget the above. The problem is much simpler.
>
>Apparently, sending a SIGSTOP generates a SIGCHLD. This
>is what causes the second sleep to be cancelled. Here's
>a one possibility that fixes this:
>
>...
>sleep 2;
>{
> local $SIG{CHLD} = 'IGNORE';
> kill 'STOP', $child or warn "couldn't SIGSTOP $child\n";
> sleep 10;
>}
>...
Oh, duh! I was afraid I wouldn't properly handle death of the child if
I ignore SIGCHLD--but of course the child would never die on its own
after I suspend it. Thanks. I'll give it a try.
--
Shimpei Yamashita <http://www.patnet.caltech.edu/%7Eshimpei/>
------------------------------
Date: Thu, 7 Aug 1997 20:59:54 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: perrella andrew c <perrella@ehsn23.cen.uiuc.edu>
Subject: Re: Sorting With Perl
Message-Id: <Pine.GSO.3.96.970807205701.5101E-100000@kelly.teleport.com>
On Thu, 7 Aug 1997, perrella andrew c wrote:
> I am working on a phone book script. Basically I have
> everything working well except that I would like to sort the entries.
There are some good suggestions in the FAQ and manpages on various ways of
sorting, including sorting on a computed value. Do you need something more
than what's there? Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Aug 1997 03:01:04 GMT
From: Dan Harkless <dan_aug97@unitech.com>
Subject: The eternal question: Has anyone gotten DynaLoader to work on AIX 4.1?
Message-Id: <5se25g$8cc$1@speedx1.speed.net>
I've been meaning to get into perl for some time now, for CGI, database, and
other scripting purposes, and I finally bit the bullet, but I can't get perl to
work with dynamic loading on my AIX 4.1.4 system.
I went through Deja News, and there were about 47 articles about how dynamic
loading doesn't work out-of-the-box on AIX 4, but none of the suggestions there
that I tried worked.
I am using IBM's C Set ++. I also have gcc installed, but haven't tried it
yet.
This is kinda frustrating -- has there ever been a solution to the perl
installation problem on AIX 4? Maybe a beta version of perl or something?
--
Dan Harkless Unitech Research, Inc. <dan_aug97@unitech.com>
NOTE: This is a monthly mail alias used to post to the USENET without
conSPAMinating my real address. If you are replying after August 1997,
your mail may bounce. If so, replace 'aug with the current month's abbrev.
------------------------------
Date: Thu, 07 Aug 1997 09:30:25 -0500
From: "John T. Beadles" <beadles@nt.com>
To: "donf@eds.com" <>
Subject: Re: Using Perl/Netscape in a Standalone environment
Message-Id: <33E9DC01.6ED4@nt.com>
Jim Michael wrote:
>
> Don Frazier (donf@eds.com) wrote:
> : I have Win 95 running, Netscape 3.0, and Perl from
> : activeware the 5.003 or whatever build from the end
> : of July. I've searched for instructions but can't seem
> : to make the right connection. It seems I need a server
> : to interpret my CGI scripts so I downloaded the Microsoft
> : Personal Web Server. I don't have a physical network
> : card so now I get several error messages on the NET START
> : command added by installing PWS. THe HTTP service
> : does not start when I view it in the PWS applet from
> : control panel.
>
> I don't know if you can install TCP/IP in a system without a net card,
> if you can use 127.0.0.1 (loopback address) as the IP address. An ISA net
> card should run about $30 if required. For instructions on getting your
> web server to work with Perl you should check the Microsoft web site and
> the dejanews database. Try a search on 'perl personal web server' and
> search the old and new databases. I bet there is even a newsgroup for cgi
> questions. Good luck!
Might try this...
I think you have to have an adapter to get TCP/IP
to install, so try installing the dial-up
networking adapter. Set your TCP/IP protocol for
a fixed IP address. You can use one of the
non-routable 10.*.*.* addresses. These addresses
are documented in the TCP/IP RFCs somewhere, but I
can't remember it off the top of my head.
------------------------------
Date: 07 Aug 1997 08:50:17 +0200
From: Ronald Fischer <rovf@earthling.net>
Subject: Why is `command @ARRAY` rejected by Perl, sometimes.
Message-Id: <xz2iuxi8p1y.fsf@uebemc.siemens.de>
In Perl 5.002, the program
&init;
print qx(echo @OUTFILES);
sub init
{
@OUTFILES=(1);
}
gives the error message
Literal @OUTFILES now requires backslash at t.pl line 4, within string
Execution of t.pl aborted due to compilation errors.
while reordering as
sub init
{
@OUTFILES=(1);
}
&init;
print qx(echo @OUTFILES);
runs fine. Is this a bug? Does Perl 5.004 exhibit the same behaviour?
--
Ronald Fischer (rovf@Earthling.net) (PGP public key available)
http://ourworld.compuserve.com/homepages/ronald_fischer/
[When posting a followup, mailing a courtesy copy is fine, provided it is
clearly marked as such.]
------------------------------
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 826
*************************************