princepawn has asked for the wisdom of the Perl Monks concerning the following question:
is failing when I use the following code to parse the file:NYCERS NYC Employees' Retirement System C
my $fh = new FileHandle "$dir/$file"; defined $fh or die "couldnt open $file: $!"; <$fh>; my %line; while (<$fh>) { my @line = map { s/^\s+//; s/\s+$//; s/\x0d//; $_; } ( quotewords("\t", 0, $_) ) ; $line[$FULL_NAME] =~ s<([^\x20\x21\x23\x27-\x3b\x3d\x3F-\x5B\x5D-\ +x7E])> <'&#'.(ord($1)).';'>seg; $line{$line[$ACRONYM]} = { type => $line[$TYPE], full_name => $line[$FULL_NAME] } ; } \%line;
And I believe it has to do with the single apostrophe on the line... any help is appreciated.
Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text::Parsewords and lines with a single quote
by traveler (Parson) on Nov 25, 2002 at 16:05 UTC | |
|
Re: Text::Parsewords and lines with a single quote
by broquaint (Abbot) on Nov 25, 2002 at 15:46 UTC |