[Date Prev][Date Next][Thread Prev][Thread Next]
[Search]
[Date Index]
[Thread Index]
Re: [FWP] president
- To: fwp@technofile.org
- Subject: Re: [FWP] president
- From: "Keith Calvert Ivey" <kcivey@cpcug.org>
- Date: Wed, 8 Nov 2000 21:43:27 -0500
- Comments: Authenticated sender is <kcivey@cpcug.org>
- Delivered-To: irons-bumppo:net-mpfwp@bumppo.net
- In-reply-to: <4.3.2.7.2.20001108160909.00b694d0@psdt.com>
- References: <Pine.BSF.4.21.0011081350470.63697-100000@c679327-a.enclv-m du1.sfba.home.com>
Peter Scott <Peter@PSDT.com> wrote:
> perl -MLWP::Simple
> -le'@a[0,1]=get("http://cnn.com")=~/([\d,]{9})/g;$"="-";s/,//g
> for@a;print eval"@a"'
The $" stuff may be fun, but it's not good for golf. The
straightforward way is shorter:
perl -MLWP::Simple
-le'@a[0,1]=get("http://cnn.com")=~/([\d,]{9})/g;s/,//g
for@a;print$a[0]-$a[1]'
Also, the [0,1] is unnecessary, and things can be changed around
to save more strokes (I used y... instead of s/// for fun and
efficiency):
perl -MLWP::Simple
-le"y.,..dfor@a=get('http://cnn.com')=~/([\d,]{9})/g;print$a[0]-$a[1]"
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
==== Want to unsubscribe from Fun With Perl? Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
==== unsubscribe