Paul wrote:
> > > if (/^everywhere$|^nowhere$/)
> > > Any help is appreciated.
> >
> > while (<>) { print if /(every|no)where/ }
>
> Are the anchors relevant?
>
> while(<>) { print if /^(every|no)where$/ }
I've no idea. It's just that it seemed unlikely that the line
would contain only that
> > if (/^everywhere$|^nowhere$/)
> > Any help is appreciated.
>
> while (<>) { print if /(every|no)where/ }
Are the anchors relevant?
while(<>) { print if /^(every|no)where$/ }
__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine
Brady Jacksan wrote:
> I am writing a script that will read from a file named myfiles not
> stdin and print the lines containing the following words "everywhere"
> or 'nowhere.
>
>
>
> #!/usr/bin/perl
> #use strict
> while (<>) {
> chomp;
> if (/^everywhere$|^nowhere$/)
> print
>
> }
>
>
> I am writing a script that will read from a file named myfiles not stdin and print
>the lines containing the following words "everywhere" or 'nowhere.
>
>
>
> #!/usr/bin/perl
> #use strict
> while (<>) {
> chomp;
> if (/^everywhere$|^nowhere$/)
> print
>
> }
>
> How do I invoked
I think this is what the OP was looking for:
if(/^(everywhere|nowhere)/){
do something...
}
-Original Message-
From: Toby Stuart [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 9:01 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: Us
> -Original Message-
> From: brady jacksan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 18, 2003 3:50 PM
> To: [EMAIL PROTECTED]
> Subject: Using alternatives and anchors
>
>
>
> I am writing a script that will read from a file named
> myfiles not stdin and print the lines co