Robert Dober
4/24/2007 7:30:00 AM
On 4/24/07, music <music@musi.ca> wrote:
> Robert Dober wrote:
> > On 4/23/07, music <music@musi.ca> wrote:
> >> I have to read in many files.
> >> I prefer to concat those files and reading only one large file.
> >> There is a way like unix zcat?
> >>
> >>
> > Sure is
> > ARGF
>
> ARGF ok, but how can I pass ARGF to a method?
>
>
As a global constant it is visible anywhere, you can thus simply do
things like this
def my_method
ARGF.each_line do
| line |
whatever
end
end
R.
--
You see things; and you say Why?
But I dream things that never were; and I say Why not?
-- George Bernard Shaw