Subject: | File: Curses/UI/Language.pm, Line: open(LANG_DATA, "< $l_file") |
Date: | Mon, 13 May 2013 16:14:57 +0200 |
To: | bug-Curses-UI [...] rt.cpan.org |
From: | Kresimir Marzic <kmarzic [...] gmail.com> |
Hi,
I have prepared a simple script using "Curses::UI".
This script is running normally from the command line.
I can create a binary file using PAR:
$ pp --verbose=0 --compress=9 --clean --bundle --par --filter=Bleach
curses11.pl -o curses11.par
$ pp curses11.par -o curses11
In run-time, I am getting the following error:
$ ./curses11
Can't open Curses/UI/Language/english.pm: No such file or directory at
Curses/UI/Language.pm line 96.
I tryed to use the following switches:
-M Curses/UI/Language/english.pm
and
--link=/opt/perl5/cpan/lib/perl5/Curses/UI/Language/english.pm
but it did not help.
The problem is that in file Curses/UI/Language.pm the following is done:
93 # Create a filehandle to the __DATA__ section
94 # of the language package.
95 local *LANG_DATA;
96 open(LANG_DATA, "< $l_file") or die "Can't open $l_file: $!";
This works only if Curses::UI package is installed locally on the machine,
and file Curses/UI/Language/english.pm is available locally.
If package Curses::UI is not installed (and binary file prepared by
PAR::Packer is used), then it is failing.
The solution will be (maybe) to use package Curses::UI::Language::english
from Curses::UI::Language package (not to load the file Curses/UI/Language/
english.pm) directly.
$ cat curses11.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Curses::UI;
my $cui = new Curses::UI ( -color_support => 1 );
my $win = $cui->add(
"win", "Window",
-border => 1,
-y => 1,
-title => "Title",
);
my $tbox = $win->add(
"textbox_0", "TextViewer",
-fg => "white",
-y => 1,
-height => 2,
-border => 1,
-title => "Foo",
-text => "test 123",
);
$cui->set_binding( sub { exit(0); } , "\cC");
$tbox->focus();
$cui->mainloop();
## end
$
I am running the following:
$ perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for
x86_64-linux-thread-multi-ld
Copyright 1987-2012, Larry Wall
Perl may be copied only under the terms of either the Artistic License or
the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
$
$ cpan
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.
cpan[1]> m Curses::UI
Reading '/home/etkkrma/.cpan/Metadata'
Database was generated on Sat, 11 May 2013 23:06:57 GMT
Module id = Curses::UI
CPAN_USERID MDXI (Shawn Boyette <mdxi@cpan.org>)
CPAN_VERSION 0.9609
CPAN_FILE M/MD/MDXI/Curses-UI-0.9609.tar.gz
UPLOAD_DATE 2011-09-02
MANPAGE Curses::UI - A curses based OO user interface framework
INST_FILE /opt/perl5/cpan/lib/perl5/Curses/UI.pm
INST_VERSION 0.9609
cpan[2]> m PAR::Packer
Module id = PAR::Packer
CPAN_USERID RSCHUPP (Roderich Schupp <rschupp@cpan.org>)
CPAN_VERSION 1.014
CPAN_FILE R/RS/RSCHUPP/PAR-Packer-1.014.tar.gz
UPLOAD_DATE 2012-12-21
MANPAGE PAR::Packer - PAR Packager
INST_FILE /opt/perl5/cpan/lib/perl5/PAR/Packer.pm
INST_VERSION 1.014
Best Regards,
--
Krešimir Maržić