Hi ankit.tayal560,

As others have already pointed out, goto LABEL should nowadays basically be avoided at all costs. GrandFather already showed you subroutines and conditionals (if), I just wanted to add something to the general list of ways to control program flow: the loop control statements next, last and redo. The advantage of these over goto is that they operate on a block of code, which has its own scope and is visible in the structure of the code. Note that the loop control statements still allow a bit of evil: they can be used across the boundaries of subroutines, which luckily generates a warning.

Regards,
-- Hauke D


In reply to Re: how to jump to some specific line in my code ? by haukex
in thread how to jump to some specific line in my code ? by ankit.tayal560

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.