From: Ryan Davis Date: 2007-12-04T18:47:28+09:00 Subject: Re: Ruby idiom equivalent to Perl "$asdf = $ARGV[0] || die 'arg required'"? On Dec 3, 2007, at 22:41 , Giles Bowkett wrote: > I'm making some command-line utilities easier to use and I was > wondering if there's a really nice simple Rubyish way to do what I > used to do with Perl back in the day. All my code in these utils which > exit and print usage strings in the absence of required command-line > args is looking kinda clunky to me. How ruby REALLY stands out... this can be read out loud: abort "arguments are required" if ARGV.empty? ARGV.each do |arg| # ... end