in reply to No matching

As already pointed out it will help if you gave us the input.

In general however I find it very helpful if I start building regular expressions in parts.

So instead of writing it all out maybe you can start with:
my $prefixSysDescr = "system.sysDescr"; if( $input_var =~ /$prefixSysDescr/ ) { print "Match!\n"; }
Once you are sure that that part works you can then start adding more of what you want matched.

That way you get a clearer idea of where your RegEx is failing - Which I believe is the problem here.


Replies are listed 'Best First'.
Re^2: No matching
by o_chfa (Acolyte) on Sep 03, 2009 at 09:11 UTC

    Your advice starting with smaller parts of the string failed too. So I assume your thinking of RegEx failing was right.
    By accident I looked at the 1st line of my script and discoverd a fishy looking shebang (the exclamation mark/point was missing and a strange path). I discovered the path to perl with

    which perl

    After fixing the shebang with exclamation mark/point and the discovered path and implementing "quotemeta" I restarted the script successfuly. Thx for the ideas