From: Stephen Smith <4fires@...> Date: 2007-04-16T03:30:05+09:00 Subject: Re: translate Perl diamond operator to Ruby ------=_Part_31645_11884252.1176661798625 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Curious +1 :-) On 4/15/07, Chad Perrin wrote: > > Over the years, I've found the following to be an excellent way to whip > up quick, very useful Perl scripts: > > #!/usr/bin/perl > > while(<>) { > # do stuff . . . > } > > Is there an equivalent idiom in Ruby? So far as I'm aware, there's no > catch-all diamond operator in Ruby that allows one to create a default > input behavior for a script that accepts either a filename or piped > output of another command the way this works in Perl. I certainly hope > there's an equivalent, though. > > -- > CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] > "The ability to quote is a serviceable > substitute for wit." - W. Somerset Maugham > > ------=_Part_31645_11884252.1176661798625--