in reply to Getting utf8::SWASHGET when using MIME::Tools

SWASHNEW & SWASHGET are used by the regexp engine to categorise characters (e.g, is it a letter, punctuation, etc). You should rarely even notice that these functions exist. Perhaps Unicode is broken on your installation. (It ain't particularity awesome in 5.8 anyway.) Consider upgrading to a newer Perl. If you use perlbrew then it's crazily easy to do, and you don't need root.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
  • Comment on Re: Getting utf8::SWASHGET when using MIME::Tools

Replies are listed 'Best First'.
Re^2: Getting utf8::SWASHGET when using MIME::Tools
by nobilis (Initiate) on Jun 05, 2012 at 13:35 UTC

    Thanks you so much, unfortunately as I develop on a company product (that uses perl scripts) that must be compatible with the customer's environment, I don't think it will be possible to upgrade to a later version

    However, I accidentally managed to get that script to work by running it as bash$ perl script.pl instead of bash$ ./script.pl. Really bizarre but I guess something to be aware of :)

    Thanks for providing some background on my issue and I'll keep in mind your points on the way Perl 5.8 handles utf encoding if I come across a more persistent similar issue.

      Check your shebang line then. The perl being specified on the first line of your script (#!/path/to/perl) is not the first one in your path (which perl). Two different interpreters are being used, generating the different results.

      --MidLifeXis

        Wow, spot on! I typed as a shebang the address from bash$ which perl and it ran flawlessly, however using the old shebang (#!/usr/bin/perl) it would give me that issue.

        Thanks very much for that, it kind of slipped my mind that naturally the latest version of perl might not necessarily be found in the usual place that I'd look in, normally I'd leave that to the software running the perl scripts and would just use the standard old when I'm writing them initially. Up until now, I hadn't experienced any issues.

        Thank you all, I think that pretty much concludes it :)