[7852] in Perl-Users-Digest
Perl-Users Digest, Issue: 1477 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 15 15:07:32 1997
Date: Mon, 15 Dec 97 12:00:23 -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 Mon, 15 Dec 1997 Volume: 8 Number: 1477
Today's topics:
Re: 'inportb' and 'outportb' missing from Perl? <reibert@mystech.com>
Re: Best port to Win 95? (Dustin Mollo)
Re: Embedding Perl In A C++ Program <NOSPAMkaro@artcom.net>
Re: Embedding Perl In A C++ Program <p-ciccone@usa.net>
Re: Extended character (?) <barnett@houston.Geco-Prakla.slb.com>
Re: Help with VERY simple problem (Michael Budash)
Re: Help with VERY simple problem (brian d foy)
Hex, Oct, and Bin convertor? (Heng-Chih Lin)
Re: HTTP/1.0 500 Server Error (/cgi-bin/multiple_forms. (brian d foy)
Re: Learning Perl - How to start <cjlf@netcom.com>
Re: Msql <khera@kciLink.com>
Re: NEED: Fast, Fast string trim() <rets@meta3.com>
Re: NEED: Fast, Fast string trim() <reibert@mystech.com>
Re: NEED: Fast, Fast string trim() (Matthew Cravit)
Perl 5.004_04 install error - can't find compiler? nathan_loyer@vapower.com
Perl url redirect <shawn@wwgv.com>
Re: PIng a Port <cchkxh@ARCO.com>
Re: Please advise. Fastest way to line-count files <kgraham@alpha.furman.edu>
Re: Problem with Sys::Syslog <khera@kciLink.com>
Re: Teaching programing <tchrist@mox.perl.com>
Re: Workaround for FLOCK?/When is FLOCK not supported? <VikR@aol.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 15 Dec 1997 10:28:24 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: 'inportb' and 'outportb' missing from Perl?
Message-Id: <349568B8.4B4F9289@mystech.com>
greg aiken wrote:
> How does one do this in Perl? I really like Perl, and I use it for most
> all tasks that I need to do, however, I now find that I need to write
> programs to access installed hardware on my PC (specifically an Intel
> 8255A programmable peripheral interface chip), and I can't figure out how
> to specifically read and/or write to a SPECIFIC address location in
> memory. Certainly, a Perl guru out there must know how this can be done.
>
> PS - ALL languages for the PC allow this functionality; C (inport,
> inportb, outport, outportb), Pascal (Port, Portw), even Basic can do this
> (although I can't immediately find the mneumonics for the command). I
> can't believe Perl can't handle this task.
Just as a note, the LANGUAGE itself does not allow this functionality (at
least in C - I don't know about Pascal or Basic). The inportb and outportb
functions are not defined in C (heck, printf is not even in the formal
language definition), but are generally supported in the libraries supplied
by C compilers for PC platforms. (You won't find inportb on UNIX!) In that
sense, I wouldn't look for an equivalent in the Perl language, but instead
check for extensions in the Win32 port of Perl (www.activestate.com) that
allow this functionality. Also, check the CPAN for an already-written module
that provides what you need.
Mark Reibert
-----------------------------
Mark S. Reibert, Ph.D.
Mystech Associates, Inc.
3233 East Brookwood Court
Phoenix, Arizona 85044
Tel: (602) 732-3752
Fax: (602) 706-5120
E-mail: reibert@mystech.com
-----------------------------
------------------------------
Date: 15 Dec 1997 19:06:04 GMT
From: dustin@sonic.net (Dustin Mollo)
Subject: Re: Best port to Win 95?
Message-Id: <673v2s$v52$1@ultra.sonic.net>
Martien Verbruggen (mgjv@comdyn.com.au) wrote:
: In article <3492fc11.7080162@news.one.net>,
: y@rrrr.pah (dave) writes:
:
: > What is best port of Perl to Win 95?
:
: Go to http://language.perl.com/info/software.html, and look at the
: Alien Ports section
Actually, this page is rather dated. I still have a few more things to add
to the page, but take a look at http://www.perl.com/latest.html. That is
rather recent, and includes a nice little description of why one would want
ActiveState's version of Perl over Gurusamy's version and vice-versa
(thanks to Jeff Urlwin).
The things I need to add, are the platforms that Perl will natively compile
for. I have the UNIX variants listed, but I also understand it will compile
on VMS (which versions though), and someone told me that it will compile on
OS/2. These, among a few other things, should be added to the page shortly.
If anyone has any thing else, let me know!
-Dustin
------------------------------
Date: Mon, 15 Dec 1997 18:00:09 +0100
From: Benjamin Pannier <NOSPAMkaro@artcom.net>
Subject: Re: Embedding Perl In A C++ Program
Message-Id: <34956219.BD2F8A38@artcom.net>
Tom Phoenix wrote:
>
> On Sun, 14 Dec 1997, Greg Teets wrote:
>
> > I'd like to use some Perl string processing functions within a C++
> > program I'm doing. Please point me in the right direction for
> > information on how to do this.
>
> There's a man page called 'perlembed'. Does that point you in the right
> direction? Hope this helps!
Also have a look at some examples:
http://www.artcom.net/~karo/perl/
-karo
--
__/__/__/\ Benjamin Pannier,ART+COM GmbH,BudapesterStr44,D-10787Berlin
__/__/__/\/ Tel:(+49-30)25417-3 Fax:(+49-30)25417-555
__/__/__/\/ Email:karo@artcom.net WWW:http://www.artcom.net/~karo/
__\__\__\/ Email:karo@artcom.org me@karo.org i.am@ka.ro karo@artcom.de
------------------------------
Date: 15 Dec 1997 10:54:40 -0800
From: Paolo Ciccone <p-ciccone@usa.net>
Subject: Re: Embedding Perl In A C++ Program
Message-Id: <wklnxm1lov.fsf@usa.net>
>>>>> "GT" == Greg Teets <teetshd@email.uc.edu> writes:
GT> Thinking that I might have perlmain.c somewhere, I did a serch
GT> on my hard drive. Alas, the file was not found. Perhaps you
GT> could direct me to where to find the file or perhaps where I
GT> could find even more information.
You need to download the source distribution of Perl that *has* to be
available for each platform. Look on CPAN or on the site from were you
download the biniries.
--Paolo
------------------------------
Date: Mon, 15 Dec 1997 11:05:19 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Extended character (?)
Message-Id: <3495634E.DD5F5B02@houston.Geco-Prakla.slb.com>
Creede Lambard wrote:
> Usually I do something like this:
>
> $myCommand = "foo bar baz " . "\cD";
> system("$myCommand") or die "Couldn't do the following command: $myCommand
> because: $!";
Please correct me if I'm wrong, but I didn't think this syntax would provide
the correct results.
My understanding was that you would have to code the above as:
system("$myCommand") == 0 or die "Couldn't do the following command:
$myCommand because $!";
I'm not entirely sure why I have to do the above (it is listed in blue camel,
pg 230 like this), but am pretty sure that without the ==0, the above doesn't
behave like I would expect (an error on any system command that doesn't exit
with 0 status).
The more I analyze my line, the less I understand about it.... Including the
==0 seems redundant, doesn't it? Could someone clear this one up for me?
Thanks.
<snip>
> Martin Caslavsky wrote in message <34952053.F686236C@fi.muni.cz>...
> >In my script I am calling an external program and I need to give it
> ><ctrl+d> character, like exec "program parameters" where parameters are
> >parameters followed ctrl+d.
> >How could I do it?
> >
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------
------------------------------
Date: Mon, 15 Dec 1997 10:37:26 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Help with VERY simple problem
Message-Id: <mbudash-1512971037260001@d189.pm5.sonic.net>
>> Jason Thomas Hitesman wrote:
>> >
>> > while (<PFILE>) {
>> > $rows[$i] = <PFILE>;
>> > $i++;
>> > }
>> >
>> > However when I try to read in a three line text file I only get two lines
>> > read in.
use this instead - it's much more direct, and it does what you want (correctly):
open PFILE;
@rows = <PFILE>;
close PFILE;
Michael
--
_____________________________
Michael Budash, Owner
Michael Budash Consulting
707-255-5371
707-258-7800 x7736
http://www.sonic.net/~mbudash
mbudash@sonic.net
_____________________________
------------------------------
Date: Mon, 15 Dec 1997 14:39:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help with VERY simple problem
Message-Id: <comdog-ya02408000R1512971439580001@news.panix.com>
In article <mbudash-1512971037260001@d189.pm5.sonic.net>, mbudash@sonic.net (Michael Budash) wrote:
>use this instead - it's much more direct, and it does what you want (correctly):
>
> open PFILE;
remember to check the return values so you don't miss what went
wrong in that open (you gotta open() something...)
open FILE, $filename or die "couldn't open $filename: $!";
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 15 Dec 1997 19:02:43 GMT
From: hclin@PROBLEM_WITH_INEWS_GATEWAY_FILE.spdc.ti.com (Heng-Chih Lin)
Subject: Hex, Oct, and Bin convertor?
Message-Id: <673usj$5kf$1@ox.spdc.ti.com>
Hi,
I am wondering if there is any routine in perl which can convert number back
and forth among Dec, Hex, Oct, and Bin formats.
For example, if I have a number 3476 (in decimal) or 10100 (in binary), how can
I convert it to other formats?
Any suggestion is highly appreciated!
--
Heng-Chih
------------------------------
Date: Mon, 15 Dec 1997 14:42:13 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: HTTP/1.0 500 Server Error (/cgi-bin/multiple_forms.cgi is not a valid Windows NTapplication. )
Message-Id: <comdog-ya02408000R1512971442130001@news.panix.com>
In article <3495490e.25383727@news.dknet.dk>, pbk@sasintern.com (Poul Kornmod) wrote:
>I know that this has been posted before - but I didn't read the
>thread. Could somebody please forward me some of the reply's?
Dejanews and Altavista archive usenet. you can find old thread at
either service.
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 15 Dec 1997 18:20:17 GMT
From: Kent Scheidegger <cjlf@netcom.com>
Subject: Re: Learning Perl - How to start
Message-Id: <cjlfEL8tLt.7GD@netcom.com>
Allie <allie@icct.net> wrote:
: Okay, not that I am letting this negativity get under my skin or
: anything, BUT, if I did get discouraged about Perl, but still wanted
: to learn to program so that eventually I'd be competant to learn
: Perl, what would be a reccommended language to begin with?
I would recommend Pascal. It's a very structured language that almost
forces you into good programming habits. In other words, it's the opposite
of Perl. Each has its uses.
------------------------------
Date: 15 Dec 1997 14:39:42 -0500
From: Vivek Khera <khera@kciLink.com>
To: Miten S Mehta <mehta@mama.indstate.edu>
Subject: Re: Msql
Message-Id: <x7u3ca4cqp.fsf@kci.kciLink.com>
>>>>> "MSM" == Miten S Mehta <mehta@mama.indstate.edu> writes:
MSM> I am installing msql and the Msql-0.91.tar.gz for perl access to it. I am
You probably want something newer than the Msql module above. Check
the CPAN archives for the latest Msql modules.
Once you have that, then type the following sequence in the directory
in which you extracted the files, to build and install it:
perl Makefile.PL
make
make test
make install
MSM> Miten S Mehta |
MSM> 311 S Lasalle St, 39E, |
MSM> Durham, NC 27705 |
MSM> Tel: 919 416 3889 |
MSM> e-mail: mehta@mama.indstate.edu |
So how come you live across the street from Duke University, but
attend a school half way across the country? ;-)
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-301-258-8292
PGP/MIME spoken here http://www.kciLink.com/home/khera/
------------------------------
Date: Mon, 15 Dec 1997 11:41:04 -0600
From: Ken Holm <rets@meta3.com>
To: Kevin Hawley <cchkxh@ARCO.com>
Subject: Re: NEED: Fast, Fast string trim()
Message-Id: <34956BB0.2781@meta3.com>
Kevin Hawley wrote:
>
> Hi, I need a trim() function that will take a string and remove the
> white space from the front and the rear of the string, but preserve
> white space within the string. I will be processing lots of strings,
> so I need something efficient, anybody have a good suggestion?
> TIA
>
> Here is what I have so far: (I'm hoping for a one line solution)
>
> $string=" White Space ";
No need for trim().
$string =~ s/^\s+|\s+$//g;
perl5 -e '$A = " THIS is a test . "; $A =~ s/^\s+|\s+$//g;print
"[$A]\n\n"'
yields
[THIS is a test .]
-K
--
Kennneth A Holm | META 3 - Webmaster |webmaster@meta3.com
PO Box 1508 |----------------------------------|(601)948.3399 x 227
Jackson, MS 39215|PGP Key finger webmaster@meta3.com|(601)948.5999 (fax)
------------------------------
Date: Mon, 15 Dec 1997 10:39:14 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: NEED: Fast, Fast string trim()
Message-Id: <34956B42.E8B2DD13@mystech.com>
Mike Stok wrote:
> In article <34953A3A.AB94BA73@ARCO.com>, Kevin Hawley <cchkxh@ARCO.com> wrote:
> >Hi, I need a trim() function that will take a string and remove the
> > white space from the front and the rear of the string, but preserve
> > white space within the string. I will be processing lots of strings,
> > so I need something efficient, anybody have a good suggestion?
>
> If you're really interested in finding out where time's going then you can
> use the Benchmark module which comes with recent distributions to time
> various solutions. I usually consider
>
> $string =~ s/^\s+//;
> $string =~ s/\s+$//;
>
> to be short enough to use inline and avoid the overhead of subroutine
> calls, and clear enough to mean something to a maintainer in the future
> (assuming they know perl basics.)
I usually shorten this to
$string =~ s/^\s*(.*?)\s*$/$1/;
I don't know if this executes any faster than your option, which is admittedly more
easy to understand, but it offers an alternative for those of us who like nice
short cryptic one-liners!
Mark Reibert
-----------------------------
Mark S. Reibert, Ph.D.
Mystech Associates, Inc.
3233 East Brookwood Court
Phoenix, Arizona 85044
Tel: (602) 732-3752
Fax: (602) 706-5120
E-mail: reibert@mystech.com
-----------------------------
------------------------------
Date: 15 Dec 1997 10:20:52 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: NEED: Fast, Fast string trim()
Message-Id: <673se4$307$1@shell3.ba.best.com>
In article <34956B42.E8B2DD13@mystech.com>,
Mark S. Reibert <reibert@mystech.com> wrote:
>Mike Stok wrote:
>> $string =~ s/^\s+//;
>> $string =~ s/\s+$//;
>
>I usually shorten this to
>
>$string =~ s/^\s*(.*?)\s*$/$1/;
>
>I don't know if this executes any faster than your option,
Well, let's find out. :)
use Benchmark;
$stringone = "This is a test" x 100;
$stringtwo = "This is a test" x 100;
sub TwoExp {
$_[0] =~ s/^\s+//;
$_[0] =~ s/\s+$//;
$_[0];
}
sub OneExp {
$_[0] =~ s/^\s*(.*?)\s*$/$1/;
}
timethese(1000, {
'OneExp' => sub { &OneExp($stringone); },
'TwoExp' => sub { &TwoExp($stringtwo); },
});
produces the following results:
Benchmark: timing 1000 iterations of OneExp, TwoExp...
OneExp: 4 secs ( 3.76 usr 0.00 sys = 3.76 cpu)
TwoExp: 1 secs ( 0.99 usr 0.00 sys = 0.99 cpu)
So, your version executes almost 4 times slower than the other. I suspect
this is due to the backreference ($1), but I'm not sure. For what it's worth,
I've also tried optimizing the pair of s/// expressions to one like this:
$foo =~ s/(^\s+)|(\s+$)//;
and found that to also be slower than execting the two expressions one at a
time.
/MC
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: Mon, 15 Dec 1997 12:02:27 -0600
From: nathan_loyer@vapower.com
To: nathan_loyer@vapower.com
Subject: Perl 5.004_04 install error - can't find compiler?
Message-Id: <882204356.2090729484@dejanews.com>
While trying to make the Configure file (i.e. "sh Configure") for Perl
5.004_04, it cannot find my gcc compiler. When I type "gcc" on the
command line, it works fine. What gives? I am using pgcc, but it is
refered to as gcc when used. Is this a problem?
Any help would be appreciated. If responses can be CC'd to
nathan_loyer@vapower.com I would appreciate it. I can only view
newsgroups through DejaNews, and this issue is very time sensitive.
Thanks to all,
Nathan Loyer
nathan_loyer@vapower.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 15 Dec 1997 10:53:00 -0600
From: Shawn Tolivar <shawn@wwgv.com>
Subject: Perl url redirect
Message-Id: <3495606B.49AD60B5@wwgv.com>
This is a multi-part message in MIME format.
--------------253824B1DA16D988E9453CE1
Content-Type: multipart/alternative; boundary="------------BD03C9957DC322A0A257178B"
--------------BD03C9957DC322A0A257178B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have a script that redirects a url specified from a drop down menu to
the browser. This works great, but what I need it to do is just a
little more complicated. I have options such as this is the drop down
menu:
<OPTION
value="http://www.ldsinc.com/_scripts/foods/testarray.asp">Option
<OPTION
value="http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA&map=states">Option1
<OPTION
value="http://www.ldsinc.com/_scripts/foods/testarray.asp?selection1=FL&map1=states">Option2
I need to be able to select multiple options from this menu and have
them appended to the redirect according to what options were selected.
By default, the value http://www.ldsinc.com/_scripts/foods/testarray.asp
will be redirected no matter what is selected. If say Option1 is
selected but nothing else then the redirect would look like
http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA&map=states
,
but if both Option1 and Option2 where selected then the redirect would
look like this:
http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA&map=states&selection1=FL&map1=states
and so on for as many options are selected. I am not quite sure exactly
how to go about doing this. Attached is the source code that I have
tried to work with. Thank you.
Shawn Tolivar
--------------BD03C9957DC322A0A257178B
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
I have a script that redirects a url specified from a drop down menu to
the browser. This works great, but what I need it to do is just a
little more complicated. I have options such as this is the drop down menu:
<P><B><OPTION value="<A HREF="http://www.ldsinc.com/_scripts/foods/testarray.asp">http://www.ldsinc.com/_scripts/foods/testarray.asp</A>">Option</B>
<BR><B><OPTION value="<A HREF="http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA">http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA</A>&map=states">Option1</B>
<BR><B><OPTION value="<A HREF="http://www.ldsinc.com/_scripts/foods/testarray.asp?selection1=FL">http://www.ldsinc.com/_scripts/foods/testarray.asp?selection1=FL</A>&map1=states">Option2</B>
<P>I need to be able to select multiple options from this menu and have
them appended to the redirect according to what options were selected.
By default, the value <A HREF="http://www.ldsinc.com/_scripts/foods/testarray.asp">http://www.ldsinc.com/_scripts/foods/testarray.asp</A>
will be redirected no matter what is selected. If say Option1 is selected
but nothing else then the redirect would look like
<P><B><A HREF="http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA">http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA</A>&map=states
,</B><B></B>
<P>but if both Option1 and Option2 where selected then the redirect would
look like this:
<P><B><A HREF="http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA">http://www.ldsinc.com/_scripts/foods/testarray.asp?selection=CA</A>&map=states&selection1=FL&map1=states</B>
<P>and so on for as many options are selected. I am not quite sure exactly
how to go about doing this. Attached is the source code that I have tried
to work with. Thank you.
<BR>
Shawn Tolivar
<BR> </HTML>
--------------BD03C9957DC322A0A257178B--
--------------253824B1DA16D988E9453CE1
Content-Type: application/x-unknown-content-type-pll_auto_file; name="selection.pll"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="selection.pll"
IyEvdXNyL2xvY2FsL2Jpbi9wZXJsCiMKIyBzZWxlY3Rpb24ucGwgICAgLS0JQSBzaW1wbGUg
c2NyaXB0IHRvIGlzc3VlIGEgcmVkaXJlY3QgYmFzZWQgb24gCiMJCQlhIGZvcm0gc2VsZWN0
aW9uLgojCiMgV3JpdHRlbiBieSBDb2xsaW4gRm9yYmVzIGluIE1heSwgMTk5NgojIFJldmlz
ZWQgKDEuMDEpIGluIEF1Z3VzdCwgMTk5NgojCiMgVGhlIHNjcmlwdCB0YWtlcyB0aGUgdmFs
dWUgb2YgYSBmaWVsZCBjYWxsZWQgIlVSTCIgZnJvbSB0aGUgZm9ybSBhbmQgCiMgaXNzdWVz
IGEgcmVkaXJlY3Rpb24gcmVzcG9uc2UgdG8gdGhhdCB2YWx1ZS4gIEl0IGhhZCBiZXR0ZXIg
YmUgYSB2YWxpZAojIFVSTCBvciBlbHNlIHRoZSBicm93c2VyIHdpbGwgcmVwb3J0IGFuIGVy
cm9yLiAgCiMKIyBVbmZvcnR1bmF0ZWx5LCBicm93c2VycyBmcm9tIE5ldHNjYXBlIGFuZCBN
aWNyb3NvZnQgd2lsbCB3b3JrIHVzaW5nIAojIHJlbGF0aXZlIFVSTHMsIGJ1dCB0aGUgSFRU
UCBzcGVjaWZpY2F0aW9uIHNheXMgaXQgbmVlZHMgdG8gYmUgYW4gCiMgYWJzb2x1dGUgVVJM
LiAgSWYgeW91IHVzZSByZWxhdGl2ZSBVUkxzLCBhbmQgc29tZW9uZSBzYXlzIGl0IGRpZG4n
dAojIHdvcmssIGRvbid0IHNheSB5b3UgZGlkbid0IGtub3chCiMKIyBJZGVhbGx5IHlvdSB3
b3VsZCB1c2UgdGhpcyBzY3JpcHQgd2l0aCBhIGZvcm0gY29udGFpbmluZyBlaXRoZXIgdGhl
CiMgPHNlbGVjdD4gZWxlbWVudCBvciByYWRpbyBidXR0b25zLiAgVXNlIHRoZSBHRVQgbWV0
aG9kLgoKbWFpbjogewoKICAgIEBwYWlycyA9IHNwbGl0KC8mLywgJEVOVnsnUVVFUllfU1RS
SU5HJ30gKTsJIyBHRVQgTWV0aG9kCgogICAgZm9yZWFjaCAkcGFpciAoQHBhaXJzKSB7CiAg
ICAgICAgKCRuYW1lLCAkdmFsdWUpID0gc3BsaXQoLz0vLCAkcGFpcik7CgogICAgICAgICR2
YWx1ZSA9fiB0ci8rLyAvOwogICAgICAgICR2YWx1ZSA9fiBzLyUoW2EtZkEtRjAtOV1bYS1m
QS1GMC05XSkvcGFjaygiQyIsIGhleCgkMSkpL2VnOwogICAgICAgICRuYW1lID1+IHRyLysv
IC87CiAgICAgICAgJG5hbWUgPX4gcy8lKFthLWZBLUYwLTldW2EtZkEtRjAtOV0pL3BhY2so
IkMiLCBoZXgoJDEpKS9lZzsKCiAgICAgICAgJEZPUk17JG5hbWV9ID0gJHZhbHVlOwogICAg
fQoKCiAgICAkbG9jYXRpb24gPSAkRk9STXsnVVJMJ307CQkjIFVzZSB0aGUgZmllbGQgbmFt
ZWQgIlVSTCIuCiAgICBwcmludCAiTG9jYXRpb246ICRsb2NhdGlvblxuXG4iOwkjIFZvaWxh
IQoKfQoK
--------------253824B1DA16D988E9453CE1--
------------------------------
Date: Mon, 15 Dec 1997 17:18:42 GMT
From: Kevin Hawley <cchkxh@ARCO.com>
Subject: Re: PIng a Port
Message-Id: <34956672.9EFB82DF@ARCO.com>
You can't ping a port, ... But I'll bet you can port a ping ... or not.
Russ Verner wrote:
> Hello,
> does anyone know how to ping a specific port. If I wanted to ping port
> 80 I use the ping command with the host name . How do you ping a program
> you have running on like port 3335? I'm using a Linux machine version
> 2.0.32.
> Russ
> russ@eastland.net
------------------------------
Date: Mon, 15 Dec 1997 13:26:48 -0500
From: Kevin Graham <kgraham@alpha.furman.edu>
To: Ravi Kumar <ravi@centtech.com>
Subject: Re: Please advise. Fastest way to line-count files
Message-Id: <Pine.OSF.3.96.971215131716.11091A-100000@alpha.furman.edu>
> 2. In perl I can do it in two ways.
> A1:
> open FH, $file;
> while (<FH>){$linecount++}
> A2:
> open FH, $file;
> @jj = <FH>;
> $linecount = $#jj + 1;
> 3. The file sizes are significant (small files: 3M , large files: 60M
Real simple, if even a "small" file is 3M, I wouldn't be too fond of
having that squatting in memory for no reason. If the speed is of essence
here, I'd suggest Benchmarking it yourself, but would consider "A1" the
only lucid option.
The underlying process behind the two is practically identical, so always
go for the most efficient option (one could also argue that in some
instances VM paging might kick in with this, which would obviously eat up
disk bandwith and siphon more speed off).
> If I split this job on multiple machines, I create congestion and dont
> gain any time.
Looking at the process involved here answers that. Your bottleneck is
obviously the disk i/o. Processor time is at a bare minimum, so yeah,
spreading this out across multiple machines is never going to be
advantageous, given the circumstances.
> I have to run this on a single fast machine.
Refinement: run it on a single fast-disk i/o machine.
..kg..
kevin graham
------------------------------
Date: 15 Dec 1997 14:31:02 -0500
From: Vivek Khera <khera@kciLink.com>
Subject: Re: Problem with Sys::Syslog
Message-Id: <x7vhwq4d55.fsf@kci.kciLink.com>
>>>>> "GR" == Guy Rixon <gtr@ast.cam.ac.uk> writes:
GR> I have a problem getting SysSyslog to work in perl 5.003 on Solaris 2.5.
GR> I get this error message:
GR> Undefined subroutine &Sys::Syslog::hostname called at
GR> /usr/local/lib/perl5/Sys/Syslog.pm line 92 (#1)
GR> (F) The subroutine indicated hasn't been defined, or if it was, it
GR> has since been undefined.
This was a bug in the Sys::Syslog module in Perl 5.003. I forget the
patch that fixes it (it was trivial to find and fix myself), but
upgrading to Perl 5.004_04 will definitely fix that and many other
little bugs.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-301-258-8292
PGP/MIME spoken here http://www.kciLink.com/home/khera/
------------------------------
Date: 15 Dec 1997 16:38:16 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Teaching programing
Message-Id: <673mdo$3ja$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
will@Starbase.NeoSoft.COM (Will Morse) writes:
:I teach perl to 40-year-olds. They are supposed to have had some programming
:before they take the course, but none of them ever do. A lot depends on how
:much time you have to teach them (I have 24 contact hours). I wind up
:spending a lot of time just explaining what an if statement in English is
:let alone in perl and the same for loops.
Many of and many have the same lament. Perhaps we should try to
get a pre-qualification miniquiz?
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
sv_magic(sv, Nullsv, 'B', Nullch, 0); /* deep magic */
--Larry Wall, from util.c in the v5.0 perl distribution
------------------------------
Date: Mon, 15 Dec 1997 11:41:49 -0800
From: Vik Rubenfeld <VikR@aol.com>
Subject: Re: Workaround for FLOCK?/When is FLOCK not supported?
Message-Id: <349587FA.5A7E7CF3@aol.com>
> Vik Rubenfeld (VikR@aol.com) wrote:
> : I've got a machine that doesn't support FLOCK. (Error message "# The flock()
> : function is unimplemented.") I'd rather not tell my client to update his PERL
> : installation. Is there a workaround I can use instead of FLOCK?
>
> We really need more information to answer this question, as there are a
> number of different possible reasons. He could have an old Perl build, he
> could have a poorly-configured Perl, or he could be using an operating
> system that doesn't support flock().
>
> I suppose the first question is what operating system he's using.
My software, PowerTab, can generate PERL script. As a result, the PERl script
it generates is run on all kinds of different installations. And it's been
working pretty well. Until I added the call to FLOCK, we hadn't found an
installation that couldn't run our PERL code.
So I need to identify ways of dealing with all sorts of installations.
Preferably, finding a way to do something like FLOCK that will work on the
lowest-common-denominator system. And then, if the user's PERL installation
still can't run my PERL code, advising him to upgrade his installation.
I'm trying FLOCK because there are cases where multiple people on a web site
may be trying to run our PERL code simultaneously, and it uses FLOCK to make
sure that only one person accesses its data files at a time. Is FLOCK the
lowest-common-denominator way to do this?
Thanks very much in advance to all for any info.
- Vik
------------------------------
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 1477
**************************************