Discussion: minimal nntp client
Afficher un message
Vieux 13/03/2008, 12h10   #3
Thomas Wieczorek
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: minimal nntp client

On Thu, Mar 13, 2008 at 2:32 AM, Gerry Ford <wade@zaxfuuq.net> wrote:
>
> Q1) What is the ruby analog to the perl use of strict and warnings?
>


I am not really experienced in Perl, but as I understand it. strict
enforces that you have to declare variables, so that when you mistype
something an error occurrs. You get a NameError in Ruby when you use a
variable which hasn't any value assigned:

# irb
# foo has a value
foo = "Hello"
puts foo # "Hello"

# bar is not declared
puts bar

# NameError: undefined local variable or method `bar' for main:Object
# from (irb):6

As far as I know you can't turn warnings on from your code, but you
can run Ruby with the "-w" option which shows warnings.

  Réponse avec citation
 
Page generated in 0,05404 seconds with 9 queries