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: nuke_view.pl: you can use it to remove all views from a workstation (which may not be available anymore) cleartool lsview -host myHostname -quick | xargs ccperl nuke_view.pl 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

Manual installation of a Perl Module

Use this recipe for manually installing perl modules: tar zxf Digest-SHA1-2.13.tar.gz cd Digest-SHA1-2.13 perl Makefile.PL make make test make install Note that some distributions will have a Build.PL file instead of Makefile.PL. In that case use this recipe: tar zxf … cd … perl Build.PL ./Build ./Build test ./Build install (You may be able to … Read more

How can I guess the encoding of a string in Perl?

To find out in which encoding something unknown uses, you just have to try and look. The modules Encode::Detect and Encode::Guess automate that. (If you have trouble compiling Encode::Detect, try its fork Encode::Detective instead.) use Encode::Detect::Detector; my $unknown = “\x{54}\x{68}\x{69}\x{73}\x{20}\x{79}\x{65}\x{61}\x{72}\x{20}”. “\x{49}\x{20}\x{77}\x{65}\x{6e}\x{74}\x{20}\x{74}\x{6f}\x{20}”. “\x{b1}\x{b1}\x{be}\x{a9}\x{20}\x{50}\x{65}\x{72}\x{6c}\x{20}”. “\x{77}\x{6f}\x{72}\x{6b}\x{73}\x{68}\x{6f}\x{70}\x{2e}”; my $encoding_name = Encode::Detect::Detector::detect($unknown); print $encoding_name; # gb18030 use Encode; my $string … Read more