[25488] in Perl-Users-Digest
Perl-Users Digest, Issue: 7732 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 3 21:05:46 2005
Date: Thu, 3 Feb 2005 18:05:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 3 Feb 2005 Volume: 10 Number: 7732
Today's topics:
Re: ...How to parse search engine results fast? <nospam@bigpond.com>
Re: a very bad question (and getting OT) <Allen.Windhorn@LSUSA.com>
Re: a very bad question (and getting OT) <jurgenex@hotmail.com>
Re: a very bad question (and getting OT) <matternc@comcast.net>
Re: a very bad question (and getting OT) <emschwar@fc.hp.com>
Re: a very bad question <dha@panix.com>
Re: a very bad question <news@chaos-net.de>
Re: a very bad question <news@chaos-net.de>
Re: a very bad question <abigail@abigail.nl>
Re: a very bad question <abigail@abigail.nl>
Re: compacting '..' path segments using File::Spec <ddunham@redwood.taos.com>
Re: compacting '..' path segments using File::Spec <someone@example.com>
Re: FAQ 6.18 Why does using $&, $`, or $' slow my progr (Anno Siegel)
Re: Finding disk space used by Windows or Unix director <someone@example.com>
Re: Free perl obfuscation service <notvalid@email.com>
Re: Hash value not being interpolated <tadmc@augustmail.com>
Re: Hashtable of arrays (Anno Siegel)
Re: in line editing <emschwar@fc.hp.com>
Re: in line editing <emschwar@fc.hp.com>
Re: Invisible variables in Perl debugger <nospam-abuse@ilyaz.org>
Newbie asking, interesting question <dbent@comcast.net>
Re: Newbie asking, interesting question <jgibson@mail.arc.nasa.gov>
Re: Newbie asking, interesting question <dbent@comcast.net>
Re: Newbie Hash question. <news@chaos-net.de>
one-liner to make all programs one-liners <larry_wallet@yahoo.com>
Re: one-liner to make all programs one-liners <mgjv@tradingpost.com.au>
Re: OT [Fwd: Fwd: symptoms of a stroke] Randal_Schwartzcopf@yahoo.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 04 Feb 2005 09:05:28 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: ...How to parse search engine results fast?
Message-Id: <36fp1qF53pi8aU1@individual.net>
VB wrote:
> Hi,
>
> I'm building a metaseach engine based on data mining techniques....but
> this is not important...
>
> My question is about performances of the activity of scraping search
> engine results from an HTML response page.
Use C or possibly Perl, but that's not your problem.
The problem is the copyright lawsuit thats heading your way.
gtoomey
------------------------------
Date: 03 Feb 2005 17:06:16 -0600
From: Allen Windhorn <Allen.Windhorn@LSUSA.com>
Subject: Re: a very bad question (and getting OT)
Message-Id: <uwttp8crb.fsf_-_@LSUSA.com>
chris-usenet@roaima.co.uk writes:
> The noun "pound" is never used for "#" as this word is used[*] for our
> currency symbol and an (obsolete) imperial weight measurement.
> ...
> [*] Actually there are other uses of the noun "pound" but none is for
> describing the symbol "#".
In American English (an oxymoron, probably) the symbol "#" is actually
used as an abbreviation for "pound" as in the (not quite obsolete
here) unit of measurement of mass. It is also used as an abbreviation
for "number" as in "Bus #21" -- is this also true in England? (I've
been there, but I don't remember seeing this.)
Regards,
Allen
--
Allen Windhorn (507) 345-2782 FAX (507) 345-2805
Kato Engineering (Though I do not speak for Kato)
P.O. Box 8447, N. Mankato, MN 56002
Allen.Windhorn@LSUSA.com
------------------------------
Date: Thu, 03 Feb 2005 23:34:39 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: a very bad question (and getting OT)
Message-Id: <jyyMd.1746$wc.1090@trnddc07>
Allen Windhorn wrote:
> In American English (an oxymoron, probably)
Rather a contradiction
jue
------------------------------
Date: Thu, 03 Feb 2005 18:46:18 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: a very bad question (and getting OT)
Message-Id: <m86dnVykOqVXKp_fRVn-gg@comcast.com>
Jürgen Exner wrote:
> Allen Windhorn wrote:
>> In American English (an oxymoron, probably)
>
> Rather a contradiction
>
Well, yes, that's what an oxymoron is, you know.
Like "Large medium", "jumbo shrimp", or "military
intelligence".
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Thu, 03 Feb 2005 16:57:01 -0700
From: Eric Schwartz <emschwar@fc.hp.com>
Subject: Re: a very bad question (and getting OT)
Message-Id: <etoekfx42pe.fsf@wilson.emschwar>
"Jürgen Exner" <jurgenex@hotmail.com> writes:
> Allen Windhorn wrote:
>> In American English (an oxymoron, probably)
>
> Rather a contradiction
Neither. It's a perfectly valid, if wholly inadequate (Which
America? Deep South? Appalachia? Midwest? New England?)
description for a dialect of English.
See "The American Language", Mencken et. al., for further info.
-=Eric, tired of the America-baiting
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 3 Feb 2005 20:59:03 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: a very bad question
Message-Id: <slrnd0544n.rc3.dha@panix2.panix.com>
On 2005-02-03, Peter Wyzl <wyzelli@yahoo.com> wrote:
><leo.hou@gmail.com> wrote in message
> news:1107394580.644080.49610@c13g2000cwb.googlegroups.com...
>: Hi guys, prepare for a bad question... I want to know how to pronounce
>: "~" and "#" in English
>
> ~ is spelt tilde but pronounced tild or tilled
Actually, that 'e' is not silent. See, for instance,
http://dictionary.reference.com/search?q=tilde
(for more on that schwa on the end, try
http://en.wikipedia.org/wiki/Schwa)
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
It's amazing what giant mutant ants that are the result of Man's
dabbling with the power of atomic energy can accomplish when they set
themselves to the task. - Mark Rogaski
------------------------------
Date: Fri, 4 Feb 2005 00:34:16 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: Re: a very bad question
Message-Id: <slrnd05d7o.q0.news@maki.homeunix.net>
Paul Lalli wrote :
><leo.hou@gmail.com> wrote in message
> news:1107394580.644080.49610@c13g2000cwb.googlegroups.com...
>> Hi guys, prepare for a bad question... I want to know how to pronounce
>> "~" and "#" in English
>
> In addition to the other responses, you should be aware that some people
> refer to '#' as a 'number sign'.
... and others as 'garden fence'
a musician, however, would tell you this is a 'sharp symbol'
see http://cnx.rice.edu/content/m10943/latest/
Regards
Martin
SCNR
--
perl -e 'print 7.74.117.115.116.11.32.13.97.110.111.116.104.101.114.11
.32.13.112.101.114.108.11.32.13.104.97.99.107.101.114.10.7'
------------------------------
Date: Fri, 4 Feb 2005 00:39:11 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: Re: a very bad question
Message-Id: <slrnd05dgv.q0.news@maki.homeunix.net>
chris-usenet@roaima.co.uk wrote :
> leo.hou@gmail.com wrote:
>> Hi guys, prepare for a bad question... I want to know how to
>> pronounce "~" and "#" in English
>
> Larry <larry_wallet@yahoo.com> wrote:
>> Tilde and Pound sir.
>
> Ah. You must be using American English.
>
> In English English it's "tilde" and (usually) "hash", respectively.
So my version of *nix obviously speaks English English.
see `man ftp | less -p hash` if yours do so, too.
SCNR
Martin
--
perl -e 'print 7.74.117.115.116.11.32.13.97.110.111.116.104.101.114.11
.32.13.112.101.114.108.11.32.13.104.97.99.107.101.114.10.7'
------------------------------
Date: 04 Feb 2005 00:29:52 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: a very bad question
Message-Id: <slrnd05gg0.g2.abigail@alexandra.abigail.nl>
Peter Wyzl (wyzelli@yahoo.com) wrote on MMMMCLXXIV September MCMXCIII in
<URL:news:D6nMd.146056$K7.70259@news-server.bigpond.net.au>:
() <leo.hou@gmail.com> wrote in message
() news:1107394580.644080.49610@c13g2000cwb.googlegroups.com...
() : Hi guys, prepare for a bad question... I want to know how to pronounce
() : "~" and "#" in English
()
() ~ is spelt tilde but pronounced tild or tilled
()
() # is called either pound or hash depending whether you speak US English
() (pound) or UK/Australian English (hash)
In Dutch, 'hekje' (meaning "little fence", although the suffix '-je',
which means "little" is often used for no apparent reason) is often
used. In the 80s, the term 'spoorwegovergang' ("railroad crossing")
was sometimes used as well - but that term seemed to have died away
after September started.
Abigail
--
sub _ {$_ = shift and y/b-yB-Y/a-yB-Y/ xor !@ _?
exit print :
print and push @_ => shift and goto &{(caller (0)) [3]}}
split // => "KsvQtbuf fbsodpmu\ni flsI " xor & _
------------------------------
Date: 04 Feb 2005 00:31:36 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: a very bad question
Message-Id: <slrnd05gj8.g2.abigail@alexandra.abigail.nl>
Chris Mattern (matternc@comcast.net) wrote on MMMMCLXXIV September
MCMXCIII in <URL:news:pMadnQkseqnjyZ_fRVn-vg@comcast.com>:
** Scott Bryce wrote:
**
** > Paul Lalli wrote:
** >
** >> In addition to the other responses, you should be aware that some people
** >> refer to '#' as a 'number sign'.
** >
** > or "sharp."
**
** Actually, in spite of what Microsoft would have you believe, a musical
** sharp sign, although very similar in appearance to hash/pound/octothorpe,
** is in fact different. If you'll look at Unicode UTF-8, you will discover
** that the musical sharp sign is code 0x266f.
Yeah, but so are quotes.
Abigail
--
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print
qq{Just Another Perl Hacker\n}}}}}}}}}' |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w
------------------------------
Date: Tue, 01 Feb 2005 22:28:41 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: compacting '..' path segments using File::Spec
Message-Id: <toTLd.20$zr.12@newssvr23.news.prodigy.net>
ofer@netapt.com wrote:
> By the description of canonpath ('a logical cleanup of a path'), and
> your example, it would seem to be what I'm looking for. I threw it in
> to my test script... and it didn't change the path at all. It still
> returns /foo/bar/../somefile instead of /foo/somefile.
That's be cause on unix filesystems, /foo/bar/../somefile can not
usually be determined to be the same as /foo/somefile.
> Of course, I'm running on Linux, and I see you're running on DOS or
> Windows. So I copied my test script over to my windows desktop,
> tweaked it a bit, and tried it. It works!
> So it appears canonpath does what I want on DOS/Windows, but not on
> Linux.
> How bizarre.
On windows/dos, (no symlinks), the two files are the same.
Even on unix, you can call the windows canonpath directly if you don't
care about it breaking in some cases.
--
Darren Dunham ddunham@taos.com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
------------------------------
Date: Thu, 03 Feb 2005 22:13:07 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: compacting '..' path segments using File::Spec
Message-Id: <TlxMd.131$Vy6.55@edtnps91>
Darren Dunham wrote:
> ofer@netapt.com wrote:
>
>>By the description of canonpath ('a logical cleanup of a path'), and
>>your example, it would seem to be what I'm looking for. I threw it in
>>to my test script... and it didn't change the path at all. It still
>>returns /foo/bar/../somefile instead of /foo/somefile.
>
> That's be cause on unix filesystems, /foo/bar/../somefile can not
> usually be determined to be the same as /foo/somefile.
Sure it can. lstat() both files and if the device numbers and inode numbers
are the same then they are the same file.
John
--
use Perl;
program
fulfillment
------------------------------
Date: 3 Feb 2005 19:38:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: FAQ 6.18 Why does using $&, $`, or $' slow my program down?
Message-Id: <cttuk1$8qr$1@mamenchi.zrz.TU-Berlin.DE>
PerlFAQ Server <comdog@panix.com> wrote in comp.lang.perl.misc:
> This message is one of several periodic postings to comp.lang.perl.misc
> intended to make it easier for perl programmers to find answers to
> common questions. The core of this message represents an excerpt
> from the documentation provided with Perl.
>
> --------------------------------------------------------------------
>
> 6.18: Why does using $&, $`, or $' slow my program down?
>
> Once Perl sees that you need one of these variables anywhere in the
> program, it provides them on each and every pattern match. The same
> mechanism that handles these provides for the use of $1, $2, etc., so
> you pay the same price for each regex that contains capturing
> parentheses.
The last sentence is simply wrong (I don't know if it ever was true).
Capturing parentheses copy *only* the part of the match in parentheses.
The trouble with match variables is mostly that *all* of the string
is copied on every match, capturing or not.
> If you never use $&, etc., in your script, then regexes
> *without* capturing parentheses won't be penalized.
Those *with* capturing parentheses won't be penalized either, above
the cost of copying the match. It's the pre-match and post-match
copying that causes trouble, if any. Simple benchmark:
use English;
$_ = 'a' x 30_000;
1 while /(.)/g;
With "use English", i.e. with match variables, this takes a few seconds
on my machine. Without it, it returns immediately.
I'm appending a suggestion for a revised text. It doesn't mention
normal capturing at all.
Anno
Once Perl sees that you need one of these variables anywhere in the
program, it provides them on each and every pattern match. That
means that on every pattern match the entire string will be copied,
part of it to $`, part to $&, and part to $'. Thus the penalty is
most severe with long strings and patterns that match often. Avoid
$&, $', and $` if you can, but if you can't, once you've used them
at all, use them at will because you've already paid the price.
Remember that some algorithms really appreciate them. As of the
5.005 release, the $& variable is no longer "expensive" the way the
other two are.
------------------------------
Date: Thu, 03 Feb 2005 22:06:21 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Finding disk space used by Windows or Unix directory
Message-Id: <xfxMd.124$Vy6.38@edtnps91>
Anno Siegel wrote:
> <john_ramsden@sagitta-ps.com> wrote in comp.lang.perl.misc:
>
>>For Windows and Unix I need a perl module or script[s] that
>>returns the disk space occupied by a specified directory
>>(including all files and subdirectories recursively).
>>
>>I could write one using File::Find or equivalent; but I'd
>>rather not reinvent the wheel if there's already a tried
>>and tested module or code out there, which having spent
>>some fruitless time searching I'm beginning to doubt.
>
> The problem with disk space measurement is not so much gathering the data
> (easy with File::Find), but the interpretation. Under Unix there are hard
> and soft links to consider. There is no way of treating them right under
> all circumstances. This particular wheel needs the re-invention of one
> or two spokes every time.
And don't forget sparse files which are applicable under NTFS as well as most
Unix and Linux file systems. :-)
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 02 Feb 2005 21:57:19 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Free perl obfuscation service
Message-Id: <31cMd.24$lz5.15@newssvr24.news.prodigy.net>
Liraz.Siri@gmail.com wrote:
> So I turned my obfuscator program into a web service anybody can use
> for free:
>
> http://liraz.org/obfus.html
I hate to be annoying (although sometimes I can't help it!) but it
doesn't seem to do much.
Input (rather contrived):
#!perl -w
use strict;
my $x = 0;
while ($x < 5) {
print <<EOBF;
I don't think this is obfuscated enough!
Checkout Acme::Bleach or Acme::EyeDrops for really clean programs ..
EOBF
sleep int rand 4;
}
And the output, surprisingly enough, is:
#!perl -w
use strict;my $OO0=0;while($OO0<5){print<<EOBF;I don't think this is
obfuscated enough! Checkout Acme::Bleach or Acme::EyeDrops for really
clean programs .. EOBF sleep int rand 4;}
(that's all in one line)
The only thing it did was remove linebreaks, and change var names, which
hardly qualifies as obfuscation. Moreover, the output is not valid Perl.
--Ala
------------------------------
Date: Thu, 3 Feb 2005 14:12:16 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Hash value not being interpolated
Message-Id: <slrnd051d0.3fi.tadmc@magna.augustmail.com>
evillen@innocent.com <evillen@innocent.com> wrote:
> Please help,
Please show actual Perl code.
> I can't figure out why my hash value not being
> interpolated correctly?
The code does not even compile, so speaking of its output
is premature.
> @symbol_data = (CONN_UMP_3MM_SMT, sym.req:0554,
> lib.name:conn_ump_3mm_smt, height:3.00mm, used:01ATiss1/Whitney RF,
> (rev:2,NJH,26/05/04));
Bareword found where operator expected at temp line 6, near "3.00mm"
(Missing operator before mm?)
Bareword found where operator expected at temp line 6, near "01ATiss1"
(Missing operator before ATiss1?)
syntax error at temp line 5, near "req:"
temp had compilation errors.
You should put quotes around your strings.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 3 Feb 2005 20:17:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Hashtable of arrays
Message-Id: <ctu0tj$8qr$2@mamenchi.zrz.TU-Berlin.DE>
nobull@mail.com <nobull@mail.com> wrote in comp.lang.perl.misc:
> mike wrote:
> | my $found; # undef is a perfectly good false
> | for (@{$trans{$word}}) {
> | $found++,last if $_ eq $nw;
> | }
>
> Note: $found++ is actually slower than $found=1 but I find it more
> ideomatic.
>
> Personally I'd still use grep in this case as the effort of breaking
> out of the loop is hardly warranted by the few duplicates we are
> expecting.
Then there's List::Util::first, for cases where it matters.
Anno
------------------------------
Date: Thu, 03 Feb 2005 16:29:14 -0700
From: Eric Schwartz <emschwar@fc.hp.com>
Subject: Re: in line editing
Message-Id: <etooef143zp.fsf@wilson.emschwar>
kitoclick1@yahoo.co.uk (roller) writes:
> To clarify I need to loop through a file say 'names' and for every
> occurrence of a username in this file that it finds in file
> 'auto_home_users' I need to change the line in auto_home_users so that
>
> username -soft server:/export/vol00/users:username
>
> is changed to
>
> username -soft another_server:/export/vol00/users:username
>
> perl -i.bak -p -e would change every line with server to
> another_server.
-e just runs any perl code you care to put in it. So all you have to
do is restrict the s/// to lines with username in them:
perl -pi.bak -e 's/server/another_server/ if /^username/' filename
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 03 Feb 2005 16:38:10 -0700
From: Eric Schwartz <emschwar@fc.hp.com>
Subject: Re: in line editing
Message-Id: <etok6pp43kt.fsf@wilson.emschwar>
Matija Papec <perl@my-header.org> writes:
> Eric Schwartz <emschwar@fc.hp.com> wrote:
>>That's overkill for a problem that can be solved with a simple
>>
>>perl -pi.bak -e 's/this/that/' file
>>
>>don't you think?
>
> No, I don't; perhaps OP wants to apply more logic to his line substitution
> so oneliner might not be the right thing.
I trust the OP is smart enough to state this if it's the case. The
problem statement, while a bit confused originally, is entirely
amenable to a one-liner, especially as clarified.
> On the other hand, this is
> actually FAQ,
>
> perldoc -q "change one line"
I've never inveigled against reading the FAQ, and the answer is a
correct one, to be sure, but it's inadequate, if you ask me (nobody
did). The ability to do things easily with perl on the command line
is one of its many strengths, and I think it's unfortunate that the
FAQ ignores it in this case.
How's this for a patch:
--- perlfaq5.pod 2005-02-03 16:37:19.783159978 -0700
+++ /usr/share/perl/5.8.4/pod/perlfaq5.pod 2004-12-11 06:17:59.000000000 -0700
@@ -63,8 +63,7 @@
=head2 How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?
Use the Tie::File module, which is included in the standard
-distribution since Perl 5.8.0, or check L<perlrun> for
-documentation of the -n and -p switches.
+distribution since Perl 5.8.0.
=head2 How do I count the number of lines in a file?
Comments?
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 3 Feb 2005 20:42:37 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Invisible variables in Perl debugger
Message-Id: <ctu2bt$1pq0$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Volker Nicolai
<vnick@freenet.de>], who wrote in article <de7655a5.0502030513.74c1aa3f@posting.google.com>:
> require "gen_spec.pl";
...
> To verify that I tried to print the value of $reg_key
>
> p $reg_key
>
> but nothing comes out though it should and I can see in a print
> statement in my code-to-be-debugged that $reg_key does have a value.
On a surface, it looks that this may be a true bug. However, what you
write is very ambiguous (and I suspect that English is not your first
language, so it may take a lot of time to clear through...). If you
can create a short example, please post it.
Thanks,
Ilya
------------------------------
Date: 3 Feb 2005 16:00:42 -0800
From: "Wondering" <dbent@comcast.net>
Subject: Newbie asking, interesting question
Message-Id: <1107475242.407759.146260@l41g2000cwc.googlegroups.com>
I'm struggling to learn Perl, with some degree of success. I have a
question that's a bit more advanced than I am, but I hope someone can
help (thanks in advance to all who read this and biger thanks to
responders).
I'm trying to match name and address records in a large (~300,000
record) database with potential new records to avoid duplicates. Anyone
who has tried this knows that there are problems with exact matching,
especially if no convention has been followed for entering data.
(Consider all the possible variations of "avenue" - "avenue", "av",
"ave", etc., and when you consider drive, boulevard, etc. and all their
possible abbreviations, you begin to get the picture). So, I want to be
able to extract just the numeric characters in a strings so I can do
the matching on those (it's fuzzy, but with other feilds being
considered, too, we can get a fairly high matching rate). Anyone know
how to extract just the numeric charaters?
I'll also accept any other ideas for doing the match.
------------------------------
Date: Thu, 03 Feb 2005 16:27:48 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Newbie asking, interesting question
Message-Id: <030220051627483372%jgibson@mail.arc.nasa.gov>
In article <1107475242.407759.146260@l41g2000cwc.googlegroups.com>,
Wondering <dbent@comcast.net> wrote:
[fuzzy matching problem description snipped]
> ... Anyone know
> how to extract just the numeric charaters?
Use the tr operator inverting a search string of all digits:
$string =~ tr/0-9//cd;
eliminates everything in $string that is not a numerical digit.
See perldoc perlop and search for 'Transliterates' for info on tr///.
See also 'perldoc -q approximate'
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
------------------------------
Date: 3 Feb 2005 17:15:41 -0800
From: "Wondering" <dbent@comcast.net>
Subject: Re: Newbie asking, interesting question
Message-Id: <1107479741.294415.39620@g14g2000cwa.googlegroups.com>
Right on. I know tr from *nix, just didn't occur to me to use it for
this. Big thanks!
------------------------------
Date: Fri, 4 Feb 2005 00:19:24 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: Re: Newbie Hash question.
Message-Id: <slrnd05cbs.q0.news@maki.homeunix.net>
Wondering wrote :
> The responses have been most helpful, and I have not only solved my
> immediate problem, but I have a much better understanding of hashes in
> general. Thanks all!
>
Good: You respond to some helpful advice you have been given.
Bad: Nobody knows, what you are talking about, since you didn't quote.
Please read: http://learn.to/quote
Thank you!
Martin
--
perl -e 'print 7.74.117.115.116.11.32.13.97.110.111.116.104.101.114.11
.32.13.112.101.114.108.11.32.13.104.97.99.107.101.114.10.7'
------------------------------
Date: 3 Feb 2005 14:51:41 -0800
From: "Larry" <larry_wallet@yahoo.com>
Subject: one-liner to make all programs one-liners
Message-Id: <1107471101.232802.166260@g14g2000cwa.googlegroups.com>
>From deep in my secret lab, I have reduced millions of lines of code to
a single line with this =>
s/\n//g and print while <>;
Be very careful...
------------------------------
Date: 03 Feb 2005 23:35:35 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: one-liner to make all programs one-liners
Message-Id: <slrnd05dac.cjd.mgjv@verbruggen.comdyn.com.au>
On 3 Feb 2005 14:51:41 -0800,
Larry <larry_wallet@yahoo.com> wrote:
>>From deep in my secret lab, I have reduced millions of lines of code to
> a single line with this =>
>
> s/\n//g and print while <>;
>
> Be very careful...
Indeed. Try this one:
--- begin ---
#!/usr/local/bin/perl
print "Hello World!\n"
--- end ---
And if you insists that the shebang line isn't part of the program:
--- begin ---
# start of program
print "Hello World!\n"
--- end ---
And if you insist that you can't have comments (or pod documentation):
--- begin ---
print "Hello World!
"
--- end --
or worse:
--- begin ---
print <<EOF
Hello World!
EOF
--- end --
And I could probably go on a bit longer, if I felt like it. Line
endings in Perl are not equivalent to "nothing" or even other
whitespace. They are for many intents and purposes, but not nearly for
all.
Martien
--
|
Martien Verbruggen | Begin at the beginning and go on till you
| come to the end; then stop.
|
------------------------------
Date: 3 Feb 2005 18:01:37 -0800
From: Randal_Schwartzcopf@yahoo.com
Subject: Re: OT [Fwd: Fwd: symptoms of a stroke]
Message-Id: <1107482497.308737.256550@l41g2000cwc.googlegroups.com>
>>A cardiologist says if everyone who gets this e-mail sends it to 10
people,
>>you can bet that at least one life will be saved.
>>BE A FRIEND AND SHARE THIS ARTICLE WITH AS MANY FRIENDS AS
POSSIBLE. It
>>could save their lives!
use Mail::Sendmail;
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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.
#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 V10 Issue 7732
***************************************