in reply to Google has failed me! Using pack and substr for fixed width file output

If you're dealing with a fixed with string, pad it to the desired length, then you won't be outside it
$ perl -Mdiagnostics -e " $foo = sprintf q{%-24s}, 123; substr $foo, 2 +0, 4 , 4444; print $foo; " 123 4444
  • Comment on Re: Using pack and substr for fixed width file output ( substr outside of string )
  • Download Code