[12408] in Perl-Users-Digest
Perl-Users Digest, Issue: 6008 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 15 19:07:20 1999
Date: Tue, 15 Jun 99 16:01:28 -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 Tue, 15 Jun 1999 Volume: 8 Number: 6008
Today's topics:
Re: Perl "constructors" zenin@bawdycaste.org
Perl and CGI <linchen88@prodigy.net>
Re: perl compilation problems on linux <rpo@templar.demon.co.uk>
return value of warn (Andrew Allen)
Setting TCP_NODELAY (Chris Selwyn)
Re: Setting TCP_NODELAY <tchrist@mox.perl.com>
Re: sprintf padding with zeroes <uri@sysarch.com>
Re: sprintf padding with zeroes <tchrist@mox.perl.com>
Re: sprintf padding with zeroes <john.wood@diamond.co.uk>
Re: sprintf padding with zeroes <tchrist@mox.perl.com>
Re: What is functional difference between .pm and .pl? <tchrist@mox.perl.com>
Re: What is functional difference between .pm and .pl? <upsetter@ziplink.net>
Win32 select() donath@my-deja.com
Re: Win32 select() <aperrin@mcmahon.qal.berkeley.edu>
Re: WIN32 USERADMIN DOESN'T WORK <jgnzalez@swbell.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Jun 1999 22:16:47 GMT
From: zenin@bawdycaste.org
Subject: Re: Perl "constructors"
Message-Id: <929485198.150138@thrush.omix.com>
armchair@my-deja.com wrote:
: In article <7k3d72$u1n$1@nnrp1.deja.com>,
: John Porter <jdporter@min.net> wrote:
>snip<
:> Hmm, maybe Foo needs to modify its inheritance tree at runtime:
:>
:> unshift @Foo::ISA, 'Quux';
:
: I'll bet that practice has a lot of proponents in Object Oriented
: Symposiums.
If you want SmallTalk, you know where to find it.
: It certainly does show how much more complex the Perl class implementation
: is.
Or more astutely, how much more flexible the Perl object model is.
:> Make undefined method calls do something useful:
:>
:> sub Foo::AUTOLOAD {
:> my $self = shift;
:> my $name = $Foo::AUTOLOAD;
:> $name =~ s/.*:://; # strip the qualification
:> $self->{'contained_object'}->$name( @_ );
:> }
:
: Don't know what this is doing, but it again appears that Perl objects have
: a lot of complexity to them versus the much simpler C++.
s/have/can have/;
Perl is flexible.
If you want to code in an Ivory Tower, you can.
If you want/need to dive into the moat, you can.
It's up to you. Perl is not about saying one way is better then the
other. If you need/want bondage, Perl can't help you (much*).
*Perl's flexibility and power allows one to quickly and easily
create there own chains of which to tie themselfs down with,
although the proven uselessness of most chains keeps most of such
implementations out of the core release or at the very least,
optional.
>snip<
:> Not unable, just unwilling.
:> Stories, like newsgroup threads, don't end just because someone
:> declares them ended.
:
: Didn't say the story ended, just that you were unable to write assembler
: code that was anywhere equivalent to:
: int i = 0,j =0;
: for ( ; i < 10; i++)
: for ( ; j < 10; j++)
: print ("i/j %d/%d\n",i,j);
Of course the equivalent asm can be written for the above, but what
would the exercise prove? Even if the asm was 100k LOC, it would
still not prove that C is "higher level" then asm. -It is, but your
exercise would not prove it.
The definition of a "high(er) level" language is one that more
closely resembles human thought, logic, and process then a machine's
logic and process. Total LOC are irrelevant to that end.
--
-Zenin (zenin@archive.rhps.org) "Hey, are you one of those Linux coders?"
"Nyet. Linux coder in next office."
"Good man. Ignore the screams."
--www.userfriendly.org
------------------------------
Date: Sun, 13 Jun 1999 18:30:07 -0400
From: Chen & Jinlin <linchen88@prodigy.net>
Subject: Perl and CGI
Message-Id: <376430EF.A13CA803@prodigy.net>
I have a web server that doesn't support CGI! Is there a work around
this? (Such as an executable file...)
------------------------------
Date: 15 Jun 1999 23:12:43 +0100
From: Richard Owens <rpo@templar.demon.co.uk>
Subject: Re: perl compilation problems on linux
Message-Id: <m3iu8pm7tw.fsf@chimay.templar.demon.co.uk>
Jonathan Stowe <gellyfish@gellyfish.com> writes:
> On Fri, 04 Jun 1999 03:15:36 -0400 Lev Iserovich wrote:
> > Hey all.
> >
> > I'm trying to compile a perl 5.005 [...] it fails on many
> > tests like goto_xs, lib/anydmb, and whole bunch more.
> > I'm running a glibc2 system (which was upgraded all the way from
> > Slackware with 1.2.x kernels way back when), so its not exactly your
> > stock Redhat distro.. My kernel is 2.0.36, my gcc is 2.7.2.3, ld 2.8.1,
> > any other info I can provide if interested. :)
>
> I'd say that it is a problem with Configure - what does it give as the
> default when it asks about building a dynamically linked perl :
>
> The following dynamic loading files are available:
>
> If it says dl_none then it has failed to discover the correct one for your
> system - on my system (similar to yours) I have a line in config.sh like:
>
> dlsrc='dl_dlopen.xs'
>
> So I assume that you will to select the dl_dlopen choice at that point if
> you are given it.
>
> You should also have some lines in your Makefile that are similar to this:
>
> # The following are used to build and install shared libraries for
> # dynamic loading.
> LDDLFLAGS = -shared -L/usr/local/lib
> SHRPLDFLAGS = $(LDDLFLAGS)
> CCDLFLAGS = -rdynamic
> DLSUFFIX = .so
> PLDLFLAGS =
> LIBPERL = libperl.a
> LLIBPERL= $(LIBPERL)
> SHRPENV =
>
It was nice to see that someone else was having a similar problem to
me, but in my case I *am* running a stock Red Hat 5.2 distribution. I
pounced on Jonathan's advice, but my config.sh and Makefile match his
in the lines quoted. Yes, I have read the FAQ. Several times.
Could some kind soul email me a working config.sh for 5.005 on
(preferably Red Hat 5.2) Linux, or explain to me what stupid mistake I
am making?
Thanks,
--
==========================================================================
Richard Owens owensr@acm.org
Blue Crane Computing Services Ltd rpo@templar.demon.co.uk
------------------------------
Date: 15 Jun 1999 21:52:30 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: return value of warn
Message-Id: <7k6huu$j5m$1@fcnews.fc.hp.com>
Is the return value of "warn" documented anywhere? It certainly isn't
in any place I can find it. It appears to always return 1. Is this
correct? The reason I'm asking is for constructs like:
warn 'hi' and next;
Should I file a perlbug to have the perlfunc entry updated?
Andrew
------------------------------
Date: Tue, 15 Jun 1999 22:47:47 GMT
From: chris@matson.demon.co.uk (Chris Selwyn)
Subject: Setting TCP_NODELAY
Message-Id: <3767d7c4.516976@news.demon.co.uk>
Dear All,
Is there a Perl way to set TCP_NODELAY on a TCP socket without
resorting to hardcoded number?
------------------------------
Date: 15 Jun 1999 16:53:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Setting TCP_NODELAY
Message-Id: <3766d975@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
chris@matson.demon.co.uk (Chris Selwyn) writes:
:Dear All,
:
:Is there a Perl way to set TCP_NODELAY on a TCP socket without
:resorting to hardcoded number?
>From Ram:17, we have:
use Socket;
require "sys/socket.ph"; # for &TCP_NODELAY
setsockopt(SOCKET, SOL_SOCKET, &TCP_NODELAY, 1)
or die "Couldn't disable Nagle's algorithm: $!\n";
And re-enable it with:
setsockopt(SOCKET, SOL_SOCKET, &TCP_NODELAY, 0)
or die "Couldn't enable Nagle's algorithm: $!\n";
--tom
--
"It is easier to port a shell than a shell script."
--Larry Wall
------------------------------
Date: 15 Jun 1999 17:11:06 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: sprintf padding with zeroes
Message-Id: <x7909lf9ud.fsf@home.sysarch.com>
you could of quoted the faq entry on padding instead.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 15 Jun 1999 15:16:14 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: sprintf padding with zeroes
Message-Id: <3766c29e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, Uri Guttman <uri@sysarch.com> writes:
:you could of quoted the faq entry on padding instead.
^^ EINVAL
I thought I'd send them right at the source this time.
--tom
--
"Nothing is faster than the speed of light... To prove this to yourself, try
opening the refrigerator door before the light comes on." - Tim Dunn
------------------------------
Date: Tue, 15 Jun 1999 23:18:25 +0100
From: "Paul Wood" <john.wood@diamond.co.uk>
Subject: Re: sprintf padding with zeroes
Message-Id: <7k6jfd$a1g$1@nclient3-gui.server.ntli.net>
Ah, thanks for that. I work in Windows (I know, I know), so I don't have
access to the man pages. Is there anywhere online that I can look up man
pages?
Thanks,
-Paul.
Tom Christiansen <tchrist@mox.perl.com> wrote in message
news:3766c29e@cs.colorado.edu...
> [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc, Uri Guttman <uri@sysarch.com> writes:
> :you could of quoted the faq entry on padding instead.
> ^^ EINVAL
>
> I thought I'd send them right at the source this time.
>
> --tom
> --
> "Nothing is faster than the speed of light... To prove this to yourself,
try
> opening the refrigerator door before the light comes on." - Tim Dunn
------------------------------
Date: 15 Jun 1999 16:38:31 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: sprintf padding with zeroes
Message-Id: <3766d5e7@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"Paul Wood" <john.wood@diamond.co.uk> writes:
:Ah, thanks for that. I work in Windows (I know, I know), so I don't have
:access to the man pages. Is there anywhere online that I can look up man
:pages?
You have them -- they're just not called that. Try to find
where the HTML versions are installed (use web browser) locally,
or the pods (use pod2text).
They're also at language.perl.com, of course.
:Tom Christiansen <tchrist@mox.perl.com> wrote in message
:news:3766c29e@cs.colorado.edu...
[17 lines on un-interleaved superfluous quoted material deleted]
Please don't do that. When you followup, interleave and trim.
--tom
--
Heavy, adj.:
Seduced by the chocolate side of the force.
------------------------------
Date: 15 Jun 1999 15:19:18 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: What is functional difference between .pm and .pl?
Message-Id: <3766c356@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, Scratchie <upsetter@ziplink.net> writes:
:Some people use .pl to represent a perl script. It makes it very easy to
:do things like
:
: grep <some pattern> *.cgi *.pl
For various reasons, that really doesn't make much sense. Sorry.
I cannot think of any time I've ever wanted to do that, and
I've been hacking at this quite a long time, you know.
That being said, I used to use these a lot:
alias 'grall' 'egrep "\!:1" *.[^oa]'
alias 'lall' 'egrep -l "\!:1" *.[^oa]'
alias 'vall' 'vi +/\!:1 `grep -l \!:1 *.[^oa]`'
Or back before [^oa], I'd use *.[Cchyl] instead.
These days, I just use tcgrep, which skips the dreck.
Don't confuse the results of the `file` command with silly
lame-o fake-o filename extensions.
--tom
--
I have a different view of the world. --Andrew Hume. Show&Tell '87
------------------------------
Date: Tue, 15 Jun 1999 21:54:28 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: What is functional difference between .pm and .pl?
Message-Id: <oYz93.5838$nn.1063383@news.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: [courtesy cc of this posting mailed to cited author]
Why do you send email to an address that you won't accept email from?
That's not very courteous.
: :Some people use .pl to represent a perl script. It makes it very easy to
: :do things like
: :
: : grep <some pattern> *.cgi *.pl
: For various reasons, that really doesn't make much sense.
Convenience? Speed? Ease of use?
: Sorry.
: I cannot think of any time I've ever wanted to do that, and
: I've been hacking at this quite a long time, you know.
To each his own, I suppose. There's more than one way to do it.
: That being said, I used to use these a lot:
: alias 'grall' 'egrep "\!:1" *.[^oa]'
: alias 'lall' 'egrep -l "\!:1" *.[^oa]'
: alias 'vall' 'vi +/\!:1 `grep -l \!:1 *.[^oa]`'
If I were more of a Unix jokey, I might use syntaxen like those, too, but
my method works pretty well for me, with the added bonus that it works on
PC and Mac platforms as well. It also allows me to open my perl scripts
with a double-click on Windows and allows my Mac FTP client to assign the
proper creator and file type codes based on the file name. I realize that
you would never conceive of working on either the Mac or Windows platform,
but a lot of us do (even by choice!).
: Don't confuse the results of the `file` command with silly
: lame-o fake-o filename extensions.
I wouldn't dream of it.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 15 Jun 1999 20:09:47 GMT
From: donath@my-deja.com
Subject: Win32 select()
Message-Id: <7k6bu0$cg$1@nnrp1.deja.com>
Hello,
select() doesn't work with ActiveState Perl. That seems to be the
case. However, I would really like to know if there is any way to
determine if there is any data waiting to be read on a handle.
Specifically, STDIN. I'm writing a script that takes STDIN input, but I
would also like the same script to be able to handle the case when there
is no data waiting on STDIN. Right now, if I do a getline() on STDIN,
it hangs until there is something on STDIN, which is not desireable.
This brings up another question. Is there a way to send eof (like ^D in
Unix) when you want to close input to a Perl script from an NT command
box? ^C does not work well because it terminates the script too.
If anyone has any suggestions for determining waiting data on a handle,
I would very much appreciate your help.
Regards,
Clarence Donath
mrdo@mrdo.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 15 Jun 1999 15:02:13 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
To: donath@my-deja.com
Subject: Re: Win32 select()
Message-Id: <3766CD65.2EED2847@mcmahon.qal.berkeley.edu>
[posted & sent via e-mail]
donath@my-deja.com wrote:
> Hello,
>
> select() doesn't work with ActiveState Perl.
don't know about this one...
>
>
> This brings up another question. Is there a way to send eof (like ^D in
> Unix) when you want to close input to a Perl script from an NT command
> box? ^C does not work well because it terminates the script too.
As for this one, the DOS/Win equivalent is ^Z , also (often) sendable as F6.
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting - (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------
------------------------------
Date: Tue, 15 Jun 1999 17:02:42 -0500
From: "Juan Manuel Gonzalez" <jgnzalez@swbell.net>
Subject: Re: WIN32 USERADMIN DOESN'T WORK
Message-Id: <T2A93.695$7G6.238213@typhoon01.swbell.net>
Did you tell your script to :
Use Win32::UserAdmin; ?
Next, verify that you are passing the right parameters to the function.
--------------------
sam@cheapnet.co.uk wrote in message
<3766a309.21904279@news.cheapnet.co.uk>...
>I just bought the OReilly octopus book "NT USER ADMIN" and downloaded
>the accompanying scrpits.
>however i cannot get any of the modules to work.
>i am trying to us the UserAdmin module to create NT accounts.
>anyone have any joy with this ?
>i am using the latest port from active state v517
>
>i get the error message "cant locate loadable object for module
>win32::useradmin in @INC (where @INC contains d:/perl/lib
>d:/perl/site/lib"
>
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 6008
**************************************