in reply to TRIM in Perl?

Since with all the suggestions here we're just eliminating all spaces in the string, wouldn't simple transliteration ($temp =~ tr/ //d;) be faster/simpler?

Update: EEK! *bangs head* Nevermind, I retract that, $temp =~ s/^\s+|\s$/ would be the best way to do it.

Replies are listed 'Best First'.
Re^2: TRIM in Perl?
by Aristotle (Chancellor) on Sep 10, 2002 at 16:45 UTC
    Where did you see "all suggestions [..] just eliminating all spaces"? None of them do.

    Makeshifts last the longest.