Sorry, pasted the wrong statement.#!/usr/local/bin/perl -w use strict; use warnings; open (INFILE, "<$ARGV[0]") or die "unable to open file"; open (OUTFILE, ">$ARGV[1]") or die "unable to open file"; while (<INFILE>) { my $line = $_; print OUTFILE replace($line); } sub replace { my $line = shift; chomp ($line); $line =~ s/data//; $line =~ s/=//; $line =~ s/detector//; return $line."\n"; } close(INFILE); close(OUTFILE);
In reply to Re: sub-routines
by Chief of Chaos
in thread sub-routines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |