From: Rudolf Polzer Date: 2003-01-26T00:51:27+09:00 Subject: Re: wait for more perl programmers! (Re: Can we attack the 'not enough libraries' thing straight on?) Scripsit ille aut illa Yukihiro Matsumoto : > In message "Re: wait for more perl programmers! (Re: Can we attack the 'not enough libraries' thing straight on?)" > on 03/01/25, David Garamond writes: > > |> * discourage use of symbol variables (e.g. $/, etc.) in manual > |> * discourage use of Perlish features by giving warnings. > | > |hm, i wonder what is the list of features that the author (matz?) decide > |as perlish and should be discouraged. > > * symbol variables This probably also includes $1 etc, doesn't it? > * regexp in conditional expression What's that? Just things like if str =~ /regexp/ # ... end or do you just mean REs applied to $_? > * range (../...) in conditonal expression I never really understood these in Perl, anyway - and if there is one thing I do not like it's a side effect in an operator to itself. For example, def foo(bar) 42.times() do |count| foo(nil) if bar if (count == 17) .. (count == 23) p count end end end foo(17) It does what it looks like and shows that ".." creates two internal variables here: one for the inner and one for the outer call. One can make this as confusing as one wants by using more procedures, iterators etc. I'd like this much better: rop = RangeOp.new() # ... if rop[count == 17, count == 23] p count end or even rop = RangeOp.new() do count == 17, count == 23 end # ... if rop.test() p count end maybe rop = RangeOp.new() do |c| c == 17, c == 23 end # ... if rop.test(count) p count end because it's much clearer and it's obvious where the temporary is. Additionally, this "RangeOp" can be implemented completely in Ruby, so the interpreter doesn't need to support it. -- LATIN LESSON: I hear, Audio, I see, ---> Video, I learn! Disco! [Robin Koch in de.talk.jokes, translated]