From: Philip Rhoades Date: 2013-04-19T18:36:05+09:00 Subject: Re: "gets" overwrites string - why does this happen? windwiny, On 2013-04-19 18:57, windwiny wrote: > using >    filename = $*.dup > > because  >    a = [] >    b = a >    a.__id__ == b.__id__ Thanks! - I should have thought of trying that. Regards, Phil. > 2013/4/19 Philip Rhoades > > People, > > If I run this script with a text filename parameter: > > #!/usr/bin/ruby > > puts $* > filename = $* > puts filename > gets > puts $_ > puts filename > > - the last puts is empty!  Why does this happen? > > Thanks, > > Phil. > -- > Philip Rhoades > > GPO Box 3411 > Sydney NSW      2001 > Australia > E-mail:  phil@pricom.com.au -- Philip Rhoades GPO Box 3411 Sydney NSW 2001 Australia E-mail: phil@pricom.com.au