To parse a line of data like this, one way to do it is to use split. You would create an array from the output of split as applied to your line of data with the appropriate delimiter. The array would contain each of your successive tokens.
Update: (added code example)
#!/usr/local/bin/perl use strict; use warnings; my $config = 'bar|development|/usr/bar/db|/dbdump'; my @tokens = split /\|/,$config; foreach (@tokens) { print "Token: $_\n"; }
In reply to Re: Parse a pipe-delimited list
by ptum
in thread Parse a pipe-delimited list
by jhs3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |