in reply to Split and Pattern Match
I need to split up a string on white space
my $var = "1 word here another word"; my @words = split /\s+/, $var;
Also, once they are split up, how do I remove the white space either before or after the values.
my $var = ' some words '; $var =~ s/\A \s* (.*) \s* \z /$1/x;
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|