Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

A follow up to "Question about recursively generated iterators"

by perlfan (Vicar)
on Oct 16, 2007 at 16:46 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-25 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found