PerlPoint-Package
view release on metacpan or search on metacpan
lib/PerlPoint/Parser.pm view on Meta::CPAN
# update statistics
$statistics{cache}[0]++;
# well, switch to paragraph mode (depending on the paragraph type)!
if ($parser->{USER}->{INPUT}=~/^<<(\w+)/)
{$/="\n$1";}
elsif ($parser->{USER}->{INPUT}=~/^(?<!\\)\\TABLE/i)
{$/="\n\\END_TABLE";}
else
{$/='';}
# store current position
my $lexerPosition=tell($inHandle);
# read *current* paragraph completely (take care - we may have read it completely yet!)
seek($inHandle, $lexerPosition-length($parser->{USER}->{INPUT}), 0) unless $parser->{USER}->{INPUT}=~/^<<(\w+)/ or $parser->{USER}->{INPUT}=~/^(?<!\\)\\TABLE/i;
my $paragraph=<$inHandle>;
$paragraph=join('', $parser->{USER}->{INPUT}, $paragraph) if $parser->{USER}->{INPUT}=~/^<<(\w+)/ or $parser->{USER}->{INPUT}=~/^(?<!\\)\\TABLE/i;
# count the lines in the paragraph read
ppParser.yp view on Meta::CPAN
# update statistics
$statistics{cache}[0]++;
# well, switch to paragraph mode (depending on the paragraph type)!
if ($parser->{USER}->{INPUT}=~/^<<(\w+)/)
{$/="\n$1";}
elsif ($parser->{USER}->{INPUT}=~/^(?<!\\)\\TABLE/i)
{$/="\n\\END_TABLE";}
else
{$/='';}
# store current position
my $lexerPosition=tell($inHandle);
# read *current* paragraph completely (take care - we may have read it completely yet!)
seek($inHandle, $lexerPosition-length($parser->{USER}->{INPUT}), 0) unless $parser->{USER}->{INPUT}=~/^<<(\w+)/ or $parser->{USER}->{INPUT}=~/^(?<!\\)\\TABLE/i;
my $paragraph=<$inHandle>;
$paragraph=join('', $parser->{USER}->{INPUT}, $paragraph) if $parser->{USER}->{INPUT}=~/^<<(\w+)/ or $parser->{USER}->{INPUT}=~/^(?<!\\)\\TABLE/i;
# count the lines in the paragraph read
( run in 0.541 second using v1.01-cache-2.11-cpan-49f99fa48dc )