Help for this page

Select Code to Download


  1. or download this
    /\A\s*(.*?)\s*\z/
    
  2. or download this
    say for map { (/\A\s*(.*?)\s*\z/) } split /\|/, $str;
    
  3. or download this
    say for map { clean($_) } split /\|/, $str;
    sub clean { ($_[0] =~ /\A\s*(.*?)\s*\z/)[0] }
    
  4. or download this
    $ perl -Mstrict -Mwarnings -E '
    my $str = " \t item0 with leading whitespace |item1  | item2| item3 
    ...
    <item4>
    <>
    <itemN with trailing whitespace>