filecopy

2006-08-21 Thread Smith, Derek
Why doesn't a copy work on each array element yet a glob does? Is there a way to tell Perl to copy each element of the array off to another file location? for (my $suffix=0; $suffix <= $#NBlogs2; $suffix++) { foreach my $logs (@NBlogs2) { copy ("$logs", "$o

IO::All and Logfile::Rotate issues

2006-08-21 Thread Smith, Derek
Perlers, I getting this error, any help is appreciated! I tried to use other files in /tmp that I manually created but still received the same error. Look at line 76 in the Copy.pm file and wasn't sure but here it is: 58 sub copy { 59 croak("Usage: copy(FROM, TO [, BUFF

RE: recusrive listing

2006-08-18 Thread Smith, Derek
-Original Message- From: Ricardo SIGNES [mailto:[EMAIL PROTECTED] Sent: Friday, August 18, 2006 8:58 AM To: beginners@perl.org Subject: Re: recusrive listing * "Smith, Derek" <[EMAIL PROTECTED]> [2006-08-17T10:52:16] > What module would be ideal for getting a recurs

recusrive listing

2006-08-18 Thread Smith, Derek
What module would be ideal for getting a recursive listing into an array or hash? I was looking at IO::All $io = io('my/directory/'); # Create new directory object @contents = $io->all; # Get all contents of dir @contents = @$io;

RE: match an array element

2006-08-16 Thread Smith, Derek
-Original Message- From: Adriano Allora [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 16, 2006 1:21 PM To: beginners@perl.org Subject: match an array element hi all, I need to match any array element in a list of files. More precisely I'd to extract the $. for each match recording

RE: Re: Re: How to sort an array which contains a value several times ?

2006-08-15 Thread Smith, Derek
Since grep only cares if the expression evaluates true or false, the $_ in second version is superfluous, but it may be the easiest to read and understand. If you want to find unique values and keep a count of how many times something has been seen, then you can do something like: $seen{$_}++

RE: string to perl

2006-08-07 Thread Smith, Derek
-Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 9:58 AM To: Ryan Perry; Perl Beginners Subject: RE: string to perl Check out the documentation on the eval function perldoc -f eval -Original Message- From: Ryan Perry [mailto:[E

RE: perl script calls batch file

2006-08-03 Thread Smith, Derek
-Original Message- From: Shourya Sengupta [mailto:[EMAIL PROTECTED] Sent: Thursday, August 03, 2006 2:15 PM To: beginners@perl.org Subject: perl script calls batch file Hi, My perl program calls a batch file on a remote machine. Now my question is how to return a value from that batch s

RE: Regex find and replace - delete line

2006-07-24 Thread Smith, Derek
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Ahhh yes...thank you for the pointing out the oversights => qw instead of qq and removing the commas. ___

RE: Regex find and replace - delete line

2006-07-24 Thread Smith, Derek
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Monday, July 24, 2006 3:36 PM To: Perl Beginners Subject: Re: Regex find and replace - delete line Chris Charley wrote: > > - Original Message - From: ""John W. Krahn"" <[EMAIL PROTECTED]> >> >> And if you wa

RE: check existence of element in a list

2006-07-21 Thread Smith, Derek
-Original Message- From: joseph [mailto:[EMAIL PROTECTED] Sent: Thursday, July 20, 2006 6:45 PM To: beginners@perl.org Subject: Re: check existence of element in a list > > s/\s+$// foreach @pclist; > s/\s+$// foreach @smsclient; > > instead of using chomp(). If this also fails, the

RE: Regexp help please

2006-07-13 Thread Smith, Derek
-Original Message- From: Dr.Ruud [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 5:24 PM To: beginners@perl.org Subject: Re: Regexp help please "Dr.Ruud" schreef: > Slight revision, that fails on the last line: More assuming revision: #!/usr/bin/perl use warnings ; use str

RE: inherited perl program

2006-07-07 Thread Smith, Derek
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Ettinger Sent: Friday, July 07, 2006 1:27 PM To: Smith, Derek Subject: Re: inherited perl program On 7/7/06, Smith, Derek <[EMAIL PROTECTED]> wrote: > > > > > I have inherite

inherited perl program

2006-07-07 Thread Smith, Derek
I have inherited a program that does snmp walks and gets, but within the code (keep in mind they turned off strict for references) I am failing to understand the push @$node_type “$name”; The person who wrote this said with strict on the push statement above will not work…complains about

RE: What is the function of BEGIN in perl

2006-07-05 Thread Smith, Derek
-Original Message- From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 1:21 PM To: Perl Beginners Subject: Re: What is the function of BEGIN in perl Smith, Derek wrote: > Doesn't the BEGIN and INIT constructs provide the same behavior? No. From

RE: What is the function of BEGIN in perl

2006-07-05 Thread Smith, Derek
-Original Message- From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] Sent: Monday, May 01, 2006 7:36 PM To: chen li Cc: beginners@perl.org Subject: Re: What is the function of BEGIN in perl On Mon, 2006-01-05 at 15:32 -0700, chen li wrote: > Dear all, > > Recently I read some source c

RE: eval problem

2006-06-27 Thread Smith, Derek
-Original Message- From: Jorge Almeida [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 9:37 AM To: John W. Krahn Cc: Perl Beginners Subject: Re: eval problem On Tue, 27 Jun 2006, John W. Krahn wrote: > Jorge Almeida wrote: >> What is happening? > > When find dies a SIGPIPE signa

RE: uninitialized value error

2006-06-21 Thread Smith, Derek
-Original Message- From: Beginner [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 21, 2006 12:16 PM To: beginners@perl.org Subject: RE: uninitialized value error On 21 Jun 2006 at 17:08, Beginner wrote: > for (;;) { > print SDTERR "PS=$_\n"; > push @arry, (spl

RE: uninitialized value error

2006-06-21 Thread Smith, Derek
-Original Message- From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 21, 2006 11:53 AM To: beginners@perl.org Subject: RE: uninitialized value error Smith, Derek wrote: : I am getting the following error yet the script is doing what : I need it to do restart a

RE: uninitialized value error

2006-06-21 Thread Smith, Derek
-Original Message- From: Gary Stainburn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 21, 2006 11:35 AM To: beginners@perl.org Subject: Re: uninitialized value error On Wednesday 21 June 2006 16:23, Smith, Derek wrote: > I am getting the following error yet the script is doing wha

RE: uninitialized value error

2006-06-21 Thread Smith, Derek
Have given it many attempts to fix….but now need help..   Derek Bellner Smith Unix Systems Engineer Cardinal Health Dublin, Ohio   From: Smith, Derek Sent: Wednesday, June 21, 2006 11:19 AM To: beginners@perl.org Subject: uninitialized value error   I am getting the

uninitialized value error

2006-06-21 Thread Smith, Derek
I am getting the following error yet the script is doing what I need it to do restart a process:   Use of uninitialized value at /usr/local/admin/named_monit.pl line 71 (#1)      (W) An undefined value was used as if it were already defined.  It was    interpreted as a "" or a 0, but m

RE: compilation of Devel-Size for DataDumper

2006-06-15 Thread Smith, Derek
>-Original Message- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom >Phoenix >Sent: Thursday, June 15, 2006 3:21 PM >To: Smith, Derek >Cc: beginners@perl.org >Subject: Re: compilation of Devel-Size for DataDumper >On 6/15/06, Smith, Derek &

compilation of Devel-Size for DataDumper

2006-06-15 Thread Smith, Derek
How can I tell the HPUX 11.11 system to not use it default C compiler /usr/bin/cc but instead use gcc version 4.1.1? I manually edited the Makefile to point CC=/usr/local/bin/gcc but I get the errors below: Do I need an ANSI C compiler? Please advise! Thank you Derek As root:

5.8.2 vs 5.6.1

2006-06-15 Thread Smith, Derek
I will be installing Proc:ProcessTable, IO, Devel-Size, Term-Size and Data-Dumper on a HPUX 11.11 dev system with Perl 5.8.2 Due to out of my control software loads (multiple versions of Perl...YUK! ) we have no standard load processes. My question is considering these modules being loaded will i

module install on HPUX 11.11 ....any suggestions?

2006-06-13 Thread Smith, Derek
I know I will probably need another compiler but wanted to make sure. I changed the make file to point to gcc, g++, cpp and c++ and I am still getting errors. Here are my errors using /usr/bin/cc [EMAIL PROTECTED] make cp Size.pm blib/lib/Term/Size.pm AutoSplitting blib/lib/Term/Size.pm (bli

install problems on HPUX 11.11

2006-06-12 Thread Smith, Derek
I know I will probably need another compiler but wanted to make sure. I changed the make file to point to gcc, g++, cpp and c++ and I am still getting errors. Here are my errors using /usr/bin/cc [EMAIL PROTECTED] make cp Size.pm blib/lib/Term/Size.pm AutoSplitting blib/lib/Term/Size.pm (bli

RE: What are the problems with my CGI script

2006-06-06 Thread Smith, Derek
>Dear Dr. Ruud, > >Thanks it works. I change this line into: > >my $name = ($query_obj->param('text_field') or ' '); >But I am not sure why I need to add the (or ''). I >see nowhere in CGI.pm talking about it. Can you >explain it in a liitle bit detail? Also what am I >supposed to do if

RE: hash assign not working

2006-05-16 Thread Smith, Derek
From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 2:06 PM To: Smith, Derek; beginners@perl.org Subject: RE: hash assign not working Smith, Derek wrote: > My hash creations are not working as I expected: %hash = ( @mir, >

hash assign not working

2006-05-16 Thread Smith, Derek
My hash creations are not working as I expected: %hash = ( @mir, @mir2 ); Why? But do work at %hash = ( $mir[0], $mir2[0] ); Obviously I need the entire arrays and their associated key/value pairs, and have tried various methods unsuccessfully from Programming Perl CD such as array of hashes

RE: hash assignments

2006-05-16 Thread Smith, Derek
> > foreach my $lv (@lvs) { > > push @mir => (grep /mirror/i, `lvdisplay $lv`); > > push @mir2 => (grep /lvol\d+/i, `lvdisplay $lv`); > Try replacing the above line with > push @mir2 => (grep s/^LV Name\s*//, `lvdisplay $lv`); > Or > push @mir2 => (grep {/lvol\d

RE: hash assignments

2006-05-15 Thread Smith, Derek
>On 5/15/06, Smith, Derek <[EMAIL PROTECTED]> wrote: > I tried an push @mir2 => (unless /lv\d+/i, `lvdisplay $lv`); in place of > the third push > > But that gave me an error: Uncaught exception from user code: > >syntax error at HPUX_verify_sys

hash assignments

2006-05-15 Thread Smith, Derek
I have this system output --- Logical volumes --- LV Name /dev/vg00/lvol1 VG Name /dev/vg00 LV Permission read/write LV Status available/syncd Mirror copies 1 Consistency RecoveryMWC Schedule

RE: using Perl grep to populate a scalar

2006-05-10 Thread Smith, Derek
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix Sent: Wednesday, May 10, 2006 6:35 PM To: Smith, Derek Cc: Perl Beginners Subject: Re: using Perl grep to populate a scalar On 5/9/06, Smith, Derek <[EMAIL PROTECTED]> wrote: > if

RE: using Perl grep to populate a scalar

2006-05-10 Thread Smith, Derek
-Original Message- From: Smith, Derek Sent: Tuesday, May 09, 2006 5:22 PM To: Perl Beginners Subject: using Perl grep to populate a scalar All, I am trying to populate a scalar (ideally a hash) using a Perl grep but it is not working. I even tried to use an array and no data was

using Perl grep to populate a scalar

2006-05-09 Thread Smith, Derek
All, I am trying to populate a scalar (ideally a hash) using a Perl grep but it is not working. I even tried to use an array and no data was pushed. use strict; use warnings; my @lvs; my @lvaray = qx(bdf); foreach (@lvaray) { if (/(?)vg00/) { push @lvs, (split)[0] } }

RE: scalar on a populated hash. NEVER MIND

2006-05-05 Thread Smith, Derek
_ From: Smith, Derek Sent: Friday, May 05, 2006 11:28 AM To: 'Perl Beginners' Subject: scalar on a populated hash. I do not understand why scalar is returning me 2/8? Also isn't scalar %hashname the recommended way to get a count of the key or values in any hash? I t

scalar on a populated hash.

2006-05-05 Thread Smith, Derek
I do not understand why scalar is returning me 2/8? Also isn't scalar %hashname the recommended way to get a count of the key or values in any hash? I tried scalar $sc{$key} and it gave me an error saying my value not numeric. It was trying to count the string /var/adm/crash. My goal is to get

RE: has key/value pairs

2006-05-03 Thread Smith, Derek
-Original Message- From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 5:41 PM To: 'Perl Beginners' Subject: RE: has key/value pairs Smith, Derek wrote: : Excellent... thank you. Before sending the email question, I : was trying to use split to

RE: has key/value pairs

2006-05-03 Thread Smith, Derek
-Original Message- From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 4:10 PM To: 'Perl Beginners' Subject: RE: has key/value pairs Smith, Derek wrote: : I need to create a hash with a key/value pair as text:nontext : like so: : savecrash as the

has key/value pairs

2006-05-03 Thread Smith, Derek
I need to create a hash with a key/value pair as text:nontext like so: savecrash as the key and 1 as the value savecrash_dir as the key and /var/adm/crash as the value. The output from each is giving 1 (true) but I need to have the values as I stated above. Here is my code and below that is t

RE: truncate

2006-04-23 Thread Smith, Derek
-Original Message- From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] Sent: Sunday, April 23, 2006 1:51 PM To: Perl Beginners Subject: Re: truncate On Sun, 2006-23-04 at 13:29 -0400, Smith, Derek wrote: > use strict; > > use warnings; > > > > my $file = qq(

truncate

2006-04-23 Thread Smith, Derek
I want to use truncate to delete a matched line out a named.conf file on my DNS box. Here is my code use strict; use warnings; my $file = qq(/usr/local/admin/perl/derek_perl/test); open (FH, "+< $file"); while ( ) { unless (/\Acheck\-names/) { print $_;

RE: golf

2006-04-23 Thread Smith, Derek
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Friday, April 21, 2006 7:04 PM To: Perl Beginners Subject: Re: golf Chad Perrin wrote: > On Fri, Apr 21, 2006 at 12:48:51PM -0700, John W. Krahn wrote: >>print/.*/g,$"while<> > > Woah, that's pretty short. You can m

RE: Extracting a bit of a scalar variable

2006-04-21 Thread Smith, Derek
-Original Message- From: Smith, Derek Sent: Friday, April 21, 2006 10:22 AM To: Perl Beginners Subject: RE: Extracting a bit of a scalar variable Original Message- From: Dr.Ruud [mailto:[EMAIL PROTECTED] Sent: Friday, April 21, 2006 9:19 AM To: beginners@perl.org Subject: Re

RE: Extracting a bit of a scalar variable

2006-04-21 Thread Smith, Derek
Original Message- From: Dr.Ruud [mailto:[EMAIL PROTECTED] Sent: Friday, April 21, 2006 9:19 AM To: beginners@perl.org Subject: Re: Extracting a bit of a scalar variable Praveena Vittal schreef: > I am newbie to PERL. ITYM: Perl. > I think this is a very simple question to ask. Well,

RE: Crypt::GPG produces an empty cleartext file

2006-04-14 Thread Smith, Derek
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Thursday, April 06, 2006 8:04 PM To: Perl Beginners Subject: Re: Crypt::GPG produces an empty cleartext file RICHARD FERNANDEZ wrote: > Hi Folks, Hello, > I have a job that takes in an encrypted file and decrypts it

RE: Crypt::GPG produces an empty cleartext file

2006-04-06 Thread Smith, Derek
-Original Message- From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED] Sent: Thursday, April 06, 2006 12:45 PM To: beginners@perl.org Subject: RE: Crypt::GPG produces an empty cleartext file What version of Crypt:GPG are u using? Derek Bellner Smith Unix Systems Engineer Cardina

RE: Crypt::GPG produces an empty cleartext file

2006-04-06 Thread Smith, Derek
-Original Message- From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED] Sent: Thursday, April 06, 2006 12:20 PM To: beginners@perl.org Subject: Crypt::GPG produces an empty cleartext file Hi Folks, I have a job that takes in an encrypted file and decrypts it using Crypt::GPG. for my $e