Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: eval NoOp on cmd.exe line expr

by kennethk (Abbot)
on Mar 13, 2017 at 23:36 UTC ( #1184502=note: print w/replies, xml ) Need Help??

in reply to eval NoOp on cmd.exe line expr

rename ($was, $_) unless $was = $_;
will always evaluate true because because you are using the assignment operator (=) not the string equivalence operator (eq). You should have gotten a warning about that one running the posted code.

Reading Basic debugging checklist may be helpful. An essential element is use print/say and/or Data::Dumper to make sure variables contain what you think they should.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1184502]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2021-10-19 22:51 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (77 votes). Check out past polls.