Setting PERL5LIB ... is this the expected behaviour ... ???

2010-05-27 Thread newbie01 perl
Hi all, Just need to confirm if this is the expected behaviour when setting PERL5LIB. If I have the folllowing in my script ... == #!/usr/bin/perl $ENV{PERL5LIB}="/oracle/product/db/11.1/perl/lib/site_perl/5.8.3/x86_64-linux-thread-multi"

Re: split value when there's nothing to split

2010-05-27 Thread Uri Guttman
> "G" == Grant writes: G> The value of $string could include dashes or not. If it is, I'd like G> the value of $foo to be set to the portion of the string to the left G> of the first dash. If not, I'd like the value of $foo to be null. G> I'm doing the following, but $foo is equal

split value when there's nothing to split

2010-05-27 Thread Grant
The value of $string could include dashes or not. If it is, I'd like the value of $foo to be set to the portion of the string to the left of the first dash. If not, I'd like the value of $foo to be null. I'm doing the following, but $foo is equal to "1" if there are no dashes in the string: $fo

A story

2010-05-27 Thread Steve Bertrand
I once had a sub, taking a single param, kept passing it in until I was damned. All of a sudden, the sub needed two, I knew right then, that I was through. The undef was nice, naughty with spice, but the hrefs as params was what I should do. If you think a sub, will only accept one, accept param

Developer docs

2010-05-27 Thread Steve Bertrand
My ISP:: project has reached a level that it's almost unmaintainable by one person anymore. 49k+ lines of code across +15 modules, not including other custom modules that it has its hooks into. I once again am looking for advice on documentation practices. This project is beyond the point of havin

Re: How to get environment variables from child shell

2010-05-27 Thread Steve Bertrand
On 2010.05.27 20:15, Marilyn Sander wrote: > > On May 27, 2010, at 4:58 PM, Jim Gibson wrote: > >> On 5/27/10 Thu May 27, 2010 4:51 PM, "Bob Sadri" >> scribbled: >> >>> Hi >>> I have a perl script that calls a csh script. The csh script sources some >>> environment variables (among others).

Re: How to get environment variables from child shell

2010-05-27 Thread Marilyn Sander
On May 27, 2010, at 4:58 PM, Jim Gibson wrote: > On 5/27/10 Thu May 27, 2010 4:51 PM, "Bob Sadri" > scribbled: > >> Hi >> I have a perl script that calls a csh script. The csh script sources some >> environment variables (among others). When the control comes back to my >> perl script I lik

Re: How to get environment variables from child shell

2010-05-27 Thread Jim Gibson
On 5/27/10 Thu May 27, 2010 4:51 PM, "Bob Sadri" scribbled: > Hi > I have a perl script that calls a csh script. The csh script sources some > environment variables (among others). When the control comes back to my > perl script I like to use the environment variables set in the csh script. >

How to get environment variables from child shell

2010-05-27 Thread Bob Sadri
Hi I have a perl script that calls a csh script. The csh script sources some environment variables (among others). When the control comes back to my perl script I like to use the environment variables set in the csh script. However, since this has happened in the child shell environment I am not

Re: execute and analyze unix command with perl

