in reply to Re: what is the function should I need to use for trim white spaces ?
in thread what is the function should I need to use for trim white spaces ?

I thought about this too. You're correct that the /g modifier is kind of pointless by itself, but combined with the /m modifier, you get improved functionality (for some definitions of 'improved'):

use strict; use warnings; my $string = " now is the \ntime for all \n good men to co +me \n to the aid\n"; $string =~ s/^\s+//mg; $string =~ s/\s+$//mg; print $string, "\n";

Dave

  • Comment on Re^2: what is the function should I need to use for trim white spaces ?
  • Download Code