Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: how to jump to some specific line in my code ?

by Anonymous Monk
on Sep 27, 2016 at 04:58 UTC ( [id://1172703]=note: print w/replies, xml ) Need Help??


in reply to how to jump to some specific line in my code ?

If the input number is 0 or less than 0 than it should jump to some other part say line number 32 of my code. how can I achieve that? any specific function which I can use?

See

See http://perldoc.perl.org/perlintro.html#Writing-subroutines and Modern Perl chapter 5

use strict; use warnings; Main( @ARGV ); exit( 0 ); sub Main { my $default = 0; my $num = Prompt( "Enter num flags:", $default ); if( $num eq 'purple ){ PurpleFlags( $num ); } else { BananaFlags( $num ); } } sub PurpleFlags { my( $num ) = @_; ... } sub BananaFlags { my( $num ) = @_; ...; } sub Prompt { ExtUtils::MakeMaker::prompt( @_ ); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-28 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found