GGarramuno wrote:
> Is there anything in Ruby similar to Perl's if -r, -x, etc. switches? 
> These switches work with variables as if they were files and they are
> used in simple, silent and quick constructs like:
>       if -r $file {
>              print "$file is readable\n";
>       }
> 
> Or am I forced to write all the code of File.new() and handle the
> rescue exceptions myself?

irb(main):001:0> test ?r, "."
=> true

The method is Kernel#test. For details, see rdoc or

http://www.rubycentral.com/book/ref_m_kernel.html#Kernel.test