I think the optimal way would be:

   my $s  = 'yada yada';

That way the program won't have to trim the whitespace off the string every
time it is run.

In the more general case, I might do it something like:

  my $s = something-returning-a-string().trim;

But I don't think that there really is a preferred or best practice way.
This is Perl, there is more than one way to do it.

On Wed, Aug 5, 2015 at 4:16 PM, Tom Browder <tom.brow...@gmail.com> wrote:

> On Wed, Aug 5, 2015 at 6:00 PM, Brandon Allbery <allber...@gmail.com>
> wrote:
> > I don't know what you mean by "optimal" there, but you can say something
> > like
> >
> >     $s .= trim;
>
> I really meant the preferred or best practice way.
>
> Thanks, Brandon!
>
> -Tom
>

Reply via email to