Re: VMWARE PERL API

2007-08-02 Thread vishnu
hi The problem was like i had to read the config file in /etc/vmware/ directory. * if (open CONFIG, ')) { chomp $line; if ($line =~ /^\s*libdir\s*=\s*\"(.*)\"\s*$/) {

Re: Problem with my code

2007-08-02 Thread Jeff Pang
-Original Message- >From: Mihir Kamdar <[EMAIL PROTECTED]> >$hash{$cdr[2],$cdr[3],$cdr[6],$cdr[7]}=$line; #Add some more cdr key fields >if u want. There are (maybe) two problems above. 1. when using hash slice,the form is @hash{'key1','key2'...},not $hash{'key1','key2'...} 2. when y

Re: Problem with my code

2007-08-02 Thread Mihir Kamdar
On 8/2/07, Chas Owens <[EMAIL PROTECTED]> wrote: > > On 8/2/07, Mihir Kamdar <[EMAIL PROTECTED]> wrote: > > > #!/usr/bin/perl > > > > my $child_path = > > > '/home/user71/RangerDatasource/Customization/TelekomMalaysia/Scripts/Tests/cprogs/files/child' > > ; > > my $parent_path = > > > '/home/user71

Re: regex help

2007-08-02 Thread Jeff Pang
-Original Message- >From: "John W. Krahn" <[EMAIL PROTECTED]> >Sent: Aug 3, 2007 10:37 AM >To: Perl beginners >Subject: Re: regex help > >Tony Heal wrote: >> Why doesn't this work? I want to take any leading or trailing white spaces >> out. > >perldoc -q "How do I strip blank space" > >

Re: regex help

2007-08-02 Thread John W. Krahn
Tony Heal wrote: Why doesn't this work? I want to take any leading or trailing white spaces out. perldoc -q "How do I strip blank space" John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order.

Re: a question?

2007-08-02 Thread usenet
On Aug 1, 11:00 pm, [EMAIL PROTECTED] wrote: > can you tell me :"using perl, how a file can be stored into mysql > "? that file is a BUG report , which is made from JUNIT . Perl has no built-in limits on the size of the data it can store or process. You are limited only by the physical constr

Re: Removing duplicate records

2007-08-02 Thread Chas Owens
On 8/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip > The code was tested. and it compiles for mee snip I serious doubt that the code you sent in the email was the code you tested then. You cannot, in any version of Perl that I know, declare an old style file handle with the my subr

Re: regex help

2007-08-02 Thread Chas Owens
On 8/2/07, Tony Heal <[EMAIL PROTECTED]> wrote: > So since '?' will match the last character, group, or class 0 or 1 time the > it matches the group of whatever happens to > be in '.*' up to any spaces that are attached to the '$'. > > Is that correct? snip No, the ? in .*? is not the same as the

Re: reconciling the results from two Perl installations

2007-08-02 Thread Larry Vaden
On 8/2/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: > On 8/2/07, Larry Vaden <[EMAIL PROTECTED]> wrote: > > > What controls whether a Perl module is chosen from > > The order of directories in @INC controls this; the first module found > is the one that's used. Does that give you what you need? > > C

RE: regex for matching repeated strings

2007-08-02 Thread Tony Heal
John's will only work if the next string is the same as the last string. If you mix up the strings it does not work. sarge-plain:~# perl -le' my $data = q[aa cc bbb cc aa ]; print $data; $data =~ s/(.*\n)(?=\1)//g; print $data; ' aa cc bbb cc aa aa cc bbb

Re: reconciling the results from two Perl installations

2007-08-02 Thread Tom Phoenix
On 8/2/07, Larry Vaden <[EMAIL PROTECTED]> wrote: > What controls whether a Perl module is chosen from The order of directories in @INC controls this; the first module found is the one that's used. Does that give you what you need? Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscr

reconciling the results from two Perl installations

2007-08-02 Thread Larry Vaden
We need to reconcile two Perl installations on mx2 and mx4, mail relays running Postfix, amavisd-new and SpamAssassin. The results differ when running the same program ('spamassassin -t') with the same data on the two machines. The operating systems are both Centos-4.5; yum shows that both machi

RE: regex help

2007-08-02 Thread Tony Heal
So since '?' will match the last character, group, or class 0 or 1 time the it matches the group of whatever happens to be in '.*' up to any spaces that are attached to the '$'. Is that correct? Tony Heal > -Original Message- > From: Chas Owens [mailto:[EMAIL PROTECTED] > Sent: Thursda

Re: regex help

2007-08-02 Thread Ricky Zhou
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tony Heal wrote: > Why doesn't this work? I want to take any leading or trailing white spaces > out. If I remove the remark it works, but I > do not understand why it requires the second line For reference, perldoc perlre and search for greedy. Basic

Re: regex help

2007-08-02 Thread Chas Owens
On 8/2/07, Tony Heal <[EMAIL PROTECTED]> wrote: snip > Why doesn't this work? I want to take any leading or trailing white spaces > out. > If I remove the remark it works, but I > do not understand why it requires the second line > $string =~ s/^(\s+)(.*)(\s+)$/$2/; snip Because (.*)

regex help

2007-08-02 Thread Tony Heal
Why doesn't this work? I want to take any leading or trailing white spaces out. If I remove the remark it works, but I do not understand why it requires the second line Script: #!/usr/bin/perl use strict; use warnings; my $string = " hello "; print "$string"; print "Tony";

Re: problem using unix gzcat with perl filehandle

2007-08-02 Thread Charlotte Hee
Hi Tom, Yes, that works! I'll have to read up on piped open. thanks very much! Chee On Thu, 2 Aug 2007, Tom Phoenix wrote: Date: Thu, 2 Aug 2007 13:13:14 -0700 From: Tom Phoenix <[EMAIL PROTECTED]> To: Charlotte Hee <[EMAIL PROTECTED]> Cc: beginners@perl.org Subject: Re: problem using unix

Re: problem using unix gzcat with perl filehandle

2007-08-02 Thread Tom Phoenix
On 8/2/07, Charlotte Hee <[EMAIL PROTECTED]> wrote: >open(IN,"$GZCAT $file_location/$input") || die "Cannot read $input\n"; I think you want a piped open: open(IN, "$GZCAT $file_location/$input |") or die "Cannot gzcat '$input': $!"; Hope this helps! --Tom Phoenix Stonehenge Perl Tra

Re: problem using unix gzcat with perl filehandle

2007-08-02 Thread John W. Krahn
Charlotte Hee wrote: Hello All, Hello, I have a set of gzipped files and I would like to unzip and read the contents using perl v5.8 and gzcat. The location of gzcat is '/usr/bin/gzcat' and the filenames are in the format: batch.shares.2007-07-24.gz where the date changes but the rest o

Re: Getting sub routine name as string

2007-08-02 Thread Adriano Ferreira
On 8/2/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > Brown, Rodrick wrote: > > How can I get the subroutine calling name as a string? > > > > Ie. Sub foo { } I would like to get foo back as a string. > > See `perldoc -f caller` Shawn is absolutely right. The builtin "caller" is what you need

Re: Getting sub routine name as string

2007-08-02 Thread Mr. Shawn H. Corey
Brown, Rodrick wrote: How can I get the subroutine calling name as a string? Ie. Sub foo { } I would like to get foo back as a string. See `perldoc -f caller` -- Just my 0.0002 million dollars worth, Shawn "For the things we have to learn before we can do them, we learn by doing them

problem using unix gzcat with perl filehandle

2007-08-02 Thread Charlotte Hee
Hello All, I have a set of gzipped files and I would like to unzip and read the contents using perl v5.8 and gzcat. The location of gzcat is '/usr/bin/gzcat' and the filenames are in the format: batch.shares.2007-07-24.gz where the date changes but the rest of the name is the same. All the

Re: Getting sub routine name as string

2007-08-02 Thread Adriano Ferreira
On 8/2/07, Brown, Rodrick <[EMAIL PROTECTED]> wrote: > > How can I get the subroutine calling name as a string? > > Ie. Sub foo { } I would like to get foo back as a string. Sub::Identify may be useful. http://search.cpan.org/dist/Sub-Identify -- To unsubscribe, e-mail: [EMAIL PROTECTED] For add

Getting sub routine name as string

2007-08-02 Thread Brown, Rodrick
How can I get the subroutine calling name as a string? Ie. Sub foo { } I would like to get foo back as a string. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This message is intended only for the personal and confidential use of the designated rec

DBD::Oracle in 64 bit Linux

2007-08-02 Thread a_arya2000
Hi, I am trying to install DBD::Oracle in a Linux 64 bit machine but facing problem and not sure what i am doing wrong. make looks ok, but when I run make test I get this. --- t/01baseFailed to load Oracle extension and/or shared libraries: install_driver(Or

Re: How do I truncate or remove a trailing character

2007-08-02 Thread Paul Lalli
On Aug 2, 12:11 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > On 8/1/07, Bret Goodfellow <[EMAIL PROTECTED]> wrote: > > > Okay, I know this has to be simple, but because I am trying to truncate > > or remove a special character I've run into a roadblock. Here's what I > > want to do. > > > $value =

Re: Problem with my code

2007-08-02 Thread Chas Owens
On 8/2/07, Mihir Kamdar <[EMAIL PROTECTED]> wrote: > #!/usr/bin/perl > > my $child_path = > '/home/user71/RangerDatasource/Customization/TelekomMalaysia/Scripts/Tests/cprogs/files/child' > ; > my $parent_path = > '/home/user71/RangerDatasource/Customization/TelekomMalaysia/Scripts/Tests/cprogs/fil

Re: a question?

2007-08-02 Thread Chas Owens
On 8/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > can you tell me :"using perl, how a file can be stored into mysql > "? that file is a BUG report , which is made from JUNIT . What do you mean by stored? Is the entire file going to be put into one field, is each line going to go into

a question?

2007-08-02 Thread cuishang
can you tell me :"using perl, how a file can be stored into mysql "? that file is a BUG report , which is made from JUNIT . -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How do I truncate or remove a trailing character

2007-08-02 Thread Chas Owens
On 8/1/07, Bret Goodfellow <[EMAIL PROTECTED]> wrote: > Okay, I know this has to be simple, but because I am trying to truncate > or remove a special character I've run into a roadblock. Here's what I > want to do. > > $value = "12345)" ; > > How do I change $value so that the trailing ")" is remo

Re: Problem with function overloading

2007-08-02 Thread Tom Phoenix
On 7/29/07, I don't like SPAM <[EMAIL PROTECTED]> wrote: > eval "require $moduleName"; Hm. You say this isn't working for you, but you're not checking the value of $@ after the evil eval? (By the way, unless I missed something, that "require" could load your module, if it loads it at all

Re: missing values from files

2007-08-02 Thread Chas Owens
On 8/1/07, Irenta <[EMAIL PROTECTED]> wrote: snip > > >printf (" %6.1f",$fcontentt); > > > > "Use of uninitialized value in printf" means that the value of $fcontentt is > > undef. snip close(GFDLU,GFDLV,GFDLH,GFDLR,GFDLT,GFDLP,LATI,LONI,U10M,V10M,ALLF) > > > > close() can only close *

Re: VMWARE PERL API

2007-08-02 Thread John W. Krahn
Jeff Pang wrote: From: vishnu <[EMAIL PROTECTED]> Im trying to Build an API in perl. I've included path of my installation like: sub BEGIN { push (@INC, ("/usr/lib/vmware-server/perl5/site_perl/5.005/i386-linux", ".")); } It's not sub BEGIN but BEGIN block, BEGIN {

Re: VMWARE PERL API

2007-08-02 Thread Jeff Pang
-Original Message- >From: vishnu <[EMAIL PROTECTED]> >Sent: Aug 2, 2007 10:40 AM >To: beginners@perl.org >Subject: VMWARE PERL API > >To: [EMAIL PROTECTED] > >Hi im new to VMware and PERL > >Im trying to Build an API in perl. > >I've included path of my installation like: > > >sub BEGIN {

Re: VMWARE PERL API

2007-08-02 Thread Mr. Shawn H. Corey
vishnu wrote: Error: -- Can't load '/usr/lib/vmware-server/perl5/site_perl/5.005/i386-linux/auto/VMware/VmPerl/VmPerl.so' for module VMware::VmPerl: /usr/lib/vmware-server/perl5/site_perl/5.005/i386-linux/auto/VMware/VmPerl/VmPerl.so: undefined symbol: PL_sv_undef at /usr/lib/perl/5.8/DynaLoa

VMWARE PERL API

2007-08-02 Thread vishnu
To: [EMAIL PROTECTED] Hi im new to VMware and PERL Im trying to Build an API in perl. I've included path of my installation like: sub BEGIN { push (@INC, ("/usr/lib/vmware-server/perl5/site_perl/5.005/i386-linux", ".")); } use VMware::Control; use VMware::Control::Se

Re: Problem with my code

2007-08-02 Thread Mihir Kamdar
On 8/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Aug 2, 10:48 am, [EMAIL PROTECTED] (Mihir Kamdar) wrote: > > > my $line; > > my %hash; > > my @file; > > my $key ; > > my $value ; > > my %times ; > > You appear to be suffering from a nasty case of premature declaration. > > Looking at

Re: Problem with my code

2007-08-02 Thread [EMAIL PROTECTED]
On Aug 2, 10:48 am, [EMAIL PROTECTED] (Mihir Kamdar) wrote: > my $line; > my %hash; > my @file; > my $key ; > my $value ; > my %times ; You appear to be suffering from a nasty case of premature declaration. Looking at your code it appears that three of those are harmlessly being declared in the

Re: ASCII::Plot::Scatter namespace

2007-08-02 Thread Inventor
On Jul 30, 3:36 pm, [EMAIL PROTECTED] wrote: > Inventor wrote: > > I would like to call it ASCII::Plot::Scatter because it is an ASCII > > scatter plot generator, > > I don't know what that is, but most people strongly associate ASCII (a > character encoding) with Text. Could the module fit under

Re: Problem with my code

2007-08-02 Thread Mr. Shawn H. Corey
Mihir Kamdar wrote: As soon as the data file is updated completely, the tag file is touched with the same name in the child directory. This process is automatic. No manual touching of tag files. As per my requirement, in my code, I am trying to open the child directory, read the tag name, open

Re: missing values from files

2007-08-02 Thread Irenta
On 31 jul, 18:36, [EMAIL PROTECTED] (John W. Krahn) wrote: > Irenta wrote: > > > ok it started working and now that I run it in another computer is > > doing the same thing. I added -w at the top and it is giving me the > > following errors: > > -w will give you warnings not errors. > > > Use of un

Re: Problem with my code

2007-08-02 Thread Mihir Kamdar
On 8/2/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > > Ken Foskey wrote: > > I find this style more 'normal'. > > > > foreach my $key (keys %hash) { > > print $OUT_FILE $hash{$key}; > > } > > > > Or even this to make code predictable: >

Re: parsing a log file by date

2007-08-02 Thread Jay Savage
On 8/1/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > > > -Original Message- > >From: Jay Savage <[EMAIL PROTECTED]> > >Sent: Aug 2, 2007 5:29 AM > >To: Perl List > >Subject: Re: parsing a log file by date > > > >'2 == 2' is a Perl test for numeric equality, which has nothing to do > >with str

Re: Problem with my code

2007-08-02 Thread Mr. Shawn H. Corey
Ken Foskey wrote: I find this style more 'normal'. foreach my $key (keys %hash) { print $OUT_FILE $hash{$key}; } Or even this to make code predictable: foreach my $key (sort keys %hash) { print $OUT

Re: FILEHANDLE problem

2007-08-02 Thread Ken Foskey
On Wed, 2007-08-01 at 15:51 -0400, Johnson, Reginald (GTI) wrote: > I don't see what I am doing wrong here. I am trying to print to the > filehandle LINOUT but nothing is being printed to the file. > Ultimately I want to monitor the input file and when it is written to I > want to take the update a

Re: Problem with my code

2007-08-02 Thread Ken Foskey
On Thu, 2007-08-02 at 17:44 +0530, Mihir Kamdar wrote: ... Have you run it in a debugger and seen what happens? perl -d script The snippet does not actually assign to %hash, I assume it is in the missing code but you should show a sample line from it. > while (($key, $value) =

RE: Problem with my code

2007-08-02 Thread Bob McConnell
> -Original Message- > From: Mihir Kamdar > Sent: Thursday, August 02, 2007 8:15 AM > To: beginners > Subject: Re: Problem with my code > > On 8/2/07, Mihir Kamdar wrote: > > > > > > > > On 8/2/07, Mihir Kamdar wrote: > > > > > > Hi, > > > > > > I have a requirement. There are files in the

Re: Problem with my code

2007-08-02 Thread Mihir Kamdar
On 8/2/07, Mihir Kamdar <[EMAIL PROTECTED]> wrote: > > > > On 8/2/07, Mihir Kamdar <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have a requirement. There are files in the parent directory and they > > are touched in the child directory. So in child directory there are 0 byte > > files having th

Re: Problem with my code

2007-08-02 Thread Mihir Kamdar
On 8/2/07, Mihir Kamdar <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a requirement. There are files in the parent directory and they are > touched in the child directory. So in child directory there are 0 byte files > having the same name as the ones in the parent directory. I need to read > files

Problem with my code

2007-08-02 Thread Mihir Kamdar
Hi, I have a requirement. There are files in the parent directory and they are touched in the child directory. So in child directory there are 0 byte files having the same name as the ones in the parent directory. I need to read files in the child directory, and for each file present in the child

Re: XML to inMemory Hash

2007-08-02 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Prabu Ayyappan wrote: > > > > I want to convert a huge XML file into an inMemory Hash. > > > > I tried using XML::Simple. But its taking huge memory space and time to > > convert it into Hash. > > > > While loading a XML file of 300MB its taking mo

Re: Parsing large XML file

2007-08-02 Thread Jenda Krynicky
From: "Mike Blezien" <[EMAIL PROTECTED]> > we need to parse some very large XML files, approx., 900-1000KB's filesize. A > sample of a typical XML file can be view here that would be parsed: > http://projects.thunder-rain.com/uploads/01.xml I'm probably comming late, but the anyway ... this

Re: Question about XML::Simple [was: XML to inMemory Hash]

2007-08-02 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Thomas Polnik wrote: > > > >> Almost anything is better than XML::Simple, but no module can > >> easily make your data any smaller. > > > > I use XML::Simple without any problems since some years. Which > > problems could I get with with this package? My progra