Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is a really simple question, but I cann't seem to make the translation from sed -> perl? All I'm trying to do is convert:
s/oh/Ohio/g into Perl.
Reading a file containing state names in from the command line. (i.e. perl -w states.pl states.dat >states.db): Here's what I tried:
Thanks, Davidwhile (<>){ s/oh/Ohio/g; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32: sed -Perl
by belg4mit (Prior) on Jan 23, 2002 at 07:03 UTC | |
|
Re: Win32: sed -Perl
by talexb (Chancellor) on Jan 23, 2002 at 08:04 UTC | |
|
Re: Win32: sed -Perl
by trs80 (Priest) on Jan 23, 2002 at 07:22 UTC | |
|
Re: Win32: sed -Perl
by Anonymous Monk on Jan 23, 2002 at 08:08 UTC |