Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#! /usr/bin/perl -w use strict; open (INFILE, $ARGV[0]) or die "unable to open file"; open (OUTFILE, $ARGV[1]) or die "unable to open file"; my $line; my @derivative = replace($line); print "@derivative\n"; sub replace { $line = @_; while (<INFILE>) { $line = $_; chomp ($line); $line =~ s/data//; $line =~ s/=//; $line =~ s/detector//; } return $line; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sub-routines
by jreades (Friar) on Nov 28, 2002 at 12:45 UTC | |
|
Re: sub-routines
by LTjake (Prior) on Nov 28, 2002 at 12:50 UTC | |
|
Re: sub-routines
by Chief of Chaos (Friar) on Nov 28, 2002 at 12:37 UTC | |
by Abigail-II (Bishop) on Nov 28, 2002 at 12:54 UTC |