From: mike@... (Mike Stok) Date: 2002-02-20T04:08:26+09:00 Subject: Re: Perl IO to Ruby IO help needed In article , Craig Files wrote: > I want to convert the following lines from Perl to Ruby. And I cannot > figure out how to load the file into memory: > > The Perl file: > > open (DEF, "<$input_def") || die "$0: cannot read $input_def\n"; > $/ = undef; # read the entire file... > $_ = ; # ...into memory > close(DEF); [...] What about sonething like content = nil input_def = '/etc/passwd' File.open(input_def, 'r') { |f| content = f.read } puts "got >>>#{content}<<<"; you can catch the exceptions if you want to handle the open errors yourself. Hope this helps, Mike -- mike@stok.co.uk | The "`Stok' disclaimers" apply. http://www.stok.co.uk/~mike/ | GPG PGP Key 1024D/059913DA mike@starnix.com | Fingerprint 0570 71CD 6790 7C28 3D60 http://www.starnix.com/ | 75D2 9EC4 C1C0 0599 13DA