my $string = EXPR; $string =~ s/^\s+|\s$//g;
(my $string = EXPR) =~ s/^\s+|\s$//g;
sub trim { my ($s) = @_; $s =~ s/^\s+|\s$//g; return $s; } my $string = trim( EXPR );
s/^\s+|\s$//g for my $string = EXPR;
my ($string) = map { my $s = $_; $s =~ s/^\s+|\s$//g; $s } EXPR;
use List::MoreUtils qw( apply ); my $string = apply { s/^\s+|\s$//g } EXPR;
use Algorithm::Loops qw( Filter ); my $string = Filter { s/^\s+|\s$//g } EXPR;
In reply to Re: need to consolidate two lines to one
by ikegami
in thread need to consolidate two lines to one
by chuckd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |