#!/usr/bin/perl -w
# note the '-w' above; emits useful warnings
use strict;
while (<>) { # the line eater loop
  chomp; # clips the newline from the end of incoming lines
  print "Input Line = [$_]\n";  # prints the incoming line WITH a newline
  my $N = my @values = split(/ /);  # splits the incoming line on spaces
  # the values go into array '@values' and the number of them is in $N
  my $i = 0; # use $i as a counter
  while ($i < $N){  # while loop that counts up to 1 less than $N
    printf "> %s\n", $values[$i++];  # prints the individual values
                                     # and incr the $i
    sleep 1; # and waits 1s for you to see the result before looping
  }
}
