Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

A follow up to "Question about recursively generated iterators"

by perlfan (Curate)
on Oct 16, 2007 at 16:46 UTC ( #645222=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # this function is not recursive; it is called once
    # and returns with the subroutine calls it /would have/
    ...
      execute sub ref, $x = $sub->();
      push subs returned by get_sub(param1,...,paramN) onto @callstack;
    end while
    
  2. or download this
    ...
      return sub { my $arg1 = shift; my $arg2 = shift; ... ;};
    ...
    
  3. or download this
      my @subrefs = ();
      # loop, push sub refs onto @subrefs
    ...
    ...
      return { subref => @subrefs, val1 => 1, val2 => 'abc' };
    ...
    
  4. or download this
    # make call
    my $caller = get_sub(...);
    ...
    my @subrefs = @{$caller->{subrefs}};
    # push returned subs onto call stack
    push(@callstack,@subrefs);
    
  5. or download this
    #!/usr/bin/env perl
    use strict;
    ...
        last;
      }
    }
    
  6. or download this
    PRE: abc&(def)*
    Acyclic:
    ...
      defdefdefdefdeabfdefdcefdefdef
      defdefdefdefdeabfdefdcefdefdefdef
      defdefdefdefdeabfdefdcefdefdefdefdef
    
  7. or download this
    sub get_acyclic_sub {
      my $self = shift;
    ...
      my $self = shift;
      return $self->init_acyclic_iterator();
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://645222]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2015-07-06 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls