On redhat, different users = different @INC




We have RedHat 4EL and perl 5.8.5. Per a user's request I installed
Date:Simple, using perl -MCPAN -e shell
as the root user.
Now root can find Date::Simple, but other users cannot. They do not
want to include a lib statement in their scripts or invoke with a -I.
The @INC libraries are close, but not identical.

Does anyone know how to correct or resolve this
Any suggestions would be appreciated.

Best regards,
Russ

Posted On: Friday 26th of October 2012 12:05:45 AM Total Views:  90
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




FAQ 6.3 How can I pull out lines between two patterns that are themselves on different lines?

This is an excerpt from the latest version perlfaq6.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 6.3: How can I pull out lines between two patterns that are themselves on different lines You can use Perl's somewhat exotic ".." operator (documented in perlop): perl -ne 'print if /START/ .. /END/' file1 file2 ... If you wanted text and not lines, you would use perl -0777 -ne 'print "$1\n" while /START(.*)END/gs' file1 file2 ... But if you want nested occurrences of "START" through "END", you'll run up against the problem described in the question in this section on matching balanced text. Here's another example of using "..": while () { $in_header = 1 .. /^$/; $in_body = /^$/ .. eof; # now choose between them } continue { $. = 0 if eof; # fix $. } -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

148

Posted on:

Wednesday 3rd October 2012
View Replies!

FAQ 7.7 Why do Perl operators have different precedence than C operators?

This is an excerpt from the latest version perlfaq7.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 7.7: Why do Perl operators have different precedence than C operators Actually, they don't. C operators that Perl copies have the same precedence in Perl as they do in C. The problem is with operators that C doesn't have, especially functions that give a list context to everything on their right, eg. print, chmod, exec, and so on. Such functions are called "list operators" and appear as such in the precedence table in perlop. A common mistake is to write: unlink $file || die "snafu"; This gets interpreted as: unlink ($file || die "snafu"); To avoid this problem, either put in extra parentheses or use the super low precedence "or" operator: (unlink $file) || die "snafu"; unlink $file or die "snafu"; The "English" operators ("and", "or", "xor", and "not") deliberately have precedence lower than that of list operators for just such situations as the one above. Another operator with surprising precedence is exponentiation. It binds more tightly even than unary minus, making "-2**2" product a negative not a positive four. It is also right-associating, meaning that "2**3**2" is two raised to the ninth power, not eight squared. Although it has the same precedence as in C, Perl's ":" operator produces an lvalue. This assigns $x to either $a or $b, depending on the trueness of $maybe: ($maybe $a : $b) = $x; -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

127

Posted on:

Tuesday 16th October 2012
View Replies!

FAQ 6.3 How can I pull out lines between two patterns that are themselves on different lines?

This is an excerpt from the latest version perlfaq6.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 6.3: How can I pull out lines between two patterns that are themselves on different lines You can use Perl's somewhat exotic ".." operator (documented in perlop): perl -ne 'print if /START/ .. /END/' file1 file2 ... If you wanted text and not lines, you would use perl -0777 -ne 'print "$1\n" while /START(.*)END/gs' file1 file2 ... But if you want nested occurrences of "START" through "END", you'll run up against the problem described in the question in this section on matching balanced text. Here's another example of using "..": while () { $in_header = 1 .. /^$/; $in_body = /^$/ .. eof; # now choose between them } continue { $. = 0 if eof; # fix $. } -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

140

Posted on:

Tuesday 16th October 2012
View Replies!

How to put a global variable in a package, accessible to users ofthat package?

I have a package named "Foo" in which I want to define some package- level constants (such as $VAR="soemval"). I want those constants available to users of package Foo, so the following code would work: === foo.pl === package foo; use constant VAR => "someval"; === bar.pl === use foo; print $foo::VAR; It doesn't appear to be working; it compiles ok, but it prints nothing. I thought it would print "someval". Any ideas
VIEWS ON THIS POST

129

Posted on:

Tuesday 16th October 2012
View Replies!

RE: How to put a global variable in a package, accessible to usersof that package?

> Message du 31/10/08 10:25 > De : "Stewart Anderson" > A : "mrstevegross" , beginners@perl.org > > === foo.pl === > > package foo; > > use constant VAR => "someval"; > > > > === bar.pl === > > use foo; > > print $foo::VAR; > > > > It doesn't appear to be working; it compiles ok, but it prints > > nothing. I thought it would print "someval". > > > That looks interesting. How do people use that kind of constant > assignment. That was not interesting. $foo::VAR is a wrong usage on his case. See Shawn's answer. Jeff. http://home.arcor.de/pangj/ Créez votre adresse électronique prenom.nom@laposte.net 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
VIEWS ON THIS POST

128

Posted on:

Tuesday 16th October 2012
View Replies!

Redhat/Centos users

I suggest you read this. http://weblog.infoworld.com/fatalexc..._by_the_r.html and http://blog.vipul.net/2008/08/24/red...hat-a-tragedy/
VIEWS ON THIS POST

80

Posted on:

Tuesday 16th October 2012
View Replies!

FAQ 9.14 How do I make sure users can't enter values into a form that cause my CGI script to do bad things?

This is an excerpt from the latest version perlfaq9.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 9.14: How do I make sure users can't enter values into a form that cause my CGI script to do bad things See the security references listed in the CGI Meta FAQ http://www.perl.org/CGI_MetaFAQ.html -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

120

Posted on:

Tuesday 16th October 2012
View Replies!

any ruby programmers who are perl users?

Most likely just out of curiosity factor, I picked up a book "Learning to program " the facets of ruby series.. While very simple in nature, book try to teach computer programming concept while giving some ruby lesson.. Even though I am still a beginner for perl, I just wanted to pick up 2nd language to get some different view and in hopes of gaining better understanding of OOP so that I can start to pick OOP up in perl... When I program ruby, I feel like it's just like perl(well just in my limited runs w/ ruby) w/out all the more strict grammar and it's fairly easy to learn(now that I have spent good amount of time learning perl in begining stages that is) on very very elementry level.(meaning I am sure as I explore more I will realize the differences of the 2 languages). I am going to assume for now that ruby will run slower than perl.......... That lead me to my question.. is there perl guru who are also avid ruby users Our company does not use ruby at all so I cannot really see using ruby for work but just was wondering ... (but then my job is not really programming but I still create perl based project ).
VIEWS ON THIS POST

154

Posted on:

Tuesday 16th October 2012
View Replies!

FAQ 6.3 How can I pull out lines between two patterns that are themselves on different lines?

This is an excerpt from the latest version perlfaq6.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 6.3: How can I pull out lines between two patterns that are themselves on different lines You can use Perl's somewhat exotic ".." operator (documented in perlop): perl -ne 'print if /START/ .. /END/' file1 file2 ... If you wanted text and not lines, you would use perl -0777 -ne 'print "$1\n" while /START(.*)END/gs' file1 file2 ... But if you want nested occurrences of "START" through "END", you'll run up against the problem described in the question in this section on matching balanced text. Here's another example of using "..": while () { $in_header = 1 .. /^$/; $in_body = /^$/ .. eof; # now choose between them } continue { $. = 0 if eof; # fix $. } -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

153

Posted on:

Tuesday 16th October 2012
View Replies!

How to send email from perl-script with different priorities : normalor high

, I'm trying to send email from my perl-script with different priorities : normal or high. For some reasons, I'm not going to use any perl-module like MIME::Lite. $email = "my.email\@isp.com"; $priority = 'high'; $html = "MIME-Version: 1.0\nContent-Type: text/html\; charset=us-ascii \n"; $html .= "Subject: FYI-- $date\n"; $html .= "Priority: $priority\n\n"; # ---> here I'm trying to change email priority $html .= ""; $html .= "FYI -- $date\n"; $html .= ""; open ( MAIL, "|/usr/bin/mail $email") or die; print MAIL $html; close ( MAIL); Thank you in advance, --Simon
VIEWS ON THIS POST

144

Posted on:

Wednesday 17th October 2012
View Replies!

Creating an encrypted zipfile on Unix for Windows users

