perlnoobster has asked for the wisdom of the Perl Monks concerning the following question:
the phones.txt file contains the following (in one column, below one another):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 => <DATA>; 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
Please can someone help me??? Thank you :)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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Please help me Chomp !
by choroba (Cardinal) on Aug 24, 2012 at 09:42 UTC | |
by perlnoobster (Sexton) on Aug 24, 2012 at 09:52 UTC | |
|
Re: Please help me Chomp !
by nemesdani (Friar) on Aug 24, 2012 at 09:46 UTC | |
by perlnoobster (Sexton) on Aug 24, 2012 at 09:52 UTC | |
by jethro (Monsignor) on Aug 24, 2012 at 10:22 UTC | |
by perlnoobster (Sexton) on Aug 24, 2012 at 10:31 UTC | |
by perlnoobster (Sexton) on Aug 24, 2012 at 10:35 UTC | |
|
Re: Please help me Chomp !
by 2teez (Vicar) on Aug 24, 2012 at 11:27 UTC | |
|
Re: Please help me Chomp !
by Anonymous Monk on Aug 24, 2012 at 12:37 UTC | |
by 2teez (Vicar) on Aug 24, 2012 at 13:02 UTC |