[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02106] Re: ARGF or $<

From: Hugh Sasse Staff Elec Eng <hgs@...>
Date: 2000-03-23 15:03:50 UTC
List: ruby-talk #2106
On Thu, 23 Mar 2000, ARIMA Yasuhiro wrote:

> Hi.
> 
> Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk> wrote
> 
> | Has anyone any examples of how to use ARGF or $< as I cannot find much
> | in the docs?  Thank you,
> 
> Have you read next page ?  I can find them.
> 
> http://www.ruby-lang.org/en/man-1.4/variable.html#lt
> http://www.ruby-lang.org/en/man-1.4/variable.html#argf

	Yes, but it doesn't explain how to use them.  ARGF is
	of type Object, so that is of little help.
> 
> ## In fact, I read in japanese. 
> ##   http://www.ruby-lang.org/ja/*
> ##   http://www.ruby-lang.org/ja/yasugi.pdf
> 
> #
> # cat.rb
> #
> # ruby cat.rb   file(s)
> #
> for line in ARGF
>   print line
> end
> 
	Ah, so it is an Array of lines of the concatenated input files.
	Effectively, anyway.   This was not clear from the description:
	
>> The virtual concatenation file of the files given by command line
>> arguments, or stdin (in case no
>> argument file supplied). $<.file returns the current
>> filename. (Mnemonic: $< is a shell input source.)


	thank you
	Hugh

In This Thread