On Mon, Sep 9, 2013 at 5:00 AM, Hans Ginzel <h...@matfyz.cz> wrote: > Hello! > > Is there a shorter way to write $a = ! $a, please? > > Something analogous to ++ and -- operators like $a !! or !! $a would negate > the variable $a and return its previous or new value respectively. >
It sounds like what you're requesting, specifically, is to have an operator which modifies $a in place (such as ++ and --). Since Perl doesn't have one of those you need to use an assignment operator. Since you want to return the logical opposite of $a you need a modifying assignment operator. I think you found the shortest possible as long as you remove the extra whitespace. - Casey