Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • rubyisms.pm has an idiomatic translation of "yield" (As well as "self" and "super"). As for perldoc -f, ri should do everything you want.
    • I'm working with the 'yield' function from that now. And thanks for the tip about 'ri'. Very useful!

    • Actually, I can't seem to use your 'yield' as a direct translation. I'm missing something fundamental. I put together this in Ruby (very similar to my actual problem):

      class Foo
          attr_reader :val
          def initialize(val)
              @val = val
          end
          def inc(some_val)
              @val = @val + some_val
          end
      end

      def testy(args)
          foo = Foo.new(1)
          _testy(args, foo) {
              yield