Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Help with Perl Script

by davido (Cardinal)
on Jan 07, 2015 at 20:27 UTC ( [id://1112562]=note: print w/replies, xml ) Need Help??


in reply to Help with Perl Script

You didn't say what part of it your team is having difficulty understanding, so here's a basic rundown of what is going on:

sub get_abandonned($) { # Subroutine de +finition. my $dnis = shift; # $dnis will ho +ld # the parameter +. my $total = 0; # $total holds +0. for my $key(keys %all_calls) { # There is a ha +sh named # %all_calls. +Iterate # over the keys + of the # hash and assi +gn each # key to $key o +n its # respective it +eration. next if ($key =~ /duplicate/); # Proceed to ne +xt # iteration if +the # current key c +ontains # the text 'dup +licate'. if( # If all of the # following are + true: $all_calls{$key}->[DNIS] eq $dnis && $all_calls{$key}->[SPEECH] == 0 && $all_calls{$key}->[TRANSFER] eq "hungup" ) { # then do the f +ollowing: my $time_length # Give a value +to # time_length, = &get_call_length($all_calls{$key}->[TIME]); # from this fun +ction # call. if($time_length <= -29) { # Now if this i +s true... $total++; # increment $to +tal. } } } # Move on to ne +xt key. return $total; # return the $t +otal. }

Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1112562]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-25 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found