in reply to Running a string through a filter program and recieving the output as a string
What exactly is the tr/sed command doing? I suspect that there's a native perl way to do it (e.g. see perldoc -f tr).open FILE, "<", $file; while(<FILE>); chomp; my @words = split; foreach my $word ( @words ){ # my $newword = `sed $word`; # UPDATE: original lazy typing my $newword = `echo $word | sed`; # UPDATE: more realistic print $newword, "\n"; } } close FILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Running a string through a filter program and recieving the output as a string
by Skeeve (Parson) on Sep 30, 2005 at 05:35 UTC | |
|
Re^2: Running a string through a filter program and recieving the output as a string
by pg (Canon) on Sep 30, 2005 at 03:10 UTC | |
by ikegami (Patriarch) on Sep 30, 2005 at 04:55 UTC | |
by bwgoudey (Sexton) on Sep 30, 2005 at 08:52 UTC | |
by graff (Chancellor) on Sep 30, 2005 at 22:57 UTC |