Re: Searching in a line
- From: lerameur <lerameur@xxxxxxxxx>
- Date: Thu, 30 Aug 2007 14:01:29 -0700
On Aug 30, 4:57 pm, "Jürgen Exner" <jurge...@xxxxxxxxxxx> wrote:
lerameur wrote:
On Aug 30, 4:39 pm, "Jürgen Exner" <jurge...@xxxxxxxxxxx> wrote:
lerameur wrote:
I wrote this now: If it finds the work beth in the line, then is
splits the line. otherwise print an error.
Now there is beth in the file ( i added it) but the program always
skips to the else statement, end prints it twice.
How should I modify the search if (/^beth/) ?
while ($data=<$fh>) {
Here you are reading each line into $data
if (/beth/) { #matches only if beth is in line
and here you are matching /beth/ against the default $_.
Is that what you meant to do?
jue
so you are saying this is no good:
$data=<$fh>
No. I am saying you should make up your mind if you want to use the default
$_ or your own $data. Either is ok, but not both.
I do not make difference between the two. This is new to me.
I guess I will sue the default one.
k
.
- Follow-Ups:
- Re: Searching in a line
- From: Jürgen Exner
- Re: Searching in a line
- References:
- Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Jürgen Exner
- Re: Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Peter Makholm
- Re: Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Jürgen Exner
- Re: Searching in a line
- From: lerameur
- Re: Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Uri Guttman
- Re: Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Jürgen Exner
- Re: Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Jürgen Exner
- Searching in a line
- Prev by Date: Re: Searching in a line
- Next by Date: Re: How to make this case insenstive
- Previous by thread: Re: Searching in a line
- Next by thread: Re: Searching in a line
- Index(es):
Relevant Pages
|