Re: Matching the contents of an array

2006-03-16 Thread Jeff Pang
> >I'm havig problems getting information out of a file and having it write each >of the dates to an array. The problem is, I don't want duplicates. > After reading your program carefully,I think you just want to get the count increase for each uniq $data. In perl programming,HASH is very usefu

Matching the contents of an array

2006-03-16 Thread HObbES
Hi all, I'm havig problems getting information out of a file and having it write each of the dates to an array. The problem is, I don't want duplicates. A sample log entry looks like this: [07/Feb/2006:19:57:35 +] 1.2.3.4 SSLv3 RC4-MD5 "GET /package-update.tar HTTP/1.1" 231 Ed Smith p

RE: LDAP query giving no results

2006-03-16 Thread Timothy Johnson
Sort of OT, but look for the freeware version of Softerra LDAP Browser. It's an implementation-agnostic GUI for LDAP. You can use it to test out your LDAP query syntax. -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Thursday,

RE: LDAP query giving no results

2006-03-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Gavin Henry wrote: > >> I attempting to pull some data, but get no errors and NO data. I am >> following Graham Barr's examples with minor mods since it did seem >> to be just right. Here is what I have leaving out the display of >> the data: >> >> #!perl >> >> use strict; >> use warnings

Re: FILE::copy gives error undefined subroutine

2006-03-16 Thread Mr. Shawn H. Corey
JupiterHost.Net wrote: a) FILE::copy probably doesn;t exist but rather: File::Copy Sadly :( FILE::copy does exist in some operating systems; like MS DOS and Mac OX S. This is because they do not distinguish between uppercase and lowercase in file names. Perl seems to find the correct module

Re: LDAP query giving no results

2006-03-16 Thread Gavin Henry
> I attempting to pull some data, but get no errors and NO data. I am > following Graham Barr's examples with minor mods since it did seem to be > just right. Here is what I have leaving out the display of the data: > > #!perl > > use strict; > use warnings; > > use Net::LDAP; > > #INITIALI

Re: Why is data duplicated in this substitution?

2006-03-16 Thread John W. Krahn
Zembower, Kevin wrote: > I'm trying to capture the number of bytes transmitted and received on my > eth0 interface for use with RRD. I'm using this source for the data: > > [EMAIL PROTECTED]:~/rrdmonitoring$ cat /proc/net/dev > Inter-| Receive| > T

Re: FILE::copy gives error undefined subroutine

2006-03-16 Thread Sonika Sachdeva
Thanks for the pointers. On 3/16/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > > Hello, > > > > > Please try to write cleaner code, its hard to read :) (See "Perl Best > Practices" by Damian Conway, Oreilley) > > > > > undefined subroutine &main::copy > > > > What could be the mistake? > > a)

Re: FILE::copy gives error undefined subroutine

2006-03-16 Thread JupiterHost.Net
Hello, Please try to write cleaner code, its hard to read :) (See "Perl Best Practices" by Damian Conway, Oreilley) undefined subroutine &main::copy What could be the mistake? a) FILE::copy probably doesn;t exist but rather: File::Copy b) you have not imported copy() into main:: so

LDAP query giving no results

2006-03-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I attempting to pull some data, but get no errors and NO data. I am following Graham Barr's examples with minor mods since it did seem to be just right. Here is what I have leaving out the display of the data: #!perl use strict; use warnings; use Net::LDAP; #INITIALIZING my $ldap = N

Re: FILE::copy gives error undefined subroutine

2006-03-16 Thread Sonika Sachdeva
It works . Thank you all. On 3/16/06, Sonika Sachdeva <[EMAIL PROTECTED]> wrote: > > Thanks for your response. > > I did change the module name. It works but now it hangs at the copy > command without giving any warning/error. ( plz refer the code) > > > thanks, > > > On 3/16/06, Dermot Paikkos

Re: FILE::copy gives error undefined subroutine

2006-03-16 Thread Sonika Sachdeva
Thanks for your response. I did change the module name. It works but now it hangs at the copy command without giving any warning/error. ( plz refer the code) thanks, On 3/16/06, Dermot Paikkos <[EMAIL PROTECTED]> wrote: > > Is that File::Copy or FILE::copy? The former is what you want. > Dp. >

RE: Why is data duplicated in this substitution?

