in reply to Is there a better way of dealing with !~ and "Useless use of not in void context at" warnings?
That construct is tres-weird. I didn't even know it would work. Learn something new. :) I'd say, just use =~ like Dog intended.
Update: the warning in 5.10 is a bit more informative than the one in 5.8 too: "Useless use of negative pattern binding (!~) in void context at -e line 1."perl -wle '$str = "not junk"; $str !~ s/junk//g; print $str' Useless use of not in void context at -e line 1. not perl -wle '$str = "not junk"; $str =~ s/junk//g; print $str' not
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there a better way of dealing with !~ and "Useless use of not in void context at" warnings?
by Plankton (Vicar) on Jan 25, 2009 at 05:53 UTC |