Ruby1.9 -n/-p and END{}

e$B$$$^$$$G$9!#e(B

Ruby 1.9 e$B$N5/F0%*%W%7%g%s$Ke(B -n e$B$de(B -p e$B$rIU$1$k$H!"e(BEND{}
e$B$N%V%m%C%/$,F~e(B
e$BNO$N9T?tJ,e(B?e$B<B9T$5$l$k$h$&$G$9!#e(BBEGIN{}
[email protected]$1$7$+<B9T$5$l$^$;$s!#e(B
Ruby 1.8 e$B$G$Oe(B END{}
e$B$b0lEY$7$+<B9T$5$l$^$;$s!#2?$+J,$+$j$^$9$G$7$g$&$+!)e(B

$ ruby1.9 -v n.rb
ruby 1.9.0 (2008-07-20 revision 18134) [i686-linux]
:begin
:end
$ ruby1.9 -v -n n.rb n.rb
ruby 1.9.0 (2008-07-20 revision 18134) [i686-linux]
:begin
:end
:end
:end
:end
:end
:end
$ ruby1.9 -v -p n.rb n.rb
ruby 1.9.0 (2008-07-20 revision 18134) [i686-linux]
:begin
BEGIN{
p :begin
}
END{
p :end
}
:end
:end
:end
:end
:end
:end
$ ruby1.8 -v -p n.rb n.rb
ruby 1.8.7 (2008-07-19 revision 18130) [i686-linux]
:begin
BEGIN{
p :begin
}
END{
p :end
}
:end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs