in reply to Parsing a line of text items
I often use Text::ParseWords for this problem. It has the advantage of being a core module.
Output:use strict; use warnings; use feature "say"; use Text::ParseWords; my $args = '23 45.67 "John Marcus" Surname'; my @parsed = parse_line('\s+', 0, $args); say for @parsed;
23 45.67 John Marcus Surname
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Parsing a line of text items
by mikkoi (Beadle) on Mar 31, 2021 at 11:26 UTC | |
by Bod (Parson) on Apr 04, 2021 at 22:12 UTC | |
Re^2: Parsing a line of text items
by LanX (Saint) on Mar 30, 2021 at 15:58 UTC |
In Section
Seekers of Perl Wisdom