Hi,

This is the code:

} elsif (defined($row) && ($row =~ m/\(\*[ ]+\"\@PATH\"[ ]+:=[ 
]+'(\/)?([\*A-Za-z_ ]*(\/)?)+'[ ]\*\)?/)) {
     # PATH  first version:   \(\*[ ]+@PATH[ ]+:=[ ]+'(\\/)?([\*A-Za-z_ 
]*(\\/)?)+'[ ]\*\)?
     
     my @path = split(':=', $row, 2);
     $temppath = $path[1];
     my trimmedpath = split(''', $temppath, 3);
     
     $currentpath = trimmedpath[1];

The last )) ist he closing of the elsif. Sorry. Still no idea.

Tamas Nagy

 
 

-----Ursprüngliche Nachricht-----
Von: Kent Fredric [mailto:kentfred...@gmail.com] 
Gesendet: Dienstag, 7. Juli 2015 19:03
An: Nagy Tamas (TVI-GmbH)
Cc: beginners@perl.org
Betreff: Re: Regexp under PERL

On 8 July 2015 at 04:40, Nagy Tamas (TVI-GmbH) <tamas.n...@tvi-gmbh.de> wrote:
> m/\(\*[ ]+\"\@PATH\"[ ]+:=[ ]+'(\/)?([\*A-Za-z_ ]*(\/)?)+'[ ]\*\)?/))

This is not the exact code you 're using obviously, because the last 2 ")" 
marks are actually outside the regex.

Removing those ))'s makes the regex compile just fine.

So we need "the code", not just the regex.

Ideally, if you can give some perl code that is minimal that replicates your 
problem exactly, then that would be very helpful in us helping you.

Ideally, your code should be reduced as far as possible till you have the least 
possible amount of code that demonstrates your problem.

Additional notes:  Values in @PATH are not relevant to your expression, because 
you explicitly escape the @ to mean a literal @.
If you did not escape it, it would have interpolated.

But even then, I'd still have no idea what you are doing :)

--
Kent

KENTNL - https://metacpan.org/author/KENTNL

Reply via email to