Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"last" operator for functions?

Tags:

perl

Does Perl have an operator to exit a function or a last for functions?

sub f {

    # some code here

    if ($v == 10) {
    # goto end of function/exit function/last
    }

    # some code here
}

A goto could do the trick, but it seams wrong somehow?

like image 854
Sandra Schlichting Avatar asked Apr 04 '11 12:04

Sandra Schlichting


People also ask

How do you get the last emitted Observable?

Rather than a standard subject (Observable) that just emits values as they come in, a BehaviorSubject emits the last value upon subscribe() . You can also get the last value manually using the BehaviorSubjects getValue() method.

What is pipe () in RxJS?

RxJS' pipe() is both a standalone function and a method on the Observable interface that can be used to combine multiple RxJS operators to compose asynchronous operations. The pipe() function takes one or more operators and returns an RxJS Observable.

How do I get the last value from BehaviorSubject?

The BehaviorSubject There are two ways to get this last emited value. You can either get the value by accessing the . value property on the BehaviorSubject or you can subscribe to it. If you subscribe to it, the BehaviorSubject will directly emit the current value to the subscriber.


1 Answers

Use return; to exit a subroutine.

like image 173
Matt Healy Avatar answered Sep 27 '22 04:09

Matt Healy