Is there such thing as "Perfect Decompiler"?
The original source is -- in some languages -- unrecoverable. A version of the source can be constructed, but it will lack meaningful names for variables. It will also lack comments and may have inline code expansions that are confusingly repetitive.
Note that optimizing compilers can make the recovered source pretty obscure-looking.
In other languages, there is enough debugging information that a reasonably readable version of the source can be recovered.
[perfect] mean the original source files with all the variable names/macros/functions/classes/if possible comments in the respective headers and source files used to get the binary)
Never. Macros from the preprocessor are not part of the source, and are always lost forever.
"if possible comments" doesn't make much sense. I'll assume you mean that you want the comments. They're generally gone forever, also.
You can, however, get binary back from stuff that's missing macros and comments. So your definition of "perfect" is inconsistent.
binaries safe from reverse engineering?
No.
What are some of the best practices used to prevent reverse engineering of software?
Offer new versions so quickly that there's no value in reverse engineering the previous version.
Is it a major concern?
Only to lawyers.
Also is obfuscation/file permissions the only way to prevent unauthorized hacks on scripts?
What's an "unauthorized hack"? Indeed, what's to you mean by a "hack" on a script?
If you want to mess with a script, you just mess with it. Unless, of course, it's on a web server, and you're not. Then you don't have access to the script, just the web page presented by the script.
From your comments, it appears that you're looking for a way to license a library that you wrote so you can use it in a proprietary project but still have the license be GPL-compatible.
First off, this is a bit nonsensical. The GPL carries a whole lot of anti-proprietary-software ideological baggage with it. It's designed that way; the whole point of it is to make it as difficult as possible to integrate GPL or LGPL code into a proprietary project.
However, licenses are for other people. They don't apply to the copyright owner, which is you, the person who wrote the library. You can use your own code however you want to, regardless of the terms of the license you put on it. So you can make it GPL or LGPL and still use it in your proprietary project and you'll be fine.
On the other hand, if you want people in general to be able to use it in GPL projects or also to be able to use it in proprietary projects but still be required to publish the source to whatever changes they make, try dual-licensing it as (L)GPL and MPL.
Best Answer
GPL requires that you make any modifications to the GPL'ed work, or any derived work, available as GPL.
GPL v3 clarifies this to say you can't take GPL'ed work, modify it and make the source available but ban someone from actually using it - by patents or code signing etc.
LGPL allows you to link the LGPL'ed code to your propriety code without releasing your own code. But you have to allow someone to swap the LGPL'ed code for another version so that they can modify it.
If your app checked for a particular LGPL library (by code signing etc) then it would not be acceptable - somebody would be unable to take the LGPL lib that they had written and change it while continuing to use it with your app. You are taking their work and not allowing them the freedom they demanded in return.
You can of course do anything you want with your app's code - you just have to let them change their work in the LGPL lib