in reply to What does &! mean?

Hi Sydney04,
The &! is not that clear but is saying that you also need a second condition that is not true. A better way of writing it is...(see note below, depending on whether you are wanting two conditions or do a logical operation).
if ( (condition1) && (!condition2) ) { }
so in your case you want $key to begin with "PERIOD_END" and you want $budget data not to be set.
Try runing the following and commenting and uncommeting the line that defines $budgetdata.. then rewrite it to the if statement I did above if you like...
#!/usr/bin/perl my $key = "PERIODEND TODAY"; #my $budgetdata = "lots of numbers"; print "Hello\n"; if ( $key =~ /^PERIODEND/ &! $budgetdata) { print "Got here\n"; } else { print "Sorry =(\n"; }

Update: I forgot to specify that I used '&&' instead of '&', with the difference being that the '&' is a bitwise operator that will do a NOT AND or NAND with the first condition as opposed to '&&' that requires two both condition 1 and condition 2. I was just splitting it.. that was to simplify...As gam3 points out though, the format of the if is probably supposed to be of format mentioned as bit twiddling on strings is not all that common, they are more likely just checking that you just don't have the budget data.


Regards Paul