Forum: Ruby read data embedded in a program

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2007-01-19 16:31
(Received via mailing list)
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)
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2007-09-25 22:31
(Received via mailing list)
--- Daniel Finnie <danfinnie@optonline.net> wrote:

> There are two underscores.
>
> Dan


Thanks. Now it works.

Li
Cd3312ac93f768b1b449af457c0fca06?d=identicon&s=25 Daniel Finnie (Guest)
on 2007-09-25 22:34
(Received via mailing list)
There are two underscores.

Dan
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2007-09-25 22:45
(Received via mailing list)
--- Daniel Finnie <danfinnie@optonline.net> wrote:

> There are two underscores.
>
> Dan


Thanks. Now it works.

Li
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2007-09-25 22:52
(Received via mailing list)
--- Daniel Finnie <danfinnie@optonline.net> wrote:

> There are two underscores.
>
> Dan


Thanks. Now it works.

Li
This topic is locked and can not be replied to.