Ask a Question related to Ruby, Design and Development.
-
Robert Klemme #1
Strange behavior of $.
Apparently $. is not always set correct (see second ruby 1liner). Is this
a bug?
12:12:42 [temp]: cat -n n
1
2
3 BAR="hello"
4
12:12:47 [temp]: ruby -ne 'puts $.' n
1
2
3
4
12:12:56 [temp]: ruby -e 'while(line = gets); puts "#{$.}:#{line.chomp}";
end' n
1:
1:
2:BAR="hello"
3:
12:13:10 [temp]: ruby --version
ruby 1.8.0 (2003-08-04) [i386-cygwin]
12:13:35 [temp]:
The same happens when put into a script:
12:16:02 [temp]: ./x.rb n
1:
1:
2:BAR="hello"
3:
12:16:03 [temp]: cat x.rb
#!/usr/bin/ruby
while ( line = gets )
puts "#{$.}:#{line.chomp}"
end
12:16:12 [temp]:
Any ideas?
Regards
robert
Robert Klemme Guest
-
Strange behavior
The problem seems to be in c code calling ruby calling c code. ======== start test.rb puts "about to require curses" require "curses" puts... -
Re[2]: Strange behavior of DBI/DBD::Informix
Thank you for the reply. Sorry, I wrote late in the evening and forgot to post my configuration: Perl 5.6.1 AIX 4.2.1 (I know it's old... -
Strange behavior of DBI/DBD::Informix
I tried sending this problem to the address specified in DBD::Informix::TechSupport (perldoc) - dbd-informix@us.ibm.com but... -
Strange behavior of DBD/DBI Informix
I am not sure if this list is the best one to post to regarding this problem. If not please point me to the better one. Consider the following... -
Why strange IF...ELSE behavior
Hi all, I'm getting a strange result with the following IF statement: $bar = ($foo == 'last') ? true : false; In my script $foo normaly has... -
nobu.nokada@softhome.net #2
Re: Strange behavior of $.
Hi,
At Wed, 17 Sep 2003 19:34:38 +0900,
Robert Klemme wrote:It feels fixed already.> 12:12:56 [temp]: ruby -e 'while(line = gets); puts "#{$.}:#{line.chomp}";
> end' n
> 1:
> 1:
> 2:BAR="hello"
> 3:
> 12:13:10 [temp]: ruby --version
> ruby 1.8.0 (2003-08-04) [i386-cygwin]
--
Nobu Nakada
nobu.nokada@softhome.net Guest



Reply With Quote

