Sponsoring The Perl Toolchain Summit 2025: Help make this important event another success Learn more
123456789101112131415 #!/usr/bin/ruby### https://rosettacode.org/wiki/Generic_swap#func swap(Ref a, Ref b) { (*b, *a) = (*a, *b);}var (x, y) = (1, 2);swap(\x, \y);say x;say y;
#!/usr/bin/ruby
#
## https://rosettacode.org/wiki/Generic_swap
func swap(Ref a, Ref b) {
(*b, *a) = (*a, *b);
}
var (x, y) = (1, 2);
swap(\x, \y);
say x;
say y;