Skip to content

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

December 1, 2014

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

From → Perl Scripting

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: