Perl Dereferencing Syntax

Whenever you can use the name of a variable, you can use a block that evaluates to a reference instead. For example, the following are valid syntax for specifying an array: @NAME # If you have the name e.g. @array @BLOCK # If you have a reference e.g. @{ $ref } This is the “circumfix … Read more

How to pass a variable from a child process (fork by Parallel::ForkManager)?

I think you’re misunderstanding what a fork does. When you successfully fork, you’re creating a subprocess, independent from the process you started with, to continue doing work. Because it’s a separate process, it has its own memory, variables, etc., even though some of these started out as copies from the parent process. So you’re setting … Read more

Delete ClearCase Views Script

I mentioned a script a little bit verbose, but which won’t remove any local storage and won’t either clean the CCRC session.dat: you can use it to remove all views from a workstation (which may not be available anymore) cleartool lsview -host myHostname -quick | xargs ccperl The -quick option is very important … Read more

ImageMagick Command-Line Option Order (and Categories of Command-Line Parameters)

Unfortunately, the accepted answer to this question is not yet complete… 🙂 Three (major) classes of parameters Assuming, your ImageMagick version is a recent one, here is an important amendment to it: you should differentiate between 3 major classes of command line parameters: Image Settings Image Operators Image Sequence Operators   These three classes do … Read more

Using Encode::encode with “utf8”

On Read,Invalid encoding otherthan sequence length On Read,Outside of Unicode,Unicode nonchar, orUnicode surrogate On Write,Outside of Unicode,Unicode nonchar, orUnicode surrogate :encoding(UTF-8) Warns and Replaces Warns and Replaces Warns and Replaces :encoding(utf8) Warns and Replaces Accepts Warns and Outputs :utf8 Corrupt scalar Accepts Warns and Outputs (This is the state in Perl 5.26.) Note that :encoding(UTF-8) … Read more