Re: Using alternatives and anchors

2003-02-18 Thread Rob Dixon
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

Re: Using alternatives and anchors

2003-02-18 Thread Paul
> > 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

Re: Using alternatives and anchors

2003-02-18 Thread Rob Dixon
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 > > } > >

Re: Using alternatives and anchors

2003-02-18 Thread Jack Chen
> 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

RE: Using alternatives and anchors

2003-02-17 Thread Timothy Johnson
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

RE: Using alternatives and anchors

2003-02-17 Thread Toby Stuart
> -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