On Dec 17, Jan Eden said:
>thanks a lot for all the responses. Jeff's explanation of the snippet I
>mentioned in my original message did the trick. The hash-based solution
>is much faster now, although the first attempt (using multiple
>replacements on standard input) is still the fastest.
Well,
Hi all,
thanks a lot for all the responses. Jeff's explanation of the snippet I mentioned in
my original message did the trick. The hash-based solution is much faster now,
although the first attempt (using multiple replacements on standard input) is still
the fastest.
To answer John's question
On Dec 16, Jan Eden said:
>>#!perl
>>
>>%enctabelle = (...);
>>
>>my $re = '(' . join('|', map quotemeta($_), keys %enctabelle) . ')';
>>$re = qr/$re/;
>>
>>while (<>) {
>> s/$re/$enctabelle{$1}/g;
>> print;
>>}
Let me explain this for you, and fix it, too.
# this produces 'key1|key2|key3|..
Jan Eden wrote:
>
> Hi,
Hello,
> sorry for the lengthy post.
>
> I recently wrote a Perl script to convert 8-bit characters to LaTeX
> commands. The first version (which works just fine) looks like this
> (the ... indicates more lines to follow):
Your regular expressions look like they are lon
From: Jan Eden <[EMAIL PROTECTED]>
> I recently wrote a Perl script to convert 8-bit characters to LaTeX
> commands. The first version (which works just fine) looks like this
> (the ... indicates more lines to follow):
>
> >#!/usr/bin/perl -pw
> >
> >s/âÇ?/{\\glqq}/g;
> >s/âÇ?/{\\grqq}/g;
> >s/Ăí/\
Hi,
sorry for the lengthy post.
I recently wrote a Perl script to convert 8-bit characters to LaTeX commands. The
first version (which works just fine) looks like this (the ... indicates more lines to
follow):
>#!/usr/bin/perl -pw
>
>s/â/{\\glqq}/g;
>s/â/{\\grqq}/g;
>s/Ã/\\'{a}/g;
>s/Ã/\\`{a}/