Perl goto 语句2024年8月29日 | 1 分钟阅读 Perl goto 语句是跳转语句。 它用于通过跳转到循环内的其他标签来转移控制权。 有三种 goto 形式 goto LABEL它跳转到标有 LABEL 的语句,并从那里恢复正常执行。 goto EXPR它是 goto LABEL 的一个概括。 该表达式返回一个标签名称,然后跳转到该标签语句。 goto &NAME对于当前正在运行的子例程,它将调用替换为指定子例程的调用。 Perl goto 语句的语法如下 Perl goto 语句示例让我们看一个简单的示例,在 Perl 语言中使用 goto 语句。 输出 You are not eligible to vote! Enter your age: 11 You are not eligible to vote! Enter your age: 5 You are not eligible to vote! Enter your age: 26 You are eligible to vote! 下一个主题Perl 注释 |
我们请求您订阅我们的新闻通讯以获取最新更新。