my @currentcard; #this variable holds onto strings shifted off of @ARGV #, prints them, then pushes it's contents #back onto the end of ARGV while (1) { #infinite loop START $_ = shift; my $witch = 1; while ($witch) { push (@currentcard, $_); $_ = shift; if ($_ =~ m#^(-\s)$#) { --$witch; } } print @currentcard; push (@ARGV, @currentcard); #push $currentcard #(previously element 0) back onto #@ARGV as the last element ; #Wait for user } #infinite loop END