Read data embedded in a program

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.yahoo.com

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.yahoo.com

Thanks. Now it works.

Li

···

--- Daniel Finnie <danfinnie@optonline.net> wrote:

There are two underscores.

Dan

____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com

Thanks. Now it works.

Li

···

--- Daniel Finnie <danfinnie@optonline.net> wrote:

There are two underscores.

Dan

____________________________________________________________________________________
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
http://farechase.yahoo.com/promo-generic-14795097

Thanks. Now it works.

Li

···

--- Daniel Finnie <danfinnie@optonline.net> wrote:

There are two underscores.

Dan

____________________________________________________________________________________
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/