>
> Your data is perfect for the paragraph mode* of readline:
>
Ahh, I forgot about paragraph mode.
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my $user = shift;
> my $regex = qr/\A$user/;
>
> local $/ = '';
> while (my $record = <DATA>) {
> chomp $record;
> if ($record =~ /$regex/) {
> print "$record\n";
> last;
This didn't work at first. Then I realized it was because the file's
lines were terminated with "\r\n" instead of just "\n". Removing the
"\r" fixed the problem and it worked.
thanks for the help.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/