One way is to iterate over all values and always store the current value, so it becomes the previous value in the next iteration. This way you have both values available at the same time.
The 'tricky' thing is to handle the border case correctly, i.e. when you don't have a previous value, because it's the first iteration... (in the following snippet, this is done by testing if the previous value is defined)
#!/usr/bin/perl -w
use strict;
my @names = ("Ann","John","Michael","George","Smith");
my $prev_name;
for my $name (@names) {
print "$prev_name $name\n" if defined $prev_name;
$prev_name = $name;
}
Output:
Ann John
John Michael
Michael George
George Smith