Sponsoring The Perl Toolchain Summit 2025: Help make this important event another success Learn more

#!/usr/bin/ruby
# Tests for the `goto` statement
func example {
var arr = []
goto :hello
arr << "never here"
@:hello
arr << "hello"
goto :world
arr << "never here"
@:world
arr << "world"
}
assert_eq(example(), ['hello', 'world'])
say "** Test passed!"