in reply to string gets front truncated

use 5.010; use Switch;

I personally believe that however irrelevant to your actual problem it may be, it's very awkward to use Switch along with 5.10 features, given that the latter provide in particular a true switch construct called nothing less than... given! (And it has always been a bad idea to resort to Switch.pm especially in "production code" since it is based on a source filter instead.)

--
If you can't understand the incipit, then please check the IPB Campaign.