#! /usr/bin/perl use strict; my $limit = $ARGV[0] || 10; my $result = "jeg er glad."; while( my $head = &swap ) { $result = $head. " er glad " . $result; } print $result, "\n"; BEGIN { my @oss = qw( jeg du ); my ( $index, $count ); sub swap{ ( $limit > $count++ ) ? return $oss[ $index = not $index ] : return; } }