S
steve
Hi all,
I am currently working on a small script that parses text files and
outputs them in a different format, to be used by another program. I am
constantly removing trailing whitespace like so:
$desc = $line[7]; # @line is an array derived from a line in a CSV file
$desc =~ s/\s+$//g; # Trim trailing whitespace
But this is in two lines. How can I copy the variable and remove
whitespace in one line of code?
I know I don't need to, but I tried and failed and now am curious.
Thanks
steve
I am currently working on a small script that parses text files and
outputs them in a different format, to be used by another program. I am
constantly removing trailing whitespace like so:
$desc = $line[7]; # @line is an array derived from a line in a CSV file
$desc =~ s/\s+$//g; # Trim trailing whitespace
But this is in two lines. How can I copy the variable and remove
whitespace in one line of code?
I know I don't need to, but I tried and failed and now am curious.
Thanks
steve