Examples


$_ = "Input data    may have     extra whitespace.";


 s/\s+/ /g; # Now it says "Input data may have extra whitespace."
  s/^\s+//; # Replace leading whitespace with nothing
  s/\s+$//;
 # Replace trailing whitespace with nothing
  
  


    
   

Comments