Hi folks, I'm writing a script that basically creates a bunch of files, packages them up (tar/gz), and mails them out. I can handle all of that, but before I mail them I also have to password protect the archive like pkzip does. I really don't want to shell out to pkzip if I can avoid it. I checked CPAN, of course, but Archive::Zip which seemed the likely candidate doesn't do encryption. Crypt::OpenPGP or similar is also no good since I can't (much as I'ld like to) use public key. I didn't see any others that do what I need, which is create a WinZip compatible encrypted archive which is easily opened by a Windows user with the password which I would provide separately. Any advice/docs/hints would be much appreciated. Thank You! richf
VIEWS ON THIS POST

174

Posted on:

Wednesday 17th October 2012
View Replies!

count the number of occurences of each different word of a text

Hi all i have a text that contains nearly 30000 words. I'd like to know the number of occurences of each word of this text and sort the result in descending order. Is this easily feasible using perl If so, how (i am a huge noob..) thanks in advance , On Dec 26, 9:29am, Mr_Noob wrote: > Hi all > > i have a text that contains nearly 30000 words. > I'd like to know the number of occurences of each word of this text > and sort the result in descending order. > Is this easily feasible using perl If so, how (i am a huge noob..) > use strict; use warnings; my %word_count; my $text = 'the quick brown fox jumped over the lazy dog. the dog liked it.'; my @words = map { s/\.$//; $_; } split ' ', $text; for ( @words ) { $word_count{$_}++; } for my $word ( sort { $word_count{$b} $word_count{$a} } keys %word_count ) { print "$word => $word_count{$word}\n"; } __OUTPUT__ the => 3 dog => 2 jumped => 1 over => 1 it => 1 liked => 1 lazy => 1 brown => 1 fox => 1 quick => 1 ...you may want to sort on the word if the counts match up as well, so the output will be consistent.
VIEWS ON THIS POST

78

Posted on:

Wednesday 17th October 2012
View Replies!

FAQ 9.14 How do I make sure users can't enter values into a form that cause my CGI script to do bad things?

This is an excerpt from the latest version perlfaq9.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 9.14: How do I make sure users can't enter values into a form that cause my CGI script to do bad things See the security references listed in the CGI Meta FAQ http://www.perl.org/CGI_MetaFAQ.html -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

181

Posted on:

Wednesday 17th October 2012
View Replies!

FAQ 6.3 How can I pull out lines between two patterns that are themselves on different lines?

This is an excerpt from the latest version perlfaq6.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 6.3: How can I pull out lines between two patterns that are themselves on different lines You can use Perl's somewhat exotic ".." operator (documented in perlop): perl -ne 'print if /START/ .. /END/' file1 file2 ... If you wanted text and not lines, you would use perl -0777 -ne 'print "$1\n" while /START(.*)END/gs' file1 file2 ... But if you want nested occurrences of "START" through "END", you'll run up against the problem described in the question in this section on matching balanced text. Here's another example of using "..": while () { $in_header = 1 .. /^$/; $in_body = /^$/ .. eof; # now choose between them } continue { $. = 0 if eof; # fix $. } -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

115

Posted on:

Wednesday 17th October 2012
View Replies!

FAQ 6.3 How can I pull out lines between two patterns that are themselves on different lines?

This is an excerpt from the latest version perlfaq6.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 6.3: How can I pull out lines between two patterns that are themselves on different lines You can use Perl's somewhat exotic ".." operator (documented in perlop): perl -ne 'print if /START/ .. /END/' file1 file2 ... If you wanted text and not lines, you would use perl -0777 -ne 'print "$1\n" while /START(.*)END/gs' file1 file2 ... But if you want nested occurrences of "START" through "END", you'll run up against the problem described in the question in this section on matching balanced text. Here's another example of using "..": while () { $in_header = 1 .. /^$/; $in_body = /^$/ .. eof; # now choose between them } continue { $. = 0 if eof; # fix $. } -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

145

Posted on:

Saturday 20th October 2012
View Replies!

FAQ 9.14 How do I make sure users can't enter values into a form that cause my CGI script to do bad things?

This is an excerpt from the latest version perlfaq9.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 9.14: How do I make sure users can't enter values into a form that cause my CGI script to do bad things See the security references listed in the CGI Meta FAQ http://www.perl.org/CGI_MetaFAQ.html -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod. -- Posted via a free Usenet account from http://www.teranews.com
VIEWS ON THIS POST

182

Posted on:

Monday 22nd October 2012
View Replies!

OK, so what's the different between OR and || in conditions?

OK, so what's the different between OR and || in conditions I've never been given a clear answer to this.
VIEWS ON THIS POST

65

Posted on:

Monday 22nd October 2012
View Replies!