Tip: prevent “die” from writing the script name and line number

Normally when you use “die” with a message in perl, the result looks like this:

Can't open registry key Software\MyCompany\MyKey at MyScript.pl line 112

So, next time, just add ‘\n’ to the die message, and you’ll get

Can't open registry key Software\MyCompany\MyKey

Strange… but works!

Advertisements