At 6:11 PM +0800 12/21/09, Albert Q wrote:
2009/12/20 Dr.Ruud <rvtol+use...@isolution.nl <rvtol%2buse...@isolution.nl>>


 > For a multi-line buffer you can do it like this:

 perl -wle '

  my $x = <<"EOT";
    123    456   \t
 abc def
 \t\t\t\t        \t\t\t\t
   ***     ***   ***   \t
 EOT

  s/^\s+//mg, s/\s+$//mg, s/[^\S\n]+/ /g for $x;


I know what it does, but I haven't seen this form of *for* before. Where can
I find the description of this syntax in perldoc?

That is a question about "Perl syntax", so look in "perldoc perlsyn". Search for the section on "Statement Modifiers", and realize that "for" and "foreach" are synonyms.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to