top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Is there a shorter way to write $a = ! $a in perl?

+1 vote
447 views

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.

posted Sep 10, 2013 by Dewang Chaudhary

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
No. there is no shorter way

1 Answer

0 votes

$a ne $a or whatever you are using, also shorter way to compare variables in perl

answer Jan 23, 2014 by Amit Kumar Pandey
Similar Questions
0 votes

As I understand, Perl has excellent report-generation capabilities. By using formats, we can actually visualize how our output will look because the definition of a format in Perl is very similar to what you see on the output. Is there any way we to convert these formats into HTML reports? My goal is to create good looking HTML reports. Please suggest/advice.

+1 vote

I have a Linux machine and windows machine, I need to run a GUI of Linux machine on the windows machine.
I don't want to use putty or any other software. I have to use any Perl modules to achieve this please help.

0 votes

How can write a python script which will execute some perl scripts in a gui and shouldn't be post processed....?

0 votes
sub myfunc {
 my @x=(1,2,3);
 return @x;
}

or

sub myfunc {
 my @x=(1,2,3);
 return [@x];
}

which one is the better way to return the list content? And if the method is an instance method?

+2 votes

I have been writing a perl script that uses the Net::DNS modules. After banging my head, so to speak for many days, I asked on a DNS-related discussion list for help in figuring out why name server updates had started always failing with errors about not auth and BADKEY when I seem to recall that they had once worked. That was when someone told me that Net::DNS0.73 has a bug in it. The solution was to either downgrade to the previous version of Net:DNS or apply a release candidate which reportedly does not have the bug.

I didn't know for sure which version we had so I put a print statement in the code to cause it to print out the version number and sure enough, we have the buggy version.

Simply, what is the easiest way to downgrade so that we don't break anything else?

...