2010-05-27 Thread John W. Krahn
Robert Morales wrote: Ok, now I added the: my $regex = "^((?!total).)*\$"; I also removed the " " from the numbers in the if test: if ($array[6] >= 867580){ The error msg I get this time, is like this: r...@user# ./script.pl 0 Use of uninitialized value $array[6] in numeric ge

Re: execute and analyze unix command with perl

2010-05-27 Thread Brandon McCaig
On Thu, May 27, 2010 at 2:09 PM, Robert Morales wrote: > The error msg I get this time, is like this: > > r...@user# ./script.pl > 0 > Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line > 21, <$memory> line 3. > Use of uninitialized value $array[6] in numeric ge (>=) at ./

Re: execute and analyze unix command with perl

2010-05-27 Thread Robert Morales
Ok, now I added the: my $regex = "^((?!total).)*\$"; I also removed the " " from the numbers in the if test: if ($array[6] >= 867580){ The error msg I get this time, is like this: r...@user# ./script.pl 0 Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl lin

Re: execute and analyze unix command with perl

2010-05-27 Thread Brandon McCaig
On Thu, May 27, 2010 at 12:48 PM, Robert Morales wrote: > Final $ should be \$ or $name at ./script.pl line 11, within string > syntax error at ./script.pl line 11, near "= "^((?!total).)*$"" > Execution of ./script.pl aborted due to compilation errors. > > It might be something with the regex, bu

Re: execute and analyze unix command with perl

2010-05-27 Thread Robert Morales
Tnx Guys! the $vgs variable is of course and error and should be $memory. After adding your suggestions, I ran the script over again and got this error: r...@user# ./script.pl Final $ should be \$ or $name at ./script.pl line 11, within string syntax error at ./script.pl line 11, near "= "^((?!to

Re: execute and analyze unix command with perl

2010-05-27 Thread Jim Gibson
On 5/27/10 Thu May 27, 2010 9:27 AM, "Robert Morales" scribbled: > Hi, > > I want my code to execute the unix free command in order to analyze > the memory state, and issue a warning if the cached memory increases. > I don`t know what I did wrong, but this is what I got for now: > > #! /usr/b

Re: execute and analyze unix command with perl

2010-05-27 Thread Shlomi Fish
On Thursday 27 May 2010 19:27:46 Robert Morales wrote: > Hi, > > I want my code to execute the unix free command in order to analyze > the memory state, and issue a warning if the cached memory increases. > I don`t know what I did wrong, but this is what I got for now: > > #! /usr/bin/perl > use

execute and analyze unix command with perl

2010-05-27 Thread Robert Morales
Hi, I want my code to execute the unix free command in order to analyze the memory state, and issue a warning if the cached memory increases. I don`t know what I did wrong, but this is what I got for now: #! /usr/bin/perl use warnings; use strict; # return codes $ok = 0; $warning = 1; $critical

Re: Which module ... ???

2010-05-27 Thread Harry Putnam
newbie01 perl writes: > Hi all, > > With multiple Perl install, there will be multiple versions of the same > modules. > > How can you change the order of where @INC look for the specific version of > the module that you want to use? Is this done by using use lib? > > use lib qw(/path/to/one/libr

RE: Location of Perl libraries

2010-05-27 Thread Bob McConnell
From: Marilyn Sander > On May 26, 2010, at 3:35 PM, Shawn H Corey wrote: >> On 10-05-26 05:41 PM, Marilyn Sander wrote: >>> What would be the preferred practice here? >> >> See `perldoc lib` >> > Thanks, this document just explains about @INC. I already > know how to use @INC. My question was

Re: script output => color highlight to stdout

2010-05-27 Thread Jim Gibson
At 10:22 AM -0500 5/27/10, Harry Putnam wrote: I wondered if anyone could steer me to some information about making perl script output appear in color highlight on stdout. Something like what modern grep does on linux, where the searched term appears in some color (red) in the output to tty. p

script output => color highlight to stdout

2010-05-27 Thread Harry Putnam
I wondered if anyone could steer me to some information about making perl script output appear in color highlight on stdout. Something like what modern grep does on linux, where the searched term appears in some color (red) in the output to tty. -- To unsubscribe, e-mail: beginners-unsubscr...

Re: Location of Perl libraries

2010-05-27 Thread Eric Veith1
Hello Marilyn, Marilyn Sander wrote on 05/27/2010 01:28:58 AM: > Thanks, this document just explains about @INC. I already know how to > use @INC. My question was about "normal", "standard", or "best" > practice for placement of scripts and Perl libraries on Windows. The > default setup for A

Re: Using Arrays and if loops together

2010-05-27 Thread John W. Krahn
niallheavey wrote: Hi all, Hello, I'm very new to perl but I will try to explain where I am at the moment. I have a lot of information in a .csv file. The 2nd columb has different values relating to different things. For example "no" = nokia, "se" = sony ericsson, "ip" = iphone and so on. So

AW: Using Arrays and if loops together

2010-05-27 Thread Thomas Bätzler
Hello Niall, niallheavey wrote: > I'm very new to perl but I will try to explain where I am at the > moment. Providing sample input and output is fine. However, if you need help with your code people here have to be able to look at it. Try and post a minimal example for the problem you're havi

Using Arrays and if loops together

2010-05-27 Thread niallheavey
Hi all, I'm very new to perl but I will try to explain where I am at the moment. I have a lot of information in a .csv file. The 2nd columb has different values relating to different things. For example "no" = nokia, "se" = sony ericsson, "ip" = iphone and so on. So the 2nd columb will have a valu