I can parse for the name ...
You could parse for the name if the code compiled, but it doesn't. After some fixes, you can get the following, but there seems to be another problem.
Why is $2 always empty?c:\@Work\Perl\monks\cbtshare>perl -wMstrict -le "my @file = `cat text.txt`; ;; foreach my $line (@file) { while ($line =~ /name \s+(.*?) \s+(.*?)/mgx) { my $name = $1; print qq{name '$name' other '$2'}; } } " name 'Brian' other '' name 'Andrew' other '' name 'ryan' other ''
Update: Also, is there any point to the /g modifier in the /name \s+(.*?) \s+(.*?)/mgx match?
Give a man a fish: <%-{-{-{-<
In reply to Re: perl parsing
by AnomalousMonk
in thread perl parsing
by cbtshare
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |