use strict; use warnings; use v5.14; while (1) { my $current = shift @ARGV; say $current; push @ARGV, $current; say "Hit return or enter 0 to exit"; chomp (my $input = ); last if $input eq "0"; } exit 0;