Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
read data embedded in a program
Li Chen
1/13/2007 2:19:00 AM
Hi all,
I run a script copied from "the Ruby way" but it
doesn't work. Any comments?
Thanks,
Li
###script
DATA.each_line do |line|
puts line.reverse
end
_END_
line A
line B
line C
##screen output
>ruby p352_data.rb
p352_data.rb:2: uninitialized constant DATA
(NameError)
>Exit code: 1
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail...
1 Answer
Daniel Finnie
1/13/2007 2:31:00 AM
0
There are two underscores.
Dan
chen li wrote:
> Hi all,
>
> I run a script copied from "the Ruby way" but it
> doesn't work. Any comments?
>
> Thanks,
>
> Li
>
> ###script
>
> DATA.each_line do |line|
> puts line.reverse
> end
>
> _END_
>
> line A
> line B
> line C
>
>
> ##screen output
>> ruby p352_data.rb
> p352_data.rb:2: uninitialized constant DATA
> (NameError)
>> Exit code: 1
>
>
>
> ____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
>
http://new.mail...
>
>
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
read data embedded in a program
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password