[10596] in Perl-Users-Digest
Perl-Users Digest, Issue: 4188 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 10 11:08:03 1998
Date: Tue, 10 Nov 98 08: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 Tue, 10 Nov 1998 Volume: 8 Number: 4188
Today's topics:
...no need to post this message 5 times. (GTE problem.. (Christian M. Aranda)
Re: Array Ref Question (Kevin Reid)
Re: Array-Hash-Problem (Kevin Reid)
Re: Array-Hash-Problem <jdf@pobox.com>
Re: CGI/popup menus and anonymous hashes (Patrick Timmins)
Re: Command Line Parameters? (Koos Pol)
concurrently writing to a file without doing flock ronald_f@my-dejanews.com
deleting spaces between fields <marx@idiom.com>
Re: deleting spaces between fields (Matthew Bafford)
Re: Emulate dirname and basename in perl?? jkane@my-dejanews.com
Re: Hard coding a variable into a perl script - help gachious@my-dejanews.com
Re: Help, I'm stuck again (this one may push the envelo (Clay Irving)
How can I find out... (Orlando Frooninckx)
Re: How can I find out... <ludlow@us.ibm.com>
Re: How can I find out... <jdf@pobox.com>
Re: How can I find out... <ours@casema.net>
Re: Learning Perl by video <ckc@dmi.dk>
Re: Looking for a web site with good script examples dave@mag-sol.com
Re: Looking for a web site with good script examples dave@mag-sol.com
Re: Looking for a web site with good script examples dave@mag-sol.com
Re: mv -f in Perl pcbel@my-dejanews.com
Net::TCP <tobias@spurv.td.org.uit.no>
Re: Not to start a language war but.. <Klaus.Schilling@home.ivm.de>
Re: Not to start a language war but.. <tchrist@mox.perl.com>
Re: PERL is TOO flexible (Anita M Wilcox)
perl5 and oracle <arm@home.net>
Re: select case? <tchrist@mox.perl.com>
Re: Sending SOLICITED bulk mail. (Clay Irving)
Re: seriel or ttyS0 (Bbirthisel)
UDP sockets <austinp@headland.co.uk>
Re: UDP sockets (M.J.T. Guy)
unable to write to MS access database...HELP <ours@casema.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 10 Nov 1998 09:41:13 -0500
From: christian.aranda@iiginc.com (Christian M. Aranda)
Subject: ...no need to post this message 5 times. (GTE problem.. sorry)
Message-Id: <729jab$hao$1@news-2.news.gte.net>
In article <Q8N12.128$ay.210944@nsw.nnrp.telstra.net>, mgjv@comdyn.com.au
says...
> In article <727s6n$pqi$1@news-1.news.gte.net>,
> "Christian M. Aranda" <christian.aranda@iiginc.com> writes:
>
> There really was no need to post this message 5 times.
>
> > Scripts 0, 3, and 4 must be run first, but can be run at the same time.
> > Script 1 must be run before script 2. Script 5 must be run last. Each of
> > these scripts takes a command line argument of a file name.
> >
> > What I was thinking of doing was using system(filename0 &bg),
> > system(filename3 &bg), system(filename4 &bg) to run them in the background
> > and then run scripts 1,2, and 5. This doesn't seem like the optimal way of
> > doing things and because the dataload will take at least 15 hours as it is,
> > I'd like to save as many cycles as possible.
>
> I think you should probably look into fork and do. The perlipc
> documentation has some examples on how to fork a bunch of children,
> and how to communicate with them.
>
> # perldoc perlipc
> # perldoc -f fork
> # perldoc -f do
>
> Martien
>
sorry.. it was a GTE error.
------------------------------
Date: Tue, 10 Nov 1998 10:06:47 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Array Ref Question
Message-Id: <1di76g3.w6rw0cb8t05cN@slip166-72-108-36.ny.us.ibm.net>
Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:
> Kevin Reid <kpreid@ibm.net> wrote:
>
> > Where is {} ambiguous?
>
> In general, whereever there could be either a term or a block.
> Sometimes, the ambiguity will cause a syntax error, because Perl 'knows'
> the {} are a block, when the programmer meant them to be an anonymous
> hash reference.
<snip example>
Another case I thought of is:
sub just_an_example {
my (@ar) = @_;
my @op = reverse @ar;
{
@op
}
}
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Tue, 10 Nov 1998 10:06:43 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Array-Hash-Problem
Message-Id: <1di8siu.11twgxp10ru7gbN@slip166-72-108-36.ny.us.ibm.net>
<nomam@my-dejanews.com> wrote:
> print "Name: $item->{'name'}: Size $item->{'size'}";
-> is an operator; operators are not parsed inside strings.
Two solutions:
(1)
print "Name: ", $item->{'name'}, ": Size ", $item->{'size'};
(2)
print "Name: $$item{'name'}: Size $$item{'size'}";
This is parsed as:
print "Name: ${$item}{'name'}: Size ${$item}{'size'}";
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 10 Nov 1998 16:23:10 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Array-Hash-Problem
Message-Id: <m3lnljpo69.fsf@joshua.panix.com>
kpreid@ibm.net (Kevin Reid) writes:
> <nomam@my-dejanews.com> wrote:
>
> > print "Name: $item->{'name'}: Size $item->{'size'}";
>
> -> is an operator; operators are not parsed inside strings.
[jdf@joshua jdf]$ perl -de 1
Loading DB routines from perl5db.pl version 1.0401
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 1
DB<1> $foo->{a} = 'You were saying?';
DB<2> print "$foo->{a}\n";
You were saying?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 10 Nov 1998 15:34:45 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: CGI/popup menus and anonymous hashes
Message-Id: <729mem$imh$1@nnrp1.dejanews.com>
In article <727v6e$de7$1@news1.rmi.net>,
wdieteri@shell.rmi.net (Will Dieterich) wrote:
> I have been messing around with this problem, and finally don't have any
> ideas of what to do.
>
> I am tring to get a popup menu to work with CGI.pm where I specify
> a value and label, and place that in an anonymous hash so that the
> CGI.pm popup menu would use my keys and values from the hash
> to build the values and labels in the menu.
Buy Lincoln Stein's "Official Guide to Programming with CGI.pm
(Wiley Computer Publishing, 1998):
eg:
#!/perl/bin/perl
use CGI qw(:all);
# create a reference to an anonymous array for the values of the popup
$ref_values = ['eenie', 'meenie', 'minie'];
# create a reference to an anonymous hash for linking a label to
# each of the values shown above
$ref_labels = {'eenie','one','meenie','two','minie','three'};
# now output your form ... it doesn't do anything ... just demonstrates
# using references in CGI.pm form building :)
print header,
start_html('Here is a Pop Up Hash'),
start_form,
popup_menu(-name=>'menu_name',
-values=>$ref_values,
-labels=>$ref_labels,
-default=>'meenie'),
end_form,
end_html;
__END__
Hope that helps
Patrick Timmins
$monger{Omaha}[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 10 Nov 1998 14:49:25 GMT
From: koos_pol@nl.compuware.com.NO_JUNK_MAIL (Koos Pol)
Subject: Re: Command Line Parameters?
Message-Id: <729jpl$c3k@news.nl.compuware.com>
On Sun, 08 Nov 1998 12:04:38 -0500, Ken Timlin <ktimlin@erols.com> wrote:
| do I pass parameters from the command line to my Perl
| script? I want to pass it two strings in the following
| manner:
|
| /usr/bin/myprogram string1 string2
|
man perlrun
--
Koos Pol
----------------------------------------------------------------------
S.C. Pol - Systems Administrator - Compuware Europe B.V. - Amsterdam
T:+31 20 3116122 F:+31 20 3116200 E:koos_pol@nl.compuware.com
Check my email address when you hit "Reply".
------------------------------
Date: Tue, 10 Nov 1998 13:15:27 GMT
From: ronald_f@my-dejanews.com
Subject: concurrently writing to a file without doing flock
Message-Id: <729e9f$bej$1@nnrp1.dejanews.com>
What is the worst thing that can happen when several processes print to the
same file, without using flock, every print writes exactly one line, and the
file handles are set to unbuffered? In particular: Could it be that some lines
arrive split into pieces or get lost?
>From the FAQ I conclude that, using autoflush, the buffer is flushed at the
end of each print statement, so I think that no lines should be lost, and
every line is written to the file in one piece. Can someone confirm this?
Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 09 Nov 1998 11:20:49 -0600
From: "Marcus J. Foody" <marx@idiom.com>
Subject: deleting spaces between fields
Message-Id: <36472471.26B4@idiom.com>
I have a text file that has leading and trailing spaces. The whitespaces
are between fields. The fields are tilde delimited
for example:
REC ITEMS~0001~EA ~00000000200.00~TEST DESCRIPTION1
XXXXXXXXXXXXXXXYZ DESCRIPTION2 XXXXXXXXXXXXXXXYZ
~
I need to get rid of leading and trailing spaces between fields. What I
would like the text file to look liks is.
REC ITEMS|0001|EA|00000000200.00|TEST DESCRIPTION1 XXXXXXXXXXXXXXXYZ
DESCRIPTION2 XXXXXXXXXXXXXXXYZ|
------------------------------
Date: Tue, 10 Nov 1998 10:29:18 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: deleting spaces between fields
Message-Id: <MPG.10b225dc749a897c989709@news.scescape.net>
In article <36472471.26B4@idiom.com>, Marcus J. Foody <marx@idiom.com>
pounded in the following:
=> I have a text file that has leading and trailing spaces. The whitespaces
=> are between fields. The fields are tilde delimited
=> for example:
=>
=> REC ITEMS~0001~EA ~00000000200.00~TEST DESCRIPTION1
=> XXXXXXXXXXXXXXXYZ DESCRIPTION2 XXXXXXXXXXXXXXXYZ
=> ~
=> I need to get rid of leading and trailing spaces between fields. What I
=> would like the text file to look liks is.
=> REC ITEMS|0001|EA|00000000200.00|TEST DESCRIPTION1 XXXXXXXXXXXXXXXYZ
=> DESCRIPTION2 XXXXXXXXXXXXXXXYZ|
=>
Hmm, amazing lack of code. And woah, your output doesn't match your
description. Oh well.
#!/usr/bin/perl -w
use strict;
while ( <> ) {
s/\s*~\s*/|/g;
s/\s+/ /g;
print;
}
__END__
Is a start, but it assumes the following things:
Each record is on it's own line.
~ can only appear as a field separator.
And some other stuff.
HTH,
--Matthew
------------------------------
Date: Tue, 10 Nov 1998 15:08:46 GMT
From: jkane@my-dejanews.com
Subject: Re: Emulate dirname and basename in perl??
Message-Id: <729ktu$h77$1@nnrp1.dejanews.com>
In article <727v5a$1o8$1@news-2.news.gte.net>,
Dennis Moreno <dennis.moreno@safetran.com> wrote:
> Hi-
>
> I'm lookin for an example of emulating the unix "basename" and "dirname"
> commands
> using perl. Anyone have an example they'd like to share?
I use this for basename ...
$0 =~ s#.*/##;
Not sure if it works in ALL instances yet, but it seems to work so far. :{ )
-Jeff Kane
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 10 Nov 1998 13:44:58 GMT
From: gachious@my-dejanews.com
Subject: Re: Hard coding a variable into a perl script - help
Message-Id: <729g0q$cqj$1@nnrp1.dejanews.com>
In article <3646ea24.420093322@news.online.no>,
tore@forumnett.no wrote:
> On Mon, 09 Nov 1998 09:39:58 GMT, gachious@my-dejanews.com wrote:
> > I am using a "Form to Email" script (FormMail.pl from Matt's Script Archive)
> > and am wanting to know if it is possible to "hard code" the recipient e-mail
> > address (my address) into the script.
>
> Try changing line #104 from...
>
> %Config = ('recipient','', 'subject','',
>
> ...to:
>
> %Config = ('recipient','your@email.com', 'subject','',
>
> Maybe? :-)
>
> --
> Tore Aursand
> ForumNett Online AS
> http://www.forumnett.no/
>
Tore,
Thanks for the response. I got it to work by putting the following line just
under the part where the %Config array was declared:
$Config{'recipient'} = ('putmyaddress@right.here');
Zee
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 10 Nov 1998 09:12:45 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Help, I'm stuck again (this one may push the envelope)
Message-Id: <729hkt$ll1@panix.com>
In <RqQ12.186$DA6.31938@news.connectnet.com> "Rusty Williamson" <rwilliamson@uno.gers.com> writes:
>I myself feel I deserve that. I don't have the Llama book and I will get
>it. However, I've read two other Perl books and have just started a
>third -- so much stuff and I've learned how to do a lot. But this is only
>my 3rd script and somehow, when faced with this simple problem my brain
>turns to clay.
Is this a bad thing? :)
>I've been flipping through all my books -- I guess I open
>the file, read all the records into an array, close the file and then loop
>through it searching each array element for the pattern and once I find it,
>extract the portions I need. Is that it? Somehow it seems simpler to use
>back quotes and use the one line grep/awk statement, but then I'm back were
>I started and that's not the reason I'm trying to learn Perl. But thanks
>anyway.
Or you could read one line at a time.
open F, "file.txt" or die "Can't open file.txt: $!\n";
while ($record = <F>) {
chomp $record;
if ($record =~ /foo/) { # match your pattern
print "$record\n";
}
}
close F;
--
Clay Irving
clay@panix.com
------------------------------
Date: Tue, 10 Nov 1998 14:24:57 GMT
From: Frook@mail.dma.be (Orlando Frooninckx)
Subject: How can I find out...
Message-Id: <364849cd.6031833@193.74.210.130>
Hi,
does anyone know how I can find out which PERL modules my ISP has
installed? I asked him a week ago, but still no reply, that is why I
wanna try to find out myself...
thanks in advance,
Orlando
========================================================
Orlando Frooninckx
- - - - - - - - - - - - - - - - -
E:mail: of@lms.be - of@ping.be - Frook@mail.dma.be
URL: www.ping.be/crossbreed - bewoner.dma.be/Frook
---------------------------------------------------------------------------------------------------------
------------------------------
Date: Tue, 10 Nov 1998 08:43:24 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: How can I find out...
Message-Id: <3648510C.6847B570@us.ibm.com>
Orlando Frooninckx wrote:
> does anyone know how I can find out which PERL modules my ISP has
> installed? I asked him a week ago, but still no reply, that is why I
> wanna try to find out myself...
So go for it. Just go look (if you have a shell account that is). You
can print the contents of @INC to get an idea of where the modules are
located.
$ perl -e 'print "@INC"'
- or -
$ perl -de 1
DB<1> x @INC
Or use the find command to find all the .pm files. You'll have to check
the man pages on your particular system. On Linux it would be:
$ find / -regex ".*\.pm$"
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: 10 Nov 1998 16:20:34 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Frook@mail.dma.be (Orlando Frooninckx)
Subject: Re: How can I find out...
Message-Id: <m3ogqfpoal.fsf@joshua.panix.com>
Frook@mail.dma.be (Orlando Frooninckx) writes:
> does anyone know how I can find out which PERL modules my ISP has
> installed?
$ perldoc perllocal
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 10 Nov 1998 16:34:34 +0100
From: "Casema" <ours@casema.net>
Subject: Re: How can I find out...
Message-Id: <729mgi$9lc$1@sun4000.casema.net>
make a script with a lot of require's
then pipe the output to your browser....
All it can't locate are not installed.
Orlando Frooninckx wrote in message <364849cd.6031833@193.74.210.130>...
>Hi,
>
>does anyone know how I can find out which PERL modules my ISP has
>installed? I asked him a week ago, but still no reply, that is why I
>wanna try to find out myself...
>
>thanks in advance,
>Orlando
> ========================================================
> Orlando Frooninckx
> - - - - - - - - - - - - - - - - -
> E:mail: of@lms.be - of@ping.be - Frook@mail.dma.be
> URL: www.ping.be/crossbreed - bewoner.dma.be/Frook
>---------------------------------------------------------------------------
------------------------------
------------------------------
Date: Tue, 10 Nov 1998 15:31:24 +0100
From: Casper Kvan Clausen <ckc@dmi.dk>
Subject: Re: Learning Perl by video
Message-Id: <Pine.GSO.3.92.981110152817.17940K-100000@edb>
On Tue, 10 Nov 1998, Brent Michalski wrote:
> Honestly, if you go through the books and DO the example programs, that
> is probably the __best__ training you can get. Pick a small project and
> then do it, learning along the way. Once you have that done, find a
> more difficult project.
I agree with this, but in addition I am unable to see what good a Perl
video would do. How could seeing someone type in a program and run it be
better than either typing it in yourself or downloading it, and then
running it?
I mean, I can see *some* point in videos about using browsers or other
GUI'ly complex programs, but a Perl one would only have a bunch of text.
How would that be helpful?
Kvan, trying hard to understand, but failing.
-------Casper Kvan Clausen------ | 'A *person* is smart. People are
----------<ckc@dmi.dk>---------- | dumb, panicky, dangerous animals
Lokal 544 | and you know it.'
I do not speak for DMI, just me. | - "K" in Men in Black.
------------------------------
Date: Tue, 10 Nov 1998 13:11:52 GMT
From: dave@mag-sol.com
Subject: Re: Looking for a web site with good script examples
Message-Id: <729e2o$bb3$1@nnrp1.dejanews.com>
In article <sHJ12.1431$Sn6.5341@news.cwix.com>,
"Jim Mosier" <jim.mosier@mci.com> wrote:
> NE1?
Why are you talking in London postcodes?
Ignoring the body of your post and replying to the subject. You can get a
small number of IMHO good Perl scripts from my site at
<http://www.mag-sol.com/Download.html>.
hth,
Dave...
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://london.pm.org/>
[Note Changed URL]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 10 Nov 1998 13:11:35 GMT
From: dave@mag-sol.com
Subject: Re: Looking for a web site with good script examples
Message-Id: <729e27$bav$1@nnrp1.dejanews.com>
In article <sHJ12.1431$Sn6.5341@news.cwix.com>,
"Jim Mosier" <jim.mosier@mci.com> wrote:
> NE1?
Why are you talking in London postcodes?
Ignoring the body of your post and replying to the subject. You can get a
small number of IMHO good Perl scripts from my site at
<http://www.mag-sol.com/Downlosad.html>.
hth,
Dave...
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://london.pm.org/>
[Note Changed URL]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 10 Nov 1998 15:41:59 GMT
From: dave@mag-sol.com
Subject: Re: Looking for a web site with good script examples
Message-Id: <729ms7$j62$1@nnrp1.dejanews.com>
In article <729e2o$bb3$1@nnrp1.dejanews.com>,
dave@mag-sol.com wrote:
> In article <sHJ12.1431$Sn6.5341@news.cwix.com>,
> "Jim Mosier" <jim.mosier@mci.com> wrote:
> > NE1?
>
> Why are you talking in London postcodes?
>
> Ignoring the body of your post and replying to the subject. You can get a
> small number of IMHO good Perl scripts from my site at
> <http://www.mag-sol.com/Download.html>.
...and I forgot to mention that CPAN has recently reopened its scripts area.
Try <http://www.cpan.org>.
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://london.pm.org/>
[Note Changed URL]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 10 Nov 1998 14:58:18 GMT
From: pcbel@my-dejanews.com
Subject: Re: mv -f in Perl
Message-Id: <729kab$gm9$1@nnrp1.dejanews.com>
> Would the function rename do the trick for ya?
Hmm, I feel stupid. It *does* work, even if the destination file exists and is
owned by another user...
Thanks. ;-)
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 10 Nov 1998 13:56:23 +0100
From: Tobias Brox <tobias@spurv.td.org.uit.no>
Subject: Net::TCP
Message-Id: <xn667cnu2o8.fsf@spurv.td.org.uit.no>
I can't find Net::TCP at CPAN?
Not that it's a great effort to use sockets - but I'd really love to
write 1 line of code rather than 5 line of code for simply connecting
to a host/port.
And not that it's a great effort to write those few lines into an .pl
or .pm myself, but shouldn't the possibility to connect to a remote
host be open also for those that aren't familiar with socket
programming?
--
TobiX In a world without fences, who needs gates?
http://www.td.org.uit.no/~tobias/
------------------------------
Date: 10 Nov 1998 12:41:48 +0100
From: Klaus Schilling <Klaus.Schilling@home.ivm.de>
Subject: Re: Not to start a language war but..
Message-Id: <87yapjkc5f.fsf@ivm.de>
wtanksle@cx930311-b.ocnsd1.sdca.home.com (William Tanksley) writes:
>
> So now that that's out of the way... What else prevents Perl from being
> ideal? Educate a newbie. Feel free to reply to the Perl NG at this
> point; I think my reply here contains the last reference to Python for this
> thread.
Perl lacks an equivalent to Scheme's call-with-current-continuation .
(and so do python and tcl)
In addition, perl's semantics and syntacs are too clumsy to hold a candle
to scheme.
Klaus Schilling
------------------------------
Date: 10 Nov 1998 15:18:31 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Not to start a language war but..
Message-Id: <729lg7$76$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Klaus Schilling <Klaus.Schilling@home.ivm.de> writes:
:Perl lacks an equivalent to Scheme's call-with-current-continuation .
:(and so do python and tcl)
What's your point? Scheme also lacks Perl's elegant approach to:
bash$ perl -i.orig -pe 's/\bfoo\b/bar/g' *.[Cchy]
But I don't think this particularly matters, either. I only once
wanted callcc in Perl, and it was because I was thinking wrongly.
It is not helpful to expect all tools to do all things in all ways,
or for there to be just one tool that does everything. I don't want
my directory listing program to automatically notify me of new mail
and then read it for me, nor for my assembler to handle HTTP redirects.
Prolog and Icon and ML also have interesting properties, but these are
not critical to getting the job done -- demonstrably enough.
On the other hand, I frequently find myself wanting python to support
scheme's or perl's closures so that callbacks can be properly scoped.
Programmers fluent in python are used to this oversight, but to those of
us for which closures are an assimilated programming pattern, it grates
upon us, perhaps needlessly.
:In addition, perl's semantics and syntacs are too clumsy to hold a candle
:to scheme.
And Perl's wide-spread penetration and paramount popularity are too
crushing in comparison for Scheme to be even a mumblesqueak. Now,
tell me again, Herr Troll, why it is that we should care about this,
and why you are posting this crap to either of these newsgroups?
--tom
--
There is always a better way.
-- Thomas Edison
------------------------------
Date: Tue, 10 Nov 1998 13:25:17 GMT
From: amw@world.std.com (Anita M Wilcox)
Subject: Re: PERL is TOO flexible
Message-Id: <F27Jy5.I8n@world.std.com>
In article <82k91b1dlp.fsf@shell2.shore.net>, Jay Rogers <jay@rgrs.com> wrote:
>Brent Michalski <perlguy@technologist.com> writes:
>
>> In article <3638676E.F980FC4A@harris.com>,
>> PERL ROCKS! <emills@harris.com> wrote:
>> > "Although the Perl Slogan is There's More Than One Way to Do It, I
>> > hesitate to make 10 ways to do something. :-) "
>> > --Larry Wall in <9695@jpl-devvax.JPL.NASA.GOV>
>> >
>> >is along these lines- why make more than ONE? What did it add, Larry?
>>
>> Wow, I *HAD* to comment on this "ONE" (pun intended)
>>
>> Why on earth would you want only ONE way to do something in a
>> language?!??!
>
>Maintainability.
>
>Unfortunately, because of Perl's expressive power, code that may seem
>elegant to an implementor, can look like serial line noise to you the
>maintainer. This is why one Unix luminary has called Perl a
>write-only language.
>
This isn't a language problem, it is a programmer problem. You can
write ugly, unmaintainable code in *any* language. Sure regular
expressions are hard to follow sometimes, but the same functionality
in other languages would take more code and wouldn't be much easier to
read.
>We as programmers don't tend to think about maintainability, perhaps
>because it's boring and we'd prefer someone else did it. But it's not
>unusual for a project to require more effort for maintenance than was
>necessary for implementation.
>
Exactly! Too many programmers don't think about maintainability
when they write their code. Lack of comments, too, is a problem.
>In what ways can we as Perl programmers make our code more
>maintainable? Always 'use strict' and follow 'man perlstyle'.
>
Basic things from Programming 101: use meaningful variable names,
don't cram everything onto one line, indent properly, use whitespace,
give your functions/modules meaningful comment headers.
I have found that if I don't follow these guidelines that I even
have trouble figuring out my own code if I haven't looked at it
for several months. :-)
Anita
------------------------------
Date: Tue, 10 Nov 1998 14:39:34 GMT
From: Alan Melton <arm@home.net>
Subject: perl5 and oracle
Message-Id: <36484E59.B849F87C@home.net>
Is there any program update to oraperl
or other upgrade to perl to have access
to an oracle database, either WinNT or Unix.
Alan Melton
------------------------------
Date: 10 Nov 1998 13:22:53 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: select case?
Message-Id: <729end$deh$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Hendrik Woerdehoff <hendrik.woerdehoff@sdm.de> writes:
:You mustn't use "must" in your statement. The blue camel shows seven (7)
:different ways to solve this problem. You _can_ use "if ()", but then
:there is always more than one way to do it...
Here are twenty-two or so:
http://language.perl.com/misc/fmswitch
--tom
--
If I don't document something, it's usually either for a good reason,
or a bad reason. In this case it's a good reason. :-)
--Larry Wall in <1992Jan17.005405.16806@netlabs.com>
------------------------------
Date: 10 Nov 1998 08:51:57 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Sending SOLICITED bulk mail.
Message-Id: <729gdt$jpo@panix.com>
In <726n30$1ge$1@nnrp1.dejanews.com> angus@od-site.com writes:
>I have a client who wants to send a weekly report to between
>100 and 1500 clients who _pay_ for the service [ie. its not spam ]
>The report is a binary file of about 600-1000K in size.
>Short of a foreach ($recp){ open(MAIL | sendmail $recp) etc}
>has anyone got a program which does this a little more efficiently without
>killing my server ! I can hack perl, but my sendmail knowledge is limited.
>Any suggestion appreciated,
Majordomo
http://www.greatcircle.com/majordomo/
Majordomo is a program which automates the management of Internet
mailing lists. Commands are sent to Majordomo via electronic mail to
handle all aspects of list maintainance. Once a list is set up,
virtually all operations can be performed remotely, requiring no
intervention upon the postmaster of the list site. Majordomo
controls a list of addresses for some mail transport system (like
sendmail or smail) to handle. Majordomo itself performs no mail
delivery (though it has scripts to format and archive messages).
You may also want yo check some of the other tools and modules in the
mail and USENET news section of Perl Reference:
http://reference.perl.com/query.cgi?mail
--
Clay Irving
clay@panix.com
------------------------------
Date: 10 Nov 1998 15:46:20 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: seriel or ttyS0
Message-Id: <19981110104620.15013.00001718@ng-fd2.aol.com>
Hi Drobick:
>i search demo-program for programming com1: or ttyS0
>cant help?
Can't help much without knowing which Operating System you
are using. Com1: implies $MS; ttyS0, linux or U*nx.
What are you trying to do with the serial port?
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Tue, 10 Nov 1998 13:33:01 +0000
From: Austin Plunkett <austinp@headland.co.uk>
Subject: UDP sockets
Message-Id: <3648408D.46EE9D4B@headland.co.uk>
Hi. First timer, so go easy :)
I'm wondering how to go about coding a client/server style thing in Perl
using UDP connections. **All** the documentation I can find anywhere
goes into TCP in depth, but tells me very little about UDP. I'm new to
this sort of thing, so I'm also curious about all the PF_INET, PF_UNIX,
AF_INET etc variables.. is there a comprehensive list of all of these
and what they do? I know they equate to numbers, and I gather they
relate to the platform, but which is for what purpose?
What I'm trying to create is a packet-parser/-forwarder, so anything
anyone can tell me about this sort of thing would be useful. I'm
assuming I'm going to have to fork the process to get the client and
server talking? Can anyone give me a brief introduction to forking?
Perl5 on Slackware Linux.. can't check precise versions at the moment.
Any help gratefully received.
Thanks. Austin.
------------------------------
Date: 10 Nov 1998 13:58:53 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: UDP sockets
Message-Id: <729gqt$t8s$1@pegasus.csx.cam.ac.uk>
Austin Plunkett <austinp@headland.co.uk> wrote:
>
>I'm wondering how to go about coding a client/server style thing in Perl
>using UDP connections.
Warning: round here you're liable to get flamed if you refer to
"UDP connections" (as happened to me last week). But I know what you
mean.
And you can find some UDP examples in "perldoc perlipc".
What protocol do you want to run over UDP? It may well be that there's
a Net::Whatever module on CPAN which does what you want.
(And even if not, they provide yet more examples of UDP programming.)
Mike Guy
------------------------------
Date: Tue, 10 Nov 1998 16:08:13 +0100
From: "Casema" <ours@casema.net>
Subject: unable to write to MS access database...HELP
Message-Id: <729kv4$i8e$1@sun4000.casema.net>
Hi newsgroup.
All is set-up fine, I can read from the database, just writing will not
work.
My DSN is NETS (system DSN) and the base's name is: base.mdb and have four
tables there. One's called: form
I am trying to add a record and am using the following code:
use WIN32::ODBC;
$sql = "INSERT INTO form ('lastname') VALUES ('Smith');";
$dsn = "NETS";
$db = new Win32::ODBC($dsn);
$db->Sql($sql);
$db->Close();
What's wrong here?????
Thanks,
Michel
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4188
**************************************