[8489] in Perl-Users-Digest
Perl-Users Digest, Issue: 2106 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 16 02:07:51 1998
Date: Sun, 15 Mar 98 23:00:27 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 15 Mar 1998 Volume: 8 Number: 2106
Today's topics:
Re: "Premature End of Script Headers" (Lee Feigenbaum)
Re: calculating distance between strings (fortune cooki <rjk@coos.dartmouth.edu>
Geting value of the 'Bang' pittelli@envmed.rochester.edu
Re: Help sought with web programming security problem <condor@nuc.net>
Re: help: table-format hash assignments neq $x{k} = 'v' <uri@sysarch.com>
Re: Is there a "Newsgroup" for Newbies to Perl? (John Stanley)
Re: Is there a "Newsgroup" for Newbies to Perl? (Jim Britain)
Re: Newbie's question about package (David Adler)
Perl *qw* explanation please (Michael Wang)
Re: Perl *qw* explanation please <chasecreek.systemhouse@usa.net>
Re: Perl *qw* explanation please <jdf@pobox.com>
perl 5.004_04 dumps core (Gabor)
Perl for Win32 <huskystudio@geocities.com>
Re: Perl For Windows NT <huskystudio@geocities.com>
Re: Perl Win95 Sockets <ctrotto@trotto.com>
Re: regexp list context substitution (Peter Williams)
removing everything between < and > <yashesh@eecs.berkeley.edu>
sendmail? <soccer@all-soccer.com>
Re: sendmail? <chasecreek.systemhouse@usa.net>
Socket IO, non echoed? <aet@aryth.webplanets.com>
Re: Socket IO, non echoed? <chasecreek.systemhouse@usa.net>
Re: Socket IO, non echoed? <uri@sysarch.com>
Re: sockets <rjk@coos.dartmouth.edu>
Spitting Arrays/Variables <jesse@savalas.com>
Splitting Arrays/Variables <jesse@savalas.com>
Re: Tied and blessed? <aet@aryth.webplanets.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 16 Mar 1998 05:12:40 GMT
From: feigenb@hcs.harvard.edu (Lee Feigenbaum)
Subject: Re: "Premature End of Script Headers"
Message-Id: <350db4b1.2194977@news.fas.harvard.edu>
I'm not using print headers; and sticking in use diagnostics didn't
point out any errors I was missing :-(
any other ideas out there?
Lee
On Mon, 16 Mar 1998 01:46:37 GMT, Sneex
<chasecreek.systemhouse@usa.net> wrote:
>Off the top of my head are you using a -
>
>print header; # Available with CGI.pm, see a related post I made here...
>
>Near the beginning of your script, especially before anything else is
>output?
>
>Also, try 'use diagnostics;' That would almost guarantee that any issues
>will show up in the browser, if there are hidden errors...
>
>/^HTH$/;
>Sneex :)
>
>
>Lee Feigenbaum wrote:
>
>> I know this may be more of a CGI question that a Perl question, but I
>> was having toruble posting to the CGI newsgroup, so please abre with
>> me, and thanks in advance for any help:
>>
>> I have a Perl CGI script (using CGI.pm) that will run fine in offline
>> debug mode (fromt he command line) but gives me an Internal Server
>> Error when I try to access it from the web - checking the server's
>> error_log - It shows that access to the file failed for reason"
>> premature end of script headers.
>>
>> Can anyone tell me what is the usual cause for this type of error (if
>> there is a usual cause)? Thanks a lot,
>>
>> Lee
>
>
------------------------------
Date: Mon, 16 Mar 1998 01:01:31 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: calculating distance between strings (fortune cookies)
Message-Id: <350CC03D.BE37C129@coos.dartmouth.edu>
Simon Oosthoek wrote:
>
> I'm looking for a program/script/whatever that can calculate the distance
> between two text-strings. By distance I mean that I want to find strings that
> human beings can identify as "the same", but a computer would not directly
> consider equal in the sense: ($StrX eq $StrY)
This sounds interesting. Could you be more specific about what you mean by
"distance"? In particular, what ideas do you have for calculating the
distance? You could do something with the lengths of the strings and the
number of non-matching characters. But you'd also have to allow for offets,
such as "bar" and " bar"...
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 15 Mar 1998 23:34:06 -0600
From: pittelli@envmed.rochester.edu
Subject: Geting value of the 'Bang'
Message-Id: <6eidh0$329$1@nnrp1.dejanews.com>
How in a (CGI) Perl script can one get the value of the 'bang' (first line of
script on a Unix system, telling where the Perl runtime is)?
I can't use $0 to read the script directly b.c. it doesn't reliably give the
full script path (across various systems -- in fact, CGI's $ENV{'SCRIPT_NAME'}
also doesn't reliably give the full script path), plus when invoking the
script via CGI, the default directory is also system/server dependent and thus
also unreliable!
????
Please cc any answers to:
pittelli@envmed.rochester.edu
Thanks!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sun, 15 Mar 1998 23:59:46 -0600
From: "John Vanderbeck" <condor@nuc.net>
Subject: Re: Help sought with web programming security problem
Message-Id: <6eif2q$7me$1@server.cntfl.com>
>> As the others respondants have mentioned, this is
>> off topic for this group; see a CGI-related group.
>
>Such as? I searched and these are what I found.
Such as comp.infosystems.www.authoring.cgi
--
- John Vanderbeck <--> condor@neotechonline.com
NeoTECH Online <--> http://www.neotechonline.com
Game Design <--> http://www.neotechonline.com/gamedesign
Woody Durham wrote in message <350C3363.7437@isporg.com>...
>
>
>> To serve secure data,
>> it must be served from a non-servable place &
>> by your CGI ONLY... :)
>
>Okay, any specifics?
------------------------------
Date: 15 Mar 1998 22:22:20 -0500
From: Uri Guttman <uri@sysarch.com>
To: Terrence Brannon <brannon@surf.usc.edu>
Subject: Re: help: table-format hash assignments neq $x{k} = 'v' assignments
Message-Id: <x790qbl3pv.fsf@sysarch.com>
Terrence Brannon <brannon@surf.usc.edu> writes:
> I attempted to bind hash entries as follows
>
> %type_face = (
> neuron::hoc::neuron::mechanisms => font-lock-type-face,
> neuron::hoc::neuron::pointprocesses => font-lock-type-face,
> ... [abbreviated]
> neuron::hoc::misc::proc-like => font-lock-function-name-face
> );
neuron::hoc::misc::proc-like => 'font-lock-function-name-face',
you have minus '-' chars in the value strings. they are treated as
expressions and not proper bare words so they must be quoted in the
assignment. you could use qw() instead and then you won't need the => or
, either. choose your own style.
HTH,
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: 16 Mar 1998 03:37:34 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6ei6pu$2dr$1@news.orst.edu>
In article <6ehqlk$o90@newsops.execpc.com>,
Mark Stackhouse <stackhou@execpc.com> wrote:
><HTML>
>
><BLOCKQUOTE TYPE=CITE>
<DORKQUOTE ... > is the proper citation.
>Because maybe the Cookbook will actually provide links to what one is looking
>for!
Are you looking for  ? I am unfamiliar with that function.
>Today I needed a reference to a rounding function.
I don't believe that   is a rounding function. Have you read the
documentation at all?
><P>FAQ has a question - Does Perl have a round function? All right...
No, Perl does not have a round function  . It has a round function
called int.
><P>Now I'm in Perl Docs... do a text search on the word "round"..."Search
>string not found" OK... search on "function".
Well, stop looking for nbsp and you won't get that error message.
><P>Mark
><BR>
Goodybe PMark.
------------------------------
Date: Mon, 16 Mar 1998 05:55:27 GMT
From: jbritain@home.com (Jim Britain)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <350cbdfa.34452539@news>
On Sun, 15 Mar 1998 10:11:59 -0500, "Bob Gwynne"
<gwynne@utkux.utk.edu> wrote:
>I propose that the wizards create a FAQ that is not as difficult
>to navigate as the current FAQ and that is much more comprehensive. It would
>be a trivial task for the wizards to create a searchable FAQ along the lines
It's amazing how some see the solution to a problem in proposing that
someone else do all the required work.
------------------------------
Date: 16 Mar 1998 04:59:11 GMT
From: dha@panix.com (David Adler)
Subject: Re: Newbie's question about package
Message-Id: <slrn6gpccv.8b0.dha@panix.com>
On 06 Mar 1998 12:10:33 -0500, Jonathan Feinberg <jdf@pobox.com> wrote:
>? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au> writes:
>
>> qw is more convent.
>
>I think of it as more abbey. Abbey... gail.
<Whistle>! And there's a flag on the play! Double reference/pun jump -
five yards...
--
David H. Adler - <dha@panix.com>
"The perversity of the Universe tends towards a maximum."
------------------------------
Date: 16 Mar 1998 03:09:55 GMT
From: mwang@alhena.ibk.ml.com (Michael Wang)
Subject: Perl *qw* explanation please
Message-Id: <6ei563$co3$1@news.ml.com>
In order to use -w switch and use strict, I find and
often have to use qw, but the Perl book does not give much
explanation about what qw is, what is a qw?
use POSIX qw(htonl getrpcbyname);
------------------------------
Date: Mon, 16 Mar 1998 04:06:04 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Perl *qw* explanation please
Message-Id: <350CA3DE.45827202@usa.net>
qw = quote words
IE - use Shell qw(ls cat find);
Would be use Shell ("ls", "cat", "find");
/^HTH$/;
Sneex :)
Michael Wang wrote:
> In order to use -w switch and use strict, I find and
> often have to use qw, but the Perl book does not give much
> explanation about what qw is, what is a qw?
>
> use POSIX qw(htonl getrpcbyname);
------------------------------
Date: 16 Mar 1998 01:09:51 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Perl *qw* explanation please
Message-Id: <zpiryxn4.fsf@news.concentric.net>
mwang@alhena.ibk.ml.com (Michael Wang) writes:
> In order to use -w switch and use strict, I find and
> often have to use qw, but the Perl book does not give much
> explanation about what qw is, what is a qw?
>
> use POSIX qw(htonl getrpcbyname);
You'll want to read the perlop document, which explains qw/, and its
friends q//, qq//, and qx//.
>From perlop:
qw/STRING/
Returns a list of the words extracted out of STRING, using embedded
whitespace as the word delimiters. It is exactly equivalent to
split(' ', q/STRING/);
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 16 Mar 1998 04:54:44 GMT
From: gabor@vmunix.com (Gabor)
Subject: perl 5.004_04 dumps core
Message-Id: <slrn6gpcs3.ojs.gabor@vnode.vmunix.com>
I have written a server which forks child processes to handle incoming
connections. The child uses 'require' to load one of two modules to
process incoming data and then writes the results back to the client.
Sometimes the child dumps core and the server itself merrily chugs
along accepting connections.
Here is the error I get
perl in malloc(): warning: recursive call
Out of memory!
perl in free(): warning: recursive call
I have no recursive subroutines in the modules, by the way.
The machine this is on has 256M of memory and the swap is never even
hit. There is always at least 20M free and over a 100M cache in high
speed RAM. Here is the output of perl -V.
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
Platform:
osname=freebsd, osvers=3.0-980304-snap, archname=i386-freebsd
uname='freebsd cucumber.cis.uoguelph.ca 3.0-980304-snap freebsd 3.0-980304-snap #6: thu mar 5 17:49:01 gmt 1998 root@cucumber.cis.uoguelph.ca:usrsrcsyscompilestone i386 '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O', gccversion=2.7.2.1
cppflags='-I/usr/local/include'
ccflags ='-I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=true
voidflags=15, castflags=0, d_casti32=undef, d_castneg=define
intsize=4, alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-lm -lc -lcrypt
libc=/usr/lib/libc.so.3.1, so=so
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-DPIC -fpic', lddlflags='-Bshareable -L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under freebsd
Compiled at Mar 5 1998 20:00:58
@INC:
/usr/local/lib/perl5/i386-freebsd/5.00404
/usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/i386-freebsd
/usr/local/lib/perl5/site_perl
.
------------------------------
Date: Mon, 16 Mar 1998 14:45:49 +0800
From: "Husky" <huskystudio@geocities.com>
Subject: Perl for Win32
Message-Id: <6eihlb$nrv@news.microsoft.com>
I downloaded Perl for Win32 from http://www.activestate.com
and install on my Windows NT 4.0 with IIS4 platform.
I wrote a perl script in /Scripts lauched by a FORM in THML.
When I use browser to submit the form, an eooro message appears:
HTTP/1.0 501 Not support
Does any one have the experience of Perl for Win32 vs. NT?
Could you tell me why I can use this?
Andrew Wang
------------------------------
Date: Mon, 16 Mar 1998 14:06:58 +0800
From: "Husky" <huskystudio@geocities.com>
Subject: Re: Perl For Windows NT
Message-Id: <6eifck$grq@news.microsoft.com>
I move the perl script into /scripts already but it doesn't work either.
Always displays the error message "HTTP/1.0 501 Not Support"
Do you have any sample files for Perl for W32?
>Your script should go into InetPub/scripts instead of wwwroot/cgi-bin.
>You can create an alias for InetPub/scripts and call it cg-bin inside
>your server. Seem to remember a checkbox to enable Perl on one of
>the server config screens also.
I can't find any perl config in IIS4.0.....
Do you know which one?
>> This is my first time to try to use Perl on Windows NT platform.
>> But when I use browser to see the result, it shows:
>> HTTP/1.0 501 Not Support
>>
>> I write down my step and hope you can help me...
>>
>> 1. launch Pw32i315.exe (1,510 KB) (Perl for Win32 Intel/x86 binary) and
>> install Perl on my NT 4.0 successfully.
>> 2. Prepare a HTML in my web (d:\InetPub\wwwroot) like this:
>>
>> <form method="POST" action="http://husky/cgi-bin/comments.pl">
>> <p>Please :<input type="text" name="address" size="20"></p>
>> <p>Your Comments:</p>
>> <p><textarea rows="5" name="comments" cols="20" </textarea></p>
>> <p><input type="submit" value="Submit" name="B1">
>> <input type="reset" value="Reset" name="B2"</p>
>> </form>
>>
>> 3. Prepare a PL file named comments.pl in (D:\InetPub\wwwroot\cgi-bin)
and
>> jsut print something:
>>
>> print <"EndOfMessage";
>> <html>
>> <head>
>> <title>This is a test </title>
>> </head>
>> <body>
>> <h1>Hi</h1>
>> </body>
>> </html>
>> EndOfMessage
>>
>> 4. Browser HTML and click the Submit button.
>>
>> Is there any steps I lost something?
>> Please do me a favor...
>>
>> Thanks
>> Andrew Wang
>>
>>
------------------------------
Date: Sun, 15 Mar 1998 21:55:42 -0600
From: "carl m. trotto jr." <ctrotto@trotto.com>
Subject: Re: Perl Win95 Sockets
Message-Id: <350CA2BE.1A9C6BA3@trotto.com>
Thanks for the response but the code isn't TCP but UDP. Any ideas. Has
anyone actually got this to work?
Regards,
Carl
------------------------------
Date: 15 Mar 1998 18:17:29 GMT
From: williams@eisws25.jpl.nasa.gov (Peter Williams)
Subject: Re: regexp list context substitution
Message-Id: <slrn6go6po.5ft.williams@eisws25.jpl.nasa.gov>
[posted and mailed]
On Fri, 13 Mar 1998 14:14:29 -0800, ryan pc gibson <ryanpc@lbin.com> wrote:
>hello,
>
> how can i apply a substitution regexp to an array? for example:
>
> @html = <FH>;
> @html =~ s/<tr>(.*)<\/tr>/<tr align=center>$1<\/tr>/sm;
>
Try the map operator:
@html = map { s/<tr>(.*)<\/tr>/<tr align=center>$1<\/tr>/sm; $_ } @html;
See the entry in the perlfunc manpage for further details.
--
Peter Williams <peter.williams@jpl.nasa.gov>
Hey, I had to let awk be better at *something*... :-)
-- Larry Wall in <1991Nov7.200504.25280@netlabs.com>1
------------------------------
Date: Sun, 15 Mar 1998 22:41:51 -0700
From: Yashesh Shroff <yashesh@eecs.berkeley.edu>
Subject: removing everything between < and >
Message-Id: <350CBB9F.B9FA59F9@eecs.berkeley.edu>
hi all!
I have tried the perl documentation but was not able to find any source
for my following problem:
I would like to remove everything between '<' and '>' in a line and for
all the instances. I am trying to work out a script that basically
removes all the formatting tags in an HTML document. For the script:
-----------
$line = "This is <strong>strong</strong> and this is <b>bold</b> and
this is plain text.";
$line =~ s/<.+>//g;
print $line;
----------------------------
I get the result:
This is and this is plain text <<notice that "strong" and "and this
is" and "bold" are also removed!
--------------------------------------------
everything between < and > is removed, however, if there is a second '>'
in the line, perl takes the largest instance of the match.
Anyway of making perl see the shortest instance of a match?
I cannot use the HTML module because it is not availabe on my university
system.
Thankyou for any answers.
regards,
yashesh
yashesh@eecs.berkeley.edu
------------------------------
Date: Sun, 15 Mar 1998 22:11:01 -0500
From: Geoffrey Hebert <soccer@all-soccer.com>
Subject: sendmail?
Message-Id: <350C9845.55847277@all-soccer.com>
I have a perl script to send mail.
When the email address is good everything works.
When the email address is invalid, nothing happens. I would like to get
returned
to the sender the same thing I get when I use email and get returned
email because
the email address was not correct.
I added REPLY-TO in my last attempt. It did not work.
Here is my code:
open (MAIL,"| sendmail $emailList")
or die "Can not open mail at this time, try later";
print MAIL "FROM: $fromEmail \($fromFirst $fromLast $Llong_name Team
$fromTeam\)\n";
print MAIL "SUBJECT: $subject\n";
print MAIL "REPLY-TO: $fromEmail\n";
print MAIL "\n";
print MAIL "$desc\n";
print MAIL "\n";
print MAIL "$Llong_name at www.all-soccer.com/leagues/$league/\n";
print MAIL "email $admin\n";
print MAIL "AAA000\n";
close (MAIL);
------------------------------
Date: Mon, 16 Mar 1998 03:58:39 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: sendmail?
Message-Id: <350CA221.55441051@usa.net>
Did you try
print MAIL "Return-path: whoever\@whereever.net\n";
/^HTH$/;
Sneex :)
Geoffrey Hebert wrote:
> I added REPLY-TO in my last attempt. It did not work.
>
------------------------------
Date: 15 Mar 1998 12:04:50 GMT
From: Andy Tompkins <aet@aryth.webplanets.com>
Subject: Socket IO, non echoed?
Message-Id: <6egg52$a1c$2@aginor.webplanets.com>
Suppose you have two IO::Socket objects, which are being passed around
among other objects. One represents input, the other output, for a single
connection instance. (This is from the perspective of the server.) I
would like to do a non echoed read from the input object.
As in , assume $cin and $cout are the objects.
$cout->print("password: ");
my $password = $cin->getline();
Ive tried stty echo/-echo, but it did not work.
I also tried Term::ReadKey. Also did not work.
Is it possible to do this?
Thanks
--- andy
------------------------------
Date: Mon, 16 Mar 1998 04:12:08 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Socket IO, non echoed?
Message-Id: <350CA549.AABCA900@usa.net>
Although I haven't done this with perl, I would assume that the same action,
using ANSI related modules on CPAN, probably could set the character
foreground color to the background color thereby hiding it.
/^Hmmm$/;
Sneex :)
Andy Tompkins wrote:
> Suppose you have two IO::Socket objects, which are being passed around
> among other objects. One represents input, the other output, for a single
> connection instance. (This is from the perspective of the server.) I
> would like to do a non echoed read from the input object.
> As in , assume $cin and $cout are the objects.
> $cout->print("password: ");
> my $password = $cin->getline();
> Ive tried stty echo/-echo, but it did not work.
> I also tried Term::ReadKey. Also did not work.
> Is it possible to do this?
> Thanks
> --- andy
------------------------------
Date: 16 Mar 1998 00:18:00 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Socket IO, non echoed?
Message-Id: <x767lfkyd3.fsf@sysarch.com>
Sneex <chasecreek.systemhouse@usa.net> writes:
> Although I haven't done this with perl, I would assume that the same action,
> using ANSI related modules on CPAN, probably could set the character
> foreground color to the background color thereby hiding it.
sneex,
you are way off here! how can the process on this side of a socket find
out what the colors on a remote socket?
>
> Andy Tompkins wrote:
>
> > Suppose you have two IO::Socket objects, which are being passed around
> > among other objects. One represents input, the other output, for a single
> > connection instance. (This is from the perspective of the server.) I
> > would like to do a non echoed read from the input object.
> > As in , assume $cin and $cout are the objects.
> > $cout->print("password: ");
> > my $password = $cin->getline();
> > Ive tried stty echo/-echo, but it did not work.
> > I also tried Term::ReadKey. Also did not work.
> > Is it possible to do this?
sockets don't do echoing by themselves. in general plain socket
connections do not support any form of tty control (which is what you
want since that is where echo resides). if the connection is done with
the telnet protocol then there is an inband protocol to do some remote
terminal handling stuff (i don't know the details offhand).
the Net::Telnet module is client side only from what i can tell. but it
seems to have some control (or negotiation of control) of echo with the
other side.
hth,
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: Mon, 16 Mar 1998 01:11:45 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: sockets
Message-Id: <350CC2A4.A6EEE78D@coos.dartmouth.edu>
Matthew S. Britt wrote:
>
> Is there a way to 'peek' into a created socket to see if there is anyone
> waiting to accept. I want the program to check every x seconds, and if no
> one is there, to do other work. Is there a way to do this?
One way to do this is to use non-blocking sockets:
use Fcntl;
fcntl($sock, &F_SETFL, O_NDELAY);
But using select might be better.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 15 Mar 1998 19:04:19 -0800
From: Jesse Rosenberger <jesse@savalas.com>
Subject: Spitting Arrays/Variables
Message-Id: <6ei4rm$6uo@bgtnsc03.worldnet.att.net>
Question #1: I have a array named @arr, that has 4 numbers in
it...numbers differ every time with a number 1-4...but the array
contents
look like "4 3 2 1", how can I split this array into 4 seperate
variables...
Example: I have an array: @arr = "3 4 2 1", I want $anum to equal 3,
$bnum to equal
4, $cnum to equal 2, and $dnum to equal 1. I know it's pretty easy and
I used to know how to do it but I seem to have forgotten after not doing
it for a while.
Question #2: How can you take a variable that contains a word....that
may contain spaces...and break each letter into a seperate
variable...the word may be any length, but will probably not contain any
characters besides letters, and spaces (let's assume it won't) how could
I go about doing this?
Thanx in advance,
Jesse Rosenberger
------------------------------
Date: Sun, 15 Mar 1998 21:52:51 -0800
From: Jesse Rosenberger <jesse@savalas.com>
Subject: Splitting Arrays/Variables
Message-Id: <6eieng$e0a@bgtnsc02.worldnet.att.net>
Question #1: I have a array named @arr, that has 4 numbers in
it...numbers differ every time with a number 1-4...but the array
contents look like "4 3 2 1", how can I split this array into 4 seperate
variables... Example: I have an array: @arr = "3 4 2 1", I want $anum to
equal 3, $bnum to equal 4, $cnum to equal 2, and $dnum to equal 1. I
know it's pretty easy and I used to know how to do it but I seem to have
forgotten after not doing it for a while.
Question #2: How can you take a variable that contains a word....that
may contain spaces...and break each letter into a seperate
variable...the word may be any length, but will probably not contain any
characters besides letters, and spaces (let's assume it won't) how could
I go about doing this?
Thanx in advance,
Jesse Rosenberger
------------------------------
Date: 15 Mar 1998 11:58:10 GMT
From: Andy Tompkins <aet@aryth.webplanets.com>
Subject: Re: Tied and blessed?
Message-Id: <6egfoi$a1c$1@aginor.webplanets.com>
Jean-Louis Leroy <jll@skynet.be> wrote:
> Hello,
> I may soon have the need to tie a hash and have it behave like an object as well.
> Is that allowed? I tried the following, which almost worked:
> As you see, DESTROY is called twice; I speculate that one accounts for untying
> and the other for the object going out of scope.
> Any input on this is welcome...
> jl
Well, try JUST letting it go out of scope?
Then you would know for sure if that is the reason its called twice.
--- andy
------------------------------
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 2106
**************************************