2006-03-16 Thread Zembower, Kevin
Thanks so much, David and Tom. I was forgetting that part. Regarding the Useless Use of cat, that was an artifact left over from how I build up perl one-liners from simpler modules. I didn't know what the format of /proc/net/dev was. You're right, it looks better, and probably works better as: [E

Re: FILE::copy gives error undefined subroutine

2006-03-16 Thread Mr. Shawn H. Corey
Sonika Sachdeva wrote: Hi All, I have used FILE::copy , perl syntax check is OK. and am getting the following error when it tries to perform the copy function . This is on windows system. That has to be: use File::Copy; Case is important in Perl. On certain OSes, like Mac OS X, case in file n

Re: Character class for ?&*%$@ etc...

2006-03-16 Thread Mr. Shawn H. Corey
Cornelis Swanepoel wrote: At 11:19 AM 3/16/06, Colin Robinson wrote: Can anyone tell me if I can short hand ?&*%$@ etc. as matches for my regular expression. I don't want spaces, new line, carriage returns, tabs etc. to be matched. /[^\w\s\t\n\r\f]+/ hth --memento mori /[[:punct:]]/ See

Re: FILE::copy gives error undefined subroutine

2006-03-16 Thread Dermot Paikkos
Is that File::Copy or FILE::copy? The former is what you want. Dp. On 16 Mar 2006 at 9:53, Sonika Sachdeva wrote: > Hi All, > > I have used FILE::copy , perl syntax check is OK. > and am getting the following error when it tries to perform the copy > function . This is on windows system. > >

FILE::copy gives error undefined subroutine

2006-03-16 Thread Sonika Sachdeva
Hi All, I have used FILE::copy , perl syntax check is OK. and am getting the following error when it tries to perform the copy function . This is on windows system. my $retval=system("perl \"$SCRIPTDIR\\test.pl\" $FILEHASH{$filename}[3]") ; if($retval != 0) { print LOGHANDLE "Error while e

Re: Why is data duplicated in this substitution?

2006-03-16 Thread Tom Phoenix
On 3/16/06, Zembower, Kevin <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED]:~/rrdmonitoring$ cat /proc/net/dev|perl -ne > '/eth0:(\d+)\s+.*/; print $1;' The -n flag means you're running that code in a loop. Every time through the loop, you're printing $1, even if the pattern didn't match. Somebod

RE: Why is data duplicated in this substitution?

2006-03-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Zembower, Kevin wrote: > I'm trying to capture the number of bytes transmitted and received on > my eth0 interface for use with RRD. I'm using this source for the > data: > > > > [EMAIL PROTECTED]:~/rrdmonitoring$ cat /proc/net/dev > > Inter-| Receive

SOLVED - Re: Out of memory! - from CPAN

2006-03-16 Thread Jerry K
SOLVED!!! To answer Tom's question in his email, I am using the system malloc(). I was preparing to completely remove perl again, and re-install from scratch for a 3rd time. My definition of removing perl completely is: removing the compiled perl source code removing my .cpan subdirectory re

Re: Out of memory! - from CPAN

2006-03-16 Thread Jerry K
I have resolved my issue, and I will follow that up with another email. But to answer the questions below. Tom, I am not using perl's malloc, I am using the system malloc. When you asked this question, I also reviewed the perl installation on 8 other stand-alone systems that I have installe

Why is data duplicated in this substitution?

2006-03-16 Thread Zembower, Kevin
I'm trying to capture the number of bytes transmitted and received on my eth0 interface for use with RRD. I'm using this source for the data: [EMAIL PROTECTED]:~/rrdmonitoring$ cat /proc/net/dev Inter-| Receive| Transmit face |bytespacket

Re: Character class for ?&*%$@ etc...

2006-03-16 Thread Cornelis Swanepoel
> At 11:19 AM 3/16/06, Colin Robinson wrote: > >Can anyone tell me if I can short hand ?&*%$@ etc. as matches for my > >regular expression. I don't want spaces, new line, carriage returns, > >tabs etc. to be matched. > /[^\w\s\t\n\r\f]+/ hth --memento mori

Re: Character class for ?&*%$@ etc...

2006-03-16 Thread Frank Bax
At 11:19 AM 3/16/06, Colin Robinson wrote: Can anyone tell me if I can short hand ?&*%$@ etc. as matches for my regular expression. I don't want spaces, new line, carriage returns, tabs etc. to be matched. google "perl regexp". All top five results have the answer. -- To unsubscribe, e-mail:

Character class for ?&*%$@ etc...

2006-03-16 Thread Colin Robinson
Hi, Can anyone tell me if I can short hand ?&*%$@ etc. as matches for my regular expression. I don't want spaces, new line, carriage returns, tabs etc. to be matched. TIA, Colin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Out of memory! - from CPAN

2006-03-16 Thread Jay Savage
On 3/15/06, Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 3/15/06, Jerry Kemp <[EMAIL PROTECTED]> wrote: > > > # perl -MCPAN -e shell > > cpan> reload index > > Out of memory! > > Was your perl compiled to use your system's malloc(), or Perl's own? > You can find out with a command like this one: > >

Listing available template variables using Template Toolkit

2006-03-16 Thread Jeff Eggen
Hi all, I'm interested in determining the parameters available to be set in a template using the template toolkit. I know that using HTML::Template I just have to define my HTML::Template object and then call $object->params() to return a list of parameters available. Is there a similar method /

RE: Line Swap

2006-03-16 Thread Jeff Pang
Hello,Sharmila, The lines that you want to swap seems so ruleless,so it's maybe hard to find a good way for you. If you just want to handle the case listed below,I'll give a simple way: $ cat t.txt $sc:(.+) (.+) $tic:(.+) $ perl -e '@tmp=<>;print shift @tmp;print reverse @tmp' t.txt $sc:(.+)

RE: Line Swap

2006-03-16 Thread sharmila
Hi, Thanks for the code. When I execute it I have come across with compilation errors. Have attached the perl and the error message for your information. Please help me in this regard. Thanks and regards, Sharmila -Original Message- From: Raymond Raj [mailto:[EMAIL PROTECTED] Sent: Th