in reply to Substitution all parts of an array...
HTH#!/usr/bin/perl -w use strict; open IN, "myfile.txt" || die "Couldn't open myfile: $!\n"; open OUT, ">myresults.txt" || die "Couldn't open output: $!\n"; my @array; while (<IN>) { chomp; $_ =~ s/://g; print OUT $_ ."\n"; } close IN; close OUT; or while(<IN>) { chomp; push(@array, $_); } close IN; foreach my $num (@array) { $num =~ s/://g; print $num ."\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Substitution all parts of an array...
by CukiMnstr (Deacon) on Mar 14, 2003 at 08:21 UTC |