Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hello, It may be e little bit a strange question, but I am trying to understand some code. The problem is that in this code two subs are calling each other. How is this possible, or am I interpreting things the wrong way. In the following code the  my $retval = $self->{'timespan'}->init({%{$li}}) is calling sub init, but this sub init is calling sub process again. Here is the necessary code to understand my question:
# for parse modules, sub init is sort of int.main() function sub init { my ( $self, $input ) = @_ ; $self->{'_input_'}->{'_type_'} = 'process'; my $li = $self->update_user_input( $input ); $self->process($li,$input) } # True process module, calls methods from Request::Request_Help. sub process { # The incoming array is split into $self, $li and $input my ($self, $li, $input) = @_ ; # $li is a hash-reference where the keys preforid, order_by and order +_sequence are designated # the values 1, time and ASC respectively. $li->{preforid} = 1; $li->{order_by} = "time"; $li->{order_sequence} = "ASC"; my $retval = $self->{'timespan'}->init({%{$li}}); my %stanet; if ($retval) { foreach my $sta (@$retval) { # Check if sufficient data is already in database [bud_reader]; if +not, process station. $li->{station} = $sta->{sta}; $li->{starttime} = $sta->{starttime}; $li->{endtime} = $sta->{endtime}; my $is_data = $self->{'bud_reader'}->init($li);
Hope anyone knows?

In reply to subs calling each other by Utrecht

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-06-12 22:32 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.