On 6 Aug., 14:05, [EMAIL PROTECTED] (Rob Coops) wrote:
> You are almost right, since it prints all lines all lines match.
>
> Could you explain what it is that you are trying to match, that way people
> might be able to help getting the regex right.
i forgot about this thread, since it took so lon
On 6 Aug., 16:45, [EMAIL PROTECTED] (Yitzle) wrote:
> On Wed, Aug 6, 2008 at 4:29 AM, Kenneth Brun Nielsen
> <[EMAIL PROTECTED]> wrote:
> > Within a perl program, I want to go to a particular mode when a
> > keyword is found. The keyword is a regexp.
>
> > E.g.
> > #!/usr/bin/perl -w
> > open FILE
On Wed, Aug 6, 2008 at 4:29 AM, Kenneth Brun Nielsen
<[EMAIL PROTECTED]> wrote:
> Within a perl program, I want to go to a particular mode when a
> keyword is found. The keyword is a regexp.
>
> E.g.
> #!/usr/bin/perl -w
> open FILEHANDLE, "soatest.soa";
> while (){
>if (/^\*| XI/) {
>p
Kenneth Brun Nielsen wrote:
>
> I need to make a conditional on a regular expression match. How can I
> do that?
>
> E.g. in the code below, it prints all lines, and NOT only the ones
> that match. How can I make the boolean test correct?
>
> #!/usr/bin/perl -w
> open FILEHANDLE, "soatest.soa";
>
You are almost right, since it prints all lines all lines match.
Could you explain what it is that you are trying to match, that way people
might be able to help getting the regex right.
The way you are looking at the file line by line is valid and if your regex
matches only a few lines it will o
I need to make a conditional on a regular expression match. How can I
do that?
E.g. in the code below, it prints all lines, and NOT only the ones
that match. How can I make the boolean test correct?
#!/usr/bin/perl -w
open FILEHANDLE, "soatest.soa";
while (){
if (/^\*| XI/) {
print "m
Within a perl program, I want to go to a particular mode when a
keyword is found. The keyword is a regexp.
E.g.
#!/usr/bin/perl -w
open FILEHANDLE, "soatest.soa";
while (){
if (/^\*| XI/) {
print "match in line: $.\n";
}
}
This conditional seems to be true for all lines (although