http://qs321.pair.com?node_id=473501


in reply to Re: How do i extract 3 variables from each line in a file, and print them to a new file
in thread How do i extract 3 variables from each line in a file, and print them to a new file

Check this Data.dat contains the input lines. This is working. open(Spooler, "Data.dat") or die "File does not exists\n"; while($spooler=<Spooler>) { #print "$spooler\n"; chomp($spooler); @matches = $spooler =~ /(\d+)ms/g; foreach $a (@matches){ print $a .","; } print "\n"; } Hope it helps!