I've read the replies so far. What you have written as proposed code is simply nonsense. doesn't make sense to me. Please explain in words what it is that you are trying to accomplish?

You cannot "go to" a function x(), because there would be no way to return from the function. Part of a statement like: func_x(); is setting up the stack to call func_x() so that when func_x finishes, it returns to the caller. A "go to" would skip all that stuff that enables the function to return to the caller.

Describe in words what you are trying to do.

Update: this code example, while correct is not illustrative of the OP's problem.

sysread() would be used for say reading a socket with fixed size user level packets. When we read the socket, we learn how many bytes were actually read and we loop if we need more. "Go to sysread() makes no sense".

sub readn #returns scalar with <= $bytes requested { my ($socket, $bytes ) = @_; my $offset = 0; my $buf = ""; my $nread = -1; while ($offset < $bytes and $nread) # $nread==0 means EOF { my $nleft = $bytes-$offset; $nread = sysread($socket, $buf, $nleft, $offset); $offset += $nread; } return $buf; }

In reply to Re: how to goto &sysread ? by Marshall
in thread how to goto &sysread ? by perl5ever

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.