develooper Front page | perl.beginners | Postings from December 2002

Re: Help with -e switch

Thread Previous
From:
RMD
Date:
December 24, 2002 07:26
Subject:
Re: Help with -e switch
Message ID:
015301c2ab60$bff43d20$580a020a@rmdlaptop
MERRY CHRISTMAS TO ALL, WITH PEACE AND LOVE.
MY BEST WISHES



Ricardo Derbes
Altec SE
AlbarracĂ­n 157 - San Carlos de Bariloche
+54-2944-426892
rmd@altec.com.ar
----- Original Message -----
From: "Paul Johnson" <paul@pjcj.net>
To: "Kieren Diment" <kieren@diment.org>
Cc: "Perl Beginners" <beginners@perl.org>
Sent: Tuesday, December 24, 2002 12:17 PM
Subject: Re: Help with -e switch


> On Tue, Dec 24, 2002 at 08:38:35AM +1100, Kieren Diment wrote:
>
> > I'd like to know if it's possible to combine the -i and -e switches.
> > I have the following script, and I'd like not to have to go to the
> > bother of firing up an editor, chmod +x ing it and co:
> >
> > #!/usr/bin/perl -w
> > open FILE, $ARGV[0];
> > while (<FILE>)
> >        {
> > print if (/(^org_name)|(^email)|(^$)/);
> >        }
>
> perl -n00i.bak -e 'print if /^(?:org_name|email)/' file
>
> > This script is for validating some paragraph delimeted data files for
> > what it's worth...
>
> --
> Paul Johnson - paul@pjcj.net
> http://www.pjcj.net
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About