Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want to get rid of the colons. What I've done is:1:5 2:5 3:5 4:5 5:5
---This will yeild "1"open (IN, "myfile.txt") || die "couldn't open $!\n"; my @array; while ( $line = <IN> ) { push @array, (split /\s+, $line )[0]; } foreach $number(@array) { $number = ($number =~ s/://g); } print "@a[0]\n"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Substitution all parts of an array...
by pfaut (Priest) on Mar 14, 2003 at 00:01 UTC | |
by Anonymous Monk on Mar 14, 2003 at 00:36 UTC | |
Re: Substitution all parts of an array...
by greenFox (Vicar) on Mar 14, 2003 at 01:47 UTC | |
Re: Substitution all parts of an array...
by Ineffectual (Scribe) on Mar 14, 2003 at 00:33 UTC | |
by CukiMnstr (Deacon) on Mar 14, 2003 at 08:21 UTC |