Of course,you don't show any representative data, but if you're reading data in $/ = ""; paragraph or paragrep (another search term) mode, it's likely there are one or more embedded newlines in the strings you're getting from input. Then you should be aware that the regex metacharacter/operator ^ (carat) behaves differently according to the /m regex modifier (and likewise $). See ^ (and $) and /m in perlre and perlretut.
c:\@Work\Perl\monks>perl -wMstrict -le "my $s = qq{foo fee fie\nbar bell\nbaz biz boz}; print qq{[[$s]]}; print '--------'; ;; my ($x) = $s =~ m{ ^ foo (.+) }x; my ($y) = $s =~ m{ ^ bar (.+) }x; my ($z) = $s =~ m{ ^ baz (.+) }x; print qq{'$x' '$y' '$z'}; print '--------'; ;; ($x) = $s =~ m{ ^ foo (.+) }xm; ($y) = $s =~ m{ ^ bar (.+) }xm; ($z) = $s =~ m{ ^ baz (.+) }xm; print qq{'$x' '$y' '$z'}; " [[foo fee fie bar bell baz biz boz]] -------- Use of uninitialized value $y in concatenation (.) or string at -e lin +e 1. Use of uninitialized value $z in concatenation (.) or string at -e lin +e 1. ' fee fie' '' '' -------- ' fee fie' ' bell' ' biz boz'
In reply to Re: read file a paragraph at a time and return paragraph OR get specific data from paragraph
by AnomalousMonk
in thread read file a paragraph at a time and return paragraph OR get specific data from paragraph
by james28909
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |