RE: 7.2 ReadLine problems
by Jan Dubois other posts by this author
May 16 2008 10:31AM messages near this date
7.2 ReadLine problems
|
RE: 7.2 ReadLine problems
On Wed, 14 May 2008, Mike Gent wrote:
>
> I've mentioned Term::ReadLine problems on the list before but never
Can you either point me to the message, or post it again if the problem
is still unresolved? Sorry that I missed those!
> received an answer. Well now with Perl 5.10.0 and PDK 7.2, ReadLine is
> completely broken. I'm running this under CentOS 5 Final.
>
> If I take the example code from the docs, it works just fine as a
> standalone script.
>
> use Term::ReadLine;
>
> my $term = new Term::ReadLine 'Simple Perl calc';
> my $prompt = "Enter your arithmetic expression: ";
> my $OUT = $term->OUT || \*STDOUT;
> while ( defined ($_ = $term->readline($prompt)) ) {
> my $res = eval($_);
> warn $@ if $@;
> print $OUT $res, "\n" unless $@;
> $term->addhistory($_) if /\S/;
> }
>
> Once perlapp'd, the first error is:
>
> # ./read
> Can't locate feature.pm in @INC (@INC contains: /tmp) at perlapp line
> 688.
> BEGIN failed--compilation aborted at /</tmp/read>SelfLoader.pm line 3.
> BEGIN failed--compilation aborted at /</tmp/read>SelfLoader.pm line 3.
> BEGIN failed--compilation aborted at
> /</tmp/read>Term/ReadLine/readline.pm line 2289.
>
> Ok, not that I wanted to, but I added >>use feature ":5.10";<< to the
> top. Then this is my problem:
>
> # ./read
> readline doesn't contain an __DATA__ token at
> /</tmp/read>Term/ReadLine/readline.pm line 1438
The problem is with the SelfLoader module. You can edit
lib/Term/ReadLine/readline.pm and comment out 2 lines:
use SelfLoader;
and
__DATA__
and things should work fine again. I think SelfLoader is really just
cargo cult programming; I haven't seen any evidence that it actually
speeds up program startup time in a noticeable way.
You may not need feature.pm; it is implicitly required by the
use 5.009005;
line in SelfLoader.pm.
Cheers,
-Jan
_______________________________________________
PDK mailing list
PDK@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Mike Gent
Jan Dubois
Mike Gent
Jan Dubois
Mike Gent
Paul J Brzezinski
|