LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] [TOTD] find error corresponding to number

[ILUG] [TOTD] find error corresponding to number

kevin lyda kevin+dated+1084286125.076e15 at ie.suberic.net
Thu May 6 15:35:17 IST 2004


On Thu, May 06, 2004 at 12:30:25PM +0100, Stephen Shirley wrote:
> kevin lyda wrote:
> > shell.  feh.   :)
> Uh huh.

:)

> > http://ie.suberic.net/~kevin/strerror.pl
> <SNIP>
> > all in a 162 byte perl script with two ?: ops and a map call.
> A 162 byte uncommented perl script. To compare like with like, i removed 
> the comments from padraig's version:
> 
> diamond at fand:/space/dl(0)$ wc -c strerror strerror.pl
> 142 strerror
> 162 strerror.pl

yeah, but i kept in loads of whitespace to keep it readable.  without
that and a slight coding change i'm down to 102 bytes.  plus it looks
more line noisey:

#!/usr/bin/perl
$_=shift;
$e=/^\d+$/?"^$_ ":$_;
print map{$!=$_;"$_ $!"=~/$e/i?"$_ $!\n":""}(0..127);

kevin

-- 
kevin at ie.suberic.net  ~  "you're either with us or against us." --dubya
iraq: vietnam again?  ~  in that simplistic world-view progressives and
a new lbj selected -  ~  liberals are "us" while bush and bin laden are
"looney bush junior"  ~  "against us."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.linux.ie/pipermail/ilug/attachments/20040506/c1f632b7/attachment.pgp


More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell