under_score has asked for the wisdom of the Perl Monks concerning the following question:
I figured out open (OUT, ">out.txt") but I'm stuck on how to pass the data into the file.Thank you for answering such a rookie question...#!/usr/bin/perl -w $file = "in.txt"; open (FILE, "$file"); my @results; while (<FILE>) { if (/^N\d+\s+\*(.*)/) { push @results, "!$1"; } else { push @results, /[ABC]([-+]*[\d\.]+)/g; } } print join ' ',@results;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating new file
by dws (Chancellor) on Jul 23, 2002 at 23:21 UTC | |
|
Re: Creating new file
by DamnDirtyApe (Curate) on Jul 24, 2002 at 05:29 UTC |