Jim Hansen wrote:
>
> $name = 'HP4000 [PSserver01]';
> if ( $name =~ /[PSserver/ ) {
> next;
> }
> running this straight as a script with the '-d' switch
> or without, it works fine, but if I compile it and run
> it, for some reason it is ignored and I end up with my
> issue. IS there a better way to trap for this?
>
if you want to find a match, and the match includes certain characters
-- e.g., ()[]{}\/$#%*. -- you have to precede these characters with a
backslash. because otherwise they have specific functions defining the
regex.
so the line should be written
if ( $name =~ /\[PSserver/ )
--robert
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs