LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2010, 07:36 PM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Perl can't find readonly.pm


I am following a gtk2-perl tutorial, so I wrote the test program, installed gtk2-perl, and got this error:

Code:
Can't locate readonly.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.1 /usr/share/perl5/site_perl/5.10.1 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl /usr/lib/perl5/current /usr/lib/perl5/site_perl/current .) at ./test.pl line 7.
BEGIN failed--compilation aborted at ./test.pl line 7.
I googled readonly.pm, and figured out it's part of some Readonly module.

But how do I install it?

Preferably using the Arch package manager?
 
Old 05-18-2010, 07:38 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
I am following a gtk2-perl tutorial, so I wrote the test program, installed gtk2-perl, and got this error:

Code:
Can't locate readonly.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.1 /usr/share/perl5/site_perl/5.10.1 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl /usr/lib/perl5/current /usr/lib/perl5/site_perl/current .) at ./test.pl line 7.
BEGIN failed--compilation aborted at ./test.pl line 7.
I googled readonly.pm, and figured out it's part of some Readonly module.

But how do I install it?

Preferably using the Arch package manager?
Publish the source code you've tried to compile.
 
Old 05-18-2010, 07:40 PM   #3
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quick CPAN search shows:

http://search.cpan.org/~roode/Readonly-1.03/Readonly.pm
.

I.e. capital R in "readonly". Is this the module ? Is small rather than capital 'R' the problem ?
 
1 members found this post helpful.
Old 05-18-2010, 07:46 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Sergei Steshenko View Post
Quick CPAN search shows:

http://search.cpan.org/~roode/Readonly-1.03/Readonly.pm
.

I.e. capital R in "readonly". Is this the module ? Is small rather than capital 'R' the problem ?
OK, how do I install it?
 
Old 05-18-2010, 07:55 PM   #5
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
OK, how do I install it?
The generic way is using 'cpan' utility which comes with Perl. I.e. you begin from

perldoc cpan
.

Since ArchLinux is a build from source distro, probably using 'cpan' is the ArchLinux way.

Running 'cpan' for the first time takes time - it needs to download some data common for all the modules, to create caches, etc.
 
1 members found this post helpful.
Old 05-18-2010, 08:04 PM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
In cpan, I typed:

Code:
install Readonly
but my code still doesn't work!

Code:
#!/usr/bin/perl

use warnings;
use strict;

use Gtk2 '-init';
use readonly true => 1;
use readonly false => 0;

my $window = Gtk2::Window->new;
$window->set_title('Gtk2-Perl Test');
$window->signal_connect(delete_event => sub { Gtk2->main_quit; true });

my $button = Gtk2::Button->new('Click Me');
$button->signal_connect(clicked => sub { print "Pressed!\n"; });
$window->add($button);

$window->show_all;
Gtk2->main;
 
Old 05-18-2010, 08:29 PM   #7
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
In cpan, I typed:

Code:
install Readonly
but my code still doesn't work!

Code:
#!/usr/bin/perl

use warnings;
use strict;

use Gtk2 '-init';
use readonly true => 1;
use readonly false => 0;

my $window = Gtk2::Window->new;
$window->set_title('Gtk2-Perl Test');
$window->signal_connect(delete_event => sub { Gtk2->main_quit; true });

my $button = Gtk2::Button->new('Click Me');
$button->signal_connect(clicked => sub { print "Pressed!\n"; });
$window->add($button);

$window->show_all;
Gtk2->main;
You appear to have great difficulties differentiating small and capital 'R' letters.
 
1 members found this post helpful.
Old 05-18-2010, 09:04 PM   #8
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
+1 to Sergei's observation that you have installed Readonly but only referred to readonly in your script.
 
Old 05-18-2010, 09:34 PM   #9
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by grail View Post
+1 to Sergei's observation that you have installed Readonly but only referred to readonly in your script.
And the relationship between module and file names is mandated by Perl documentation (perldoc perlmod).
 
Old 05-19-2010, 02:13 AM   #10
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
You picked this script from somewhere?

If the intention is to make true and false as 1 and 0 respectively.
Please have a look at

Code:
use constant true => 1
use constant false => 0
And in case Readonly is the only option. Please see the usage for Readonly.pm on CPAN
 
1 members found this post helpful.
Old 05-19-2010, 07:10 AM   #11
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Sergei Steshenko View Post
You appear to have great difficulties differentiating small and capital 'R' letters.
I didn't know that that had to do with the Readonly module.

It's just that in the tutorial I was following, it (appearently wrongly) said "readonly" (beginning with a lowercase letter) in the code.

Quote:
Originally Posted by PMP View Post
You picked this script from somewhere?

If the intention is to make true and false as 1 and 0 respectively.
Please have a look at

Code:
use constant true => 1
use constant false => 0
That works!

EDIT: This is the tutorial I was following:

http://www.google.com/url?sa=t&sourc...dfloJ6GKgbi73A

Last edited by MTK358; 05-19-2010 at 07:13 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
-bash: HISTSIZE: readonly variable -bash: HISTFILESIZE: readonly variable deathsfriend99 Linux - Newbie 4 12-08-2009 12:51 PM
Trying to find libmail-mbox-messageparser-perl and libmailtools-perl for Fedora 11 almac58 Linux - Software 4 11-18-2009 03:17 AM
Difference between Readonly Filesystem and Mounting filesystem as readonly bluepenguine Linux - Newbie 1 06-19-2009 01:26 AM
Help me find a Perl script rumblestrut Linux - Server 1 05-25-2007 09:46 AM
Where Can I Find perl-base? JLuv3k7 Fedora 4 04-01-2006 04:57 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration