[9153] in Perl-Users-Digest
Perl-Users Digest, Issue: 2771 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 30 23:07:34 1998
Date: Sat, 30 May 98 20:00:27 -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 Sat, 30 May 1998 Volume: 8 Number: 2771
Today's topics:
[META] Re: X marks the spot, was Re: Best tool? (Greg Bacon)
Re: [META] Re: X marks the spot, was Re: Best tool? (Stuart McDow)
Re: [META] Re: X marks the spot, was Re: Best tool? <flavell@mail.cern.ch>
Re: A new comer to PERL <jcounts@voicenet.com>
Re: Advanced Perl Programming Book (Charles DeRykus)
Re: An unwelcome and undeserved slap (Thomas Bushnell, n/BSG)
Re: An unwelcome and undeserved slap <hp@pobox.com>
Re: Best tool? (Stuart McDow)
chmod in perl? <bradmcc@comcen.com.au>
Re: DBD:Oracle installation woes (Randy Kobes)
Re: dead URL ? <rootbeer@teleport.com>
Re: duping from a reference (Charles DeRykus)
Re: Help with a Socket Problem <rootbeer@teleport.com>
Re: How do I have perl script connect and open Sybase S <dorfmanr@netlabs.net>
How do I tell if Perl is in foreground or backgound? <dorfmanr@netlabs.net>
Re: i need help...much!!!...anyone, please... (Michael Dori)
Internet Relay Chat (Adam)
Re: perl & AOL AIM <rootbeer@teleport.com>
Perl application security <eric.tucker@semperex.com>
Re: Perl-Frage (Jonathan Stowe)
Re: PLEASE HELP ME ... I need input on this from as man (Stuart McDow)
Re: PLEASE HELP ME ... I need input on this from as man (Michael Dori)
Re: Reading whole file into a scalar (Jeremy D. Zawodny)
Re: Statistics for comp.lang.perl.misc (Greg Bacon)
Re: Statistics for comp.lang.perl.misc (Jonathan Stowe)
Re: Translating first letter of sentence into a capital <lr@hpl.hp.com>
Re: Translating first letter of sentence into a capital (Craig Berry)
Re: Translating first letter of sentence into a capital (malgosia askanas)
Re: Translating first letter of sentence into a capital <danboo@negia.net>
Re: Whois lookup (Jonathan Stowe)
Re: X marks the spot, was Re: Best tool? (Mark-Jason Dominus)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 31 May 1998 00:22:49 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: [META] Re: X marks the spot, was Re: Best tool?
Message-Id: <6kq7sp$o5b$3@info.uah.edu>
In article <Pine.A41.3.95a.980530214342.49056D-100000@rsplus08.cern.ch>,
"Alan J. Flavell" <flavell@mail.cern.ch> writes:
: On Sat, 30 May 1998, Randal Schwartz wrote:
: > I've heard of "X", "X11", and "the X Window System". But never "X
: > Windows".
:
: I hadn't expected this level of pedantry from you, of all people.
What's up with this Usenet trend?
Follower: What you posted is wrong for these reasons.
Original: Wow, you're anal.
This nonsense seems to have really pervaded throughout Usenet.
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 31 May 1998 00:56:05 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: [META] Re: X marks the spot, was Re: Best tool?
Message-Id: <6kq9r5$sup$1@ns1.arlut.utexas.edu>
gbacon@cs.uah.edu (Greg Bacon) writes:
>
> This nonsense seems to have really pervaded throughout Usenet.
I know what you mean. I've been seeing it for about twelve years now.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Sun, 31 May 1998 02:46:08 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: [META] Re: X marks the spot, was Re: Best tool?
Message-Id: <Pine.A41.3.95a.980531024217.49546B-100000@rsplus06.cern.ch>
On 31 May 1998, Greg Bacon wrote:
> In article <Pine.A41.3.95a.980530214342.49056D-100000@rsplus08.cern.ch>,
> "Alan J. Flavell" <flavell@mail.cern.ch> writes:
> : On Sat, 30 May 1998, Randal Schwartz wrote:
> : > I've heard of "X", "X11", and "the X Window System". But never "X
> : > Windows".
> :
> : I hadn't expected this level of pedantry from you, of all people.
>
> What's up with this Usenet trend?
>From an email exchange I think Randal understood perfectly well the
point that I was trying to make. Perhaps if you would review the
thread, so would you.
Maybe it would have been better emailed and not posted in the first
place. Please accept my apology for bothering the group with it.
------------------------------
Date: Sat, 30 May 1998 18:59:47 -0400
From: "John Counts" <jcounts@voicenet.com>
Subject: Re: A new comer to PERL
Message-Id: <6kq33c$pc9@world6.bellatlantic.net>
If you're working in a windows environment it's fairly trivial to use ADO:
use OLE;
$conn = CreateObject OLE "ADODB.Connection" || die "CreateObject: $!";
if ($conn->Open('driver={SQL Server};server=sv;uid=sa;pwd=;database=db)) {
do soemthing
}else {
do something else;
}
$sql = "SELECT lname FROM customer";
$rs = $conn->Execute($sql);
good luck
Ellen Cohn wrote in message <356EDAA0.F8F4B8D2@mitre.org>...
>I am working for the Mitre Corporation in Bedford, Ma. I was asked to
>setup a web-database application. I have been thinking SQL Server would
>be a good place to start but I cannot find any resources on connecting
>to a database from within a PERL script
------------------------------
Date: Sat, 30 May 1998 23:30:16 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Advanced Perl Programming Book
Message-Id: <EtsMMG.BF4@news.boeing.com>
In article <6knhk1$c1g$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc,
> Denis DORR <dorr@cetrel.lu> writes:
>:the cover and the contents of ORA books ? Why a Llama, a Camel, a
>:panther (& soon a "mouflon" -sorry, I don't know the English word) for
>:Perl ?
>
>The Perl Cookbook shall indeed un mouflon carry--to be more precise,
>a Rocky Moutain Bighorn Sheep (Gnat and I have these critters as
>neighbors.) In short, it's a Ram Book. Connections between Perl and
>camels, llamas, and bighorn sheep I leave to your imagination. I have
>certainly entertained many such notions on my own.
>
I just hope there's a sacred cow available for the next
book. Tom could lurk astride - foot on hoof :)
--
Charles DeRykus
------------------------------
Date: 30 May 1998 20:59:11 -0400
From: tb@mit.edu (Thomas Bushnell, n/BSG)
Subject: Re: An unwelcome and undeserved slap
Message-Id: <u1hhg27z25c.fsf@ten-thousand-dollar-bill.MIT.EDU>
robert havoc pennington <hp@pobox.com> writes:
> Do you really think all the people whining about "ruining a
> perfectly good word for 'happy'" a few decades ago were upset about
> semantics rather than sex?
The deliciousness here is in fact that the word "gay" had a sexual
connotation as far back as the teens of this century.
Thomas
------------------------------
Date: Sun, 31 May 1998 02:32:34 GMT
From: robert havoc pennington <hp@pobox.com>
Subject: Re: An unwelcome and undeserved slap
Message-Id: <wsnaf7zp3ul.fsf@harper.uchicago.edu>
tb@mit.edu (Thomas Bushnell, n/BSG) writes:
>
> robert havoc pennington <hp@pobox.com> writes:
> > Do you really think all the people whining about "ruining a
> > perfectly good word for 'happy'" a few decades ago were upset about
> > semantics rather than sex?
>
> The deliciousness here is in fact that the word "gay" had a sexual
> connotation as far back as the teens of this century.
>
Precisely! It's amazing how prejudices get buried in invented "facts"
about language. Linguists love to make fun of this stuff...
Havoc Pennington ==== http://pobox.com/~hp
------------------------------
Date: 31 May 1998 00:52:30 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Best tool?
Message-Id: <6kq9ke$sp7$1@ns1.arlut.utexas.edu>
stlam@yahoo.com writes:
>
> 1) What is the best tool for PERL programmer?
Why, ed(1), of course.
> Is Perl Builder from www.solutionsoft.com is the best IDE for PERL?
Dunno. Does it run under Solaris_x86 2.6?
> 2) What is the best tool for Web developer?
Probably a good web server and a good web browser. I'd use apache and
navagator.
> Is Cold fusion is the best?
Haven't heard that it works yet. Are those guys at Utah still working
on it?
> It seems that using cold fusion, I don't need to write code. but I
> know Perl.
How, exactly, is not writing code considered to be programming?
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: 31 May 98 02:39:13 GMT
From: "Brad McCready" <bradmcc@comcen.com.au>
Subject: chmod in perl?
Message-Id: <01bd8c3d$4d899d80$32f438cb@brad>
hi guys i'm a self taught perl newbie.
i have a script that creates a new file, the file defaults to chmod 644,
but i want to change it to 755, how do i do this in perl?
thanks for any assistance given.
-------------------------
brad mccready
------------------------------
Date: 31 May 1998 00:05:27 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: DBD:Oracle installation woes
Message-Id: <slrn6n183m.fnv.randy@theory.uwinnipeg.ca>
On Fri, 29 May 1998 21:58:07 GMT, todd_herr@sra.com <todd_herr@sra.com> wrote:
>I've got the following:
>Solaris 2.5.1
>Oracle 7.3.3 - NFS mounted directory
>perl 5.004_04
>DBI 0.90
>DBD::Oracle 0.47
>Building of all goes well, no problems with make test or make install of
>perl and DBI. However, with DBD, make test fails on
>
>t/plsql.............ld.so.1: oracle: fatal: libsunmath.so.1: can't open
> file: errno=2
--
Hi,
It might be that you have to set the LD_LIBRARY_PATH environment
variable to include the lib/ directory where libsunmath.so.1 is
before testing; eg, in bash,
export LD_LIBRARY_PATH=/path/to/oracle/lib:$LD_LIBRARY_PATH
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: Sun, 31 May 1998 02:33:44 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: dead URL ?
Message-Id: <Pine.GSO.3.96.980530193317.19134G-100000@user2.teleport.com>
On Sat, 30 May 1998 nathan_lee50@my-dejanews.com wrote:
> in the dos prompt type
> ping www.XXXXXXXX.com
> if it reply "bad ip address"
> then its dead URL.......
It's always good to know that http://www.microsoft.com is a dead URL. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 30 May 1998 23:08:25 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: duping from a reference
Message-Id: <EtsLM1.9yr@news.boeing.com>
In article <Pine.BSF.3.96.980529152034.11124R-100000@shell6.ba.best.com>,
matthew d. p. k. lanier <lanier@shell6.ba.best.com> wrote:
>hello all-
>
>i'm having a difficulty duping STDERR to a ref to another filehandle.
>
>according to my reading, this should work:
>
>open (STDERR, ">&{ $self->{'ehandle'} })
>
>it dies with "invalid argument. i know that $self->{'ehandle'} is a ref
>to a file and it is open previous to the open call.
>
>suggestions? where am i going wrong?
>
Maybe, I'm wrong but I believe your attempt will work
only with a bareword filehandle glob.
You could do something with the file descriptor format
like this though:
$fd = fileno $self->{'ehandle'};
open (STDERR, ">&=$fd) or die $!;
or, cramming:
open (STDERR, ">&=@{[fileno $self->{'ehandle'}]}}") or
die $!;
HTH,
--
Charles DeRykus
------------------------------
Date: Sun, 31 May 1998 02:32:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help with a Socket Problem
Message-Id: <Pine.GSO.3.96.980530193236.19134F-100000@user2.teleport.com>
On Sat, 30 May 1998 dwright@thuntek.net wrote:
> The script sends me an email indicating a bad response and lately I have
> been receiving the 403 forbidden response and further research seems to
> indicate that servers using the latest version of the Apache choke on
> this.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 30 May 1998 20:37:57 -0400
From: Robert Dorfman <dorfmanr@netlabs.net>
Subject: Re: How do I have perl script connect and open Sybase SQLanywhere DB?
Message-Id: <3570A665.5FF67514@netlabs.net>
This is a multi-part message in MIME format.
--------------85E839909D62D57846F51EC1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
You'll need to use either Sybperl or DBD::Sybase modules. You will also
have to learn about Sybase's CTLib programming interface. With these
tools you are able to log into the database and perform any database
minipulations you'd like. Both of these Perl modules are available from
CPAN and there is also a listserv, SYBPERL-L@listproc.net, you can read
for Q&A.
Robert Dorfman
Pheng Lay wrote:
>
> I have Sybase SQLanywhere 5.0 running on NT 4.0 with SP3 and IIS 3.0. I'm
> using the perl script as the CGI. Essentially, I call the perl script from
> my java applet browser to connect and open the SQL database so I can add,
> update, or delete data on the table. I'm able to call the perl script from
> the java script already, but I don't know how to have perl script connect
> to the Sybase SQL server database. How do I have perl connect to Sybase
> SQL database? What do I need to have running to accomplish this? Thank
> You for any help.
>
> phengl@ir-optima.com
--------------85E839909D62D57846F51EC1
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Robert Dorfman
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Robert Dorfman
n: Dorfman;Robert
org: Dorfman Consulting
email;internet: dorfmanr@netlabs.net
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------85E839909D62D57846F51EC1--
------------------------------
Date: Sat, 30 May 1998 22:12:56 -0400
From: Robert Dorfman <dorfmanr@netlabs.net>
Subject: How do I tell if Perl is in foreground or backgound?
Message-Id: <3570BCA8.82100FDA@netlabs.net>
This is a multi-part message in MIME format.
--------------A44C4B90A9E97C65F6E684B2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have a Perl/Sybperl script that logs into a Sybase Adaptive Server
and starts a database backup. This is run automatically by cron.
However, I'd like to use the same script and allow it to be called by a
user.If running in the foreground I'll display a list of databases that
may be selected for backup. Then I'll fork the process to do the actual
database dump. How can I tell if my script is running in foreground or
background? Also, would running in the background be different from
being started by cron?
Thanks.
Robert Dorfman
--------------A44C4B90A9E97C65F6E684B2
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Robert Dorfman
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Robert Dorfman
n: Dorfman;Robert
org: Dorfman Consulting
email;internet: dorfmanr@netlabs.net
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------A44C4B90A9E97C65F6E684B2--
------------------------------
Date: Sun, 31 May 1998 00:30:47 GMT
From: michaeldore@hotmail.com (Michael Dori)
Subject: Re: i need help...much!!!...anyone, please...
Message-Id: <3570a48d.80708855@news.nacs.net>
On Sat, 30 May 1998 07:33:29 -0400, "brent verner"
<REPLY_TO_damonbrent@earthlink.net> wrote:
>ok, so i got this perl win32 'app?' in hopes of speeding up the dev time on
>cgi-scripts (yes, this is the only way i've ever used perl). anyway, i
>can't get the perl.exe to do anything, aside from creating a dos box. i
>don't do hardcore system proggies like some people in this newsgroup do in
>perl, c++ is a much nicer lang for win apps, but back to the issue...i am
>trying to call scripts locally through the perl win32 interpreter with no
>luck. could anyone please reply to this and tell me how to, or point me to
>a place that can, simply get my perl win32 to act like a remote interpreter.
>if this won't work, could someone please explain to me the utility of this
>'app'. i know i sound down on perl, that is far from the truth, i'm just
>disappointed that this perl win32 thingy is not acting like i'd expected it
>to.
>
>thanks in advance,
>
>brent verner
>
Try doing it from the prompt ...
Mike Dori
------------------------------
Date: Sun, 31 May 1998 01:50:31 GMT
From: trickett@pacbell.net.revome_this_for_valid_email (Adam)
Subject: Internet Relay Chat
Message-Id: <6kqcus$ndt$1@nnrp4.snfc21.pbi.net>
Keywords: Internet Relay Chat IRC
Hi,
A colleague is looking to provide IRC for a client. The client does not like
the periodic update, nor manual refresh style chat. My colleague wishes to
provide this kind of "live" IRC on his virtual Linux/Apache system.
What kind of modules/scripts have people used that can provice this kind of
functionality?
TIA,
(PS Sorry about the anti-spam measures)
---
Adam <adam_trickett at bigfoot dot com>
ANTI-SPAM | UNsolicited e-mail will be charged a $10 proof-reading
| fee - by replying to this posting you are agreeing to
STATEMENT | these terms and conditions.
------------------------------
Date: Sun, 31 May 1998 02:30:29 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: perl & AOL AIM
Message-Id: <Pine.GSO.3.96.980530192814.19134E-100000@user2.teleport.com>
On Sat, 30 May 1998, Jean-Yves Sireau wrote:
> I am looking to send a message to an AOL Instant Messager user from a
> perl script. ie., the perl script initiates the message to the AOL
> Instant Messanger user. I already know what IP address the AIM user is
> at - I just need help in finding out how AIM communicates over the
> socket connection.
I recommend you contact America Online and ask for their Instant Message
protocol specification. Once you have that, you can see about implementing
that protocol with Perl or any other language. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 30 May 1998 22:46:30 -0500
From: "Eric Tucker" <eric.tucker@semperex.com>
Subject: Perl application security
Message-Id: <6kqg6q$fch$1@excalibur.flash.net>
I would like to run an untrusted Perl script in a trusted environment
without allowing the script to access various portions of the local machine
such as the file system and TCP/UDP sockets. In other words:
I download script X that contains instructions to delete my root or some
other malicious instruction and execute it on my machine without causing
damage.
I'm running Perl 5 (ActiveState I386 build) on an NT4 box. I can use
another build if I need to, but I'm tied to NT4. Any ideas?
- Eric Tucker
http://www.semperex.com/
eric.tucker@semperex.com
------------------------------
Date: Sun, 31 May 1998 02:09:48 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl-Frage
Message-Id: <3570b51f.53672600@news.btinternet.com>
On 30 May 1998 13:47:38 GMT, wolfram.oehms wrote :
>Hallo Newsleser
>
>Vielleicht kann mir jemand von Euch weiterhelfen:
>
<snip>
That will be ( courtesy of: http://babelfish.altavista.digital.com ):
Hello new reader
Perhaps can help me someone from you:
I intend to grant the use of a certain program in the Perl format in
connection with the agreement of the user with a slight payment. The
user must die however no obligation, i.e. if he " does not forget "
the amount to transfer, this any consequences will have. I trust thus
in honesty. The payment moral to improve over nevertheless I would
send gladly automatically sent email to the user of this Scriptes as
friendly memory, which contains also the specification
concerning my bank account. I already tried some Scripten like "
SendMail.pl", but the point, where I do not get ahead am fast
achieved.
Question: Do you know someone, which can insert this function for me?
Which request of the Umgebung/Webhost/Provider exist?
Does determined software have to be installed on the host?
And above all: which costs would be with the integration this.
?
I didnt like the bit where it says " the user must die" - but hey this
guy probably works for Microsoft (or IG Farben)..
"That fucking Hypocrite they all cry in unison" ;-{
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 31 May 1998 00:44:02 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: PLEASE HELP ME ... I need input on this from as many people as possible.
Message-Id: <6kq94i$s67$1@ns1.arlut.utexas.edu>
michaeldore@hotmail.com (Michael Dori) writes:
>
> And yes i know there are free search engines available for free
> ... my ISP will not allow it
Sounds like a broken ISP. It should be replaced.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Sun, 31 May 1998 01:20:35 GMT
From: michaeldore@hotmail.com (Michael Dori)
Subject: Re: PLEASE HELP ME ... I need input on this from as many people as possible.
Message-Id: <3571b049.83712581@news.nacs.net>
On 31 May 1998 00:44:02 GMT, smcdow@arlut.utexas.edu (Stuart McDow)
wrote:
>michaeldore@hotmail.com (Michael Dori) writes:
>>
>> And yes i know there are free search engines available for free
>> ... my ISP will not allow it
>
>Sounds like a broken ISP. It should be replaced.
gee, really ... thanks for the help ... HA HA HA ...
Mike Dori
------------------------------
Date: 30 May 1998 21:13:39 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Reading whole file into a scalar
Message-Id: <m3hg27nsxo.fsf@peach.z.org>
arch@abts.net (Shaun Sides) writes:
> I don't think you can read a file into a scalar. There's a variable $\
> which contains the record separator. The default value for this is \n,
> and changing that value isn't recommended. But you can do something
> like:
Huh? You *can't* do it? Sure you can...
#!/usr/local/bin/perl -w
while(<>) {
$my_scalar .= $_;
}
Granted, it may not be the most efficient way, but does that not read
a whole file into a scalar?
Jeremy
--
LOAD "LINUX",8,1
------------------------------
Date: 31 May 1998 00:13:23 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <6kq7b3$o5b$2@info.uah.edu>
In article <pudge-2905981419240001@dynamic265.ply.adelphia.net>,
pudge@pobox.com (Chris Nandor) writes:
: In article <6kmpi7$l28$1@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
: # How is that different from what I said?
:
: I guess it is not too different. You seemed to imply discussion would be
: on topic, and I am not so sure any significant discussion (flamefest or
: not) would be appropriate.
Right. That's why I said the flames would be easier to control were the
group moderated.
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Sun, 31 May 1998 01:25:55 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <3570a4ba.49476934@news.btinternet.com>
On Sat, 30 May 1998 19:53:06 GMT, Michael D. Schleif wrote :
>Am I missing something?
>
>With hundreds of posts to this newsgroup per week, how can it be so
>difficult to follow ONLY those threads that interest you?
>
>Diatribe is diatribe. Period.
>
>I prowl through dozens of newsgroups and thousands of articles every
>week, week in and week out, year after year -- I have been doing this
>longer than most. Of those thousands and thousands of articles per
>week, only a few dozen really interest me, at the time. I read those.
>I mark the others "read" and move on. Is this rocket science? Do I
>need an advanced degree to do this? NOT.
>
<snip>
I didnt read this with a view to grok the meaning but I find the prose
most compelling - infact not prosaic but poetic. Nonetheless this
thread and those that spawned it are so much "pin head fairy counting"
debating the insubstantial whilst the peasants eat their cake.
Some people might live their lives here, although I doubt this for the
majority of the "main players" who are actually rather a well rounded
bunch, but nonetheless we are all belittling ourselves by taking up
these arguments with such vigour when we all know of *real shit* that
is happening to our certain knowledge. The energy,intellect,
knowledge and probably money that has been wasted on what is basically
an EgoFest on *everyones* part could have been been used to do some
good, real good even if it is only for a neighbour.
Lets talk about Perl and all its wonders here - but if we want to
right the wrongs of the world lets go and fix it then come back and
tell tales of how it was that Perl saved the world.
Back to the bottom of the swimming pool.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 30 May 1998 15:52:16 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Translating first letter of sentence into a capital
Message-Id: <6kq37u$ic@hplntx.hpl.hp.com>
malgosia askanas wrote in message <6kpuqc$112@panix2.panix.com>...
>I have this abysmally stupid question. I want to write a script that
takes
>as input a text file that's all in lower case, and produces as output
the same
>text but with the first character of each new sentence capitalized.
What's the
>magic statement inside the loop???
>
>
>Thanks in advance, and yes, I am thoroughly embarrassed.
>
>
>-m
This is a fun question. Why be embarrassed?
The mechanics are fairly simple: Read the entire file into a scalar (to
eliminate issues raised by line breaks) and then capitalize the first
letter (not "character") of each sentence.
The problem lies in defining a sentence. Do you have a good, clear,
definition? I don't. Try the code below, which does well, was quick to
write, but is by no means perfect, as you will see.
#!/usr/local/bin/perl -w
use strict 'vars';
{
local $/;
$_ = <DATA>;
s/(^\s*|[.?!]["']?\s+["']?)([a-z])/$1\u$2/gs;
print;
}
__END__
this is a sentence. so is this! and
is this? "yes, it is!"
'a yardstick is 36 ins. long, i think.'
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: 30 May 1998 23:17:15 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Translating first letter of sentence into a capital
Message-Id: <6kq41r$qrb$1@marina.cinenet.net>
malgosia askanas (ma@panix.com) wrote:
: I have this abysmally stupid question. I want to write a script that takes
: as input a text file that's all in lower case, and produces as output the same
: text but with the first character of each new sentence capitalized. What's the
: magic statement inside the loop???
:
: Thanks in advance, and yes, I am thoroughly embarrassed.
No need to be, it's harder than you might think. First, let's assume that
the entire file is in one scalar (using $/ = undef to read it in). Second,
assume that the beginning of a sentence needing capitalization is reliably
detectable using /((?:^|[.?!]\s+)[a-z])/ ("Either the start of the string
or a period, question mark, or exclamation point followed by one or more
spaces, followed by a lower-case character").
Then, assuming your file text is in $text, you can just do
$text =~ s/((?:^|[.?!]\s+)[a-z])/\U$1/g;
Since there's guaranteed to be only that one first-in-sentence letter in
the substituted region, uc-ing the whole thing is safe.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 30 May 1998 20:11:04 -0400
From: ma@panix.com (malgosia askanas)
Subject: Re: Translating first letter of sentence into a capital
Message-Id: <6kq76o$6od@panix2.panix.com>
Ah, thanks a million. It was the \u construct that I was missing.
And the trick of reading the whole file into a scalar is very nice.
In answer to Larry's question, my definition of a sentence is no better.
But fortunately this program doesn't have to be perfect about it, just mostly
right.
-malgosia
------------------------------
Date: Sat, 30 May 1998 19:04:58 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Translating first letter of sentence into a capital
Message-Id: <3570909A.494408F4@negia.net>
malgosia askanas wrote:
>
> I have this abysmally stupid question. I want to write a script that takes
> as input a text file that's all in lower case, and produces as output the same
> text but with the first character of each new sentence capitalized. What's the
> magic statement inside the loop???
$/ = '. ';
while (<DATA>) {
s/(^\s*|[.?]\s{2,})(\w)/$1\U$2/sg;
print;
}
__END__
well, making the first character of a *string* uppercase (if possible)
is no problem. the trouble with what you want to do is in defining a
sentence. at best it's a guessing game, with inevitable pitfalls. do
all your sentences have two whitespace characters before them? are
there any stray punctuation marks which are usually used for marking
the end of a sentence?
the above script is by no means intended to be a full blown solution.
in fact, this sentence won't be capitalized. that's on purpose so the
expansion of what is above can be a useful learning exercise.
hope. this. helps,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: Sun, 31 May 1998 01:25:51 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Whois lookup
Message-Id: <3570a201.48780155@news.btinternet.com>
On Sun, 31 May 1998 00:18:39 +0200, Rainer Quasten wrote :
>hi guys !
>I'am searching the script "whois lookup" from "cafe society".
>Can someone send me this script or something like that?
>Because the site from "cafe society" is not avaible at the moment.
>
Hey whaddya mean. *This* is cafe society buddy. Me and Mrs
Gellyfish. We got the budvars we got the B&H we got the Hole records
we got evreything . You'd better be going out and seeing more life.
Who the hell the hell stays in on a saturday night worrying about that
stuff ?
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 30 May 1998 22:46:31 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: X marks the spot, was Re: Best tool?
Message-Id: <6kqga7$2p7$1@monet.op.net>
Keywords: Athena Fayette Kochab project
In article <8c90nj2ze1.fsf@gadget.cscaper.com>,
Randal Schwartz <merlyn@stonehenge.com> wrote:
>And "X Windows" is wrong enough that it grinds every
>time I hear it. :-)
Someone, I can't remember who, but it was probably Zawinski, says
that he calls it that on purpose even though he knows better,
just to piss them off.
------------------------------
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 2771
**************************************