peacemaker1820 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks.
I would like to trim some words in my data file from the leading and trailing spaces. Let's say if I have:
This will certainly solve my problem, but I was wandering if there is a built in SUB for strings in Perl that does the same job?
Thanks.
I would like to trim some words in my data file from the leading and trailing spaces. Let's say if I have:
after doing this,$temp = " Hello ";
that will drop all the leading and trailing spaces$temp =~ s/^\s+//;
This will certainly solve my problem, but I was wandering if there is a built in SUB for strings in Perl that does the same job?
Thanks.
Back to
Seekers of Perl Wisdom