Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!dixie.com!eeh From: eeh@Dixie.Com (Ed Howland) Newsgroups: comp.lang.perl Subject: Shortest Perl and Awk programs Keywords: Awk Perl "The Unix Programing Environment" Message-ID: <9004@rsiatl.Dixie.Com> Date: 31 Mar 91 18:54:53 GMT Organization: Dixie Communications Services Lines: 15 This post might not belong here, but since there is no group for purely Awk programming, I though I might ask here. In the book "The Unix Programming Environment", by Kernighan and Pike, there is an excelent introduction to 'awk', which I learned to program in it. I was re-reading this the other day and came upon the question: "What is the shortest awk program that just copies its input to its output?" I came up with : !0 Is there anything shorter? Why does'nt just '1' (or any non-zero value) work? Also, does this hold true to perl? (Sorry I don't know perl well enough to to even guess.) What would be the shortest perl program to do this? Ed Howland : uucp: ..emory!rsiatl!eeh