Hello all
Is there a "not" reversal method for the =~ regex thingy in perl ?
for example, in the snippet below, i have placed a ! in front of the =~ to "not it".. although it quite obviously doesn't work and is just me trying to get across the question in a way that somebody may understand :o
#!/bin/perl -w
my $string = "zfspool/my-server34/john/";
if ( $string !=~ /^.*\/.*\/.*/ ) {
print "ERROR\n";
exit 1;
}
In my code I have to test against it failing rather than succeeding... I appreciate people may respond with "use an else statement for the fail condition" , but i really cant do that, even though it makes perfect sense (long story)
so basically - Can I "NOT" a "=~" ?