use strict; use warnings; use Readonly; my $colr=(); my $output = "phones_out.txt"; my $counter = 0; open(OUT,"+>$output"); Readonly::Scalar my $PHONE_FILE => $ARGV[0] || 'phones.txt'; Readonly::Array my @COLOURS => ; Readonly::Scalar my $GET_MODEL => qr{\A ( [^\n]+ ) }x; open my $PHONES, '<', $PHONE_FILE or die "Cannot open $PHONE_FILE\n"; while (my ($phn) = <$PHONES> =~ $GET_MODEL) { no warnings 'uninitialized'; foreach my $colr (@COLOURS) { $counter++; # chomp $colr; print OUT "\tEAN\thello $phn $colr \n"; } } close $PHONES __DATA__ baby blue baby pink black dark blue brown dark purple green orange hot pink light purple red white yellow #### Apple iPhone 4 Apple iPhone 4s Apple iPhone 3G Apple iPhone 3GS Apple iPod Touch 4th Generation Apple iPod Classic Apple iPod Touch 3rd Generation Apple iPod Touch 2nd Generation