On Wed, 7 Jun 2006, Jeff Pritchard wrote:

> Not to be contrarian, but pickaxe page 180 says that ARGV[0] is not the
> name of the program (unlike in C).  There's other stuff I don't get
> about your snippet as well.
> Why ["ruby" + ARGV]????  Seems like you're using + to add an array to a
> string?  Can you explain it for us newbies?

sure.  a mistake ;-)

should have been


   sleep 180
   exec ['ruby', __FILE__, ARGV].flatten.join(' ')

> Working from Pickaxe page 180 I would have come up with something like:
> sleep 180                                      # obvious
> pieces = [ruby, $0].concat(ARGV)  # $0 is program name

sometimes:

   harp:~ > ruby -e'  $0 = "foobar";  p $$;  system "ps -elf|grep foobar|grep -v grep"  '
   12128
   0 S ahoward  12128  4377  0  75   0    -   707 wait4  21:45 pts/2    00:00:00 foobar

regards.

-a
-- 
suffering increases your inner strength.  also, the wishing for suffering
makes the suffering disappear.
- h.h. the 14th dali lama