Re: checking $@

2008-01-02 Thread Dr.Ruud
Chas. Owens schreef: > Dr.Ruud: >> I never understood why checking $@ is done, when checking the eval >> return value itself is available (and it always is, or can be made >> so). >> >> eval { >> ... >> 1; >> } or do { >> ... >> }; >> >> The $@ can be set in man

Memory Usage of my Script

2008-01-02 Thread yitzle
Hi. I've got two scripts I am running and they both consume large amounts of memory (10MB). How would I go about finding where the memory is being used and figuring out how to reduce the memory footprint. Both scripts start off with: #!/usr/bin/perl use warnings; use strict; use WWW::Mechanize; u

Re: Use parentheses in translation strings

2008-01-02 Thread Nihilism Machine
i tried the unsubscribe email and the help email addy for this list, i still cant unsubscribe, the emails produce no results/returned emails etc. ugh. On Jan 2, 2008, at 10:35 AM, Paul Lalli wrote: On Jan 1, 4:20 pm, [EMAIL PROTECTED] wrote: Hi there, I'm quite new to perl, and now having

Re: absolute beginner: perlrefs to "stack" values

2008-01-02 Thread Jenda Krynicky
From: yitzle <[EMAIL PROTECTED]> > IIRC, the stack pointer is part of the operating system, not the C language. > When a subroutine is called, the parameters are pushed to the stack, > and the return value is stored in a specific register. Well ... depends. If you want to call a function provided

Re: Problem with adding a connection with Win32::NetResource

2008-01-02 Thread Jenda Krynicky
From: Nash <[EMAIL PROTECTED]> > Thanks to Rob and purlgurl, who answered me by mail. It turns out > RemoteName was wrong. Nevertheless, it worked when I didn't define > other RemoteShare parameters. Could anyone explain that? > Since I have a shared folder named Nash on computer named Nash, \\\ >

Re: Use parentheses in translation strings

2008-01-02 Thread Nihilism Machine
how do i unsubscribe from this list? On Jan 2, 2008, at 12:14 PM, Tom Phoenix wrote: On Jan 1, 2008 1:20 PM, <[EMAIL PROTECTED]> wrote: I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' w

Re: Use parentheses in translation strings

2008-01-02 Thread Chas. Owens
On Jan 2, 2008 10:48 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Jan 1, 2008 4:20 PM, <[EMAIL PROTECTED]> wrote: > > Hi there, > > > > I'm quite new to perl, and now having problem with using parentheses > > in translation strings. For example, I want to replace the 4 digit > > year code 'yyy

Re: Problem with adding a connection with Win32::NetResource

2008-01-02 Thread Rob Dixon
Nash wrote: > Thanks to Rob and purlgurl, who answered me by mail. It turns out RemoteName was wrong. Nevertheless, it worked when I didn't define other RemoteShare parameters. Could anyone explain that? Since I have a shared folder named Nash on computer named Nash, \\\ \Nash\\Nash did the trick

Re: checking $@ (was: Re: converting text ... to values)

2008-01-02 Thread Chas. Owens
On Jan 2, 2008 5:14 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Chas. Owens" schreef: > > Adarsh Srivastava: > > >> 1. Perl doest seem to catch errors like divide-by-zero error. Eg: > >> for an input expression like 99 / 0, it simply displays nothing as > >> output. (no errors thrown). > > > > Not tr

Re: Use parentheses in translation strings

2008-01-02 Thread Paul Lalli
On Jan 1, 4:20 pm, [EMAIL PROTECTED] wrote: > Hi there, > > I'm quite new to perl, and now having problem with using  parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it can be used for grouping in > string matching later. I e

Re: values of DBI statement handle not getting written into text file

2008-01-02 Thread Tom Phoenix
On Jan 2, 2008 6:21 AM, Siva Prasad <[EMAIL PROTECTED]> wrote: > I have a problem printing values of DBI statement handle into a text file. I have a problem reading your message, since it's all blue. Please, don't do that. > If I print the values in statement handle on the STDOUT I am able to s

Re: Optimization in PERL

2008-01-02 Thread Chas. Owens
On Jan 2, 2008 8:04 AM, Paul Johnson <[EMAIL PROTECTED]> wrote: snip > > 2) Static string Handling > > use single quotes rather than doubles. Double quotes force Perl to look for > > a potential interpolation of information, which adds to the overhead of > > printing out the string. > > Print 'I am

Re: Use parentheses in translation strings

2008-01-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi there, Hello, I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' with '(\d\d\d\d)', so it can be used for grouping in string matching later. I expected the code w

Re: Perl Script for Network bandwidth consumption by a particular Application

2008-01-02 Thread Tom Phoenix
On Jan 2, 2008 12:08 AM, Anirban Adhikary <[EMAIL PROTECTED]> wrote: > but if i want to check network bandwidth consumption by a particular > application i.e. oracle or java by using this script or some other script > written in perl then how to do this? Your Operating System may be able to track

Re: Use parentheses in translation strings

2008-01-02 Thread Tom Phoenix
On Jan 1, 2008 1:20 PM, <[EMAIL PROTECTED]> wrote: > I'm quite new to perl, and now having problem with using parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it can be used for grouping in > string matching later. Wait --

Re: Use parentheses in translation strings

2008-01-02 Thread Martin Barth
hi, you probably want to use s/// instead of tr///. # perl -wle '$_=""; s//(\\d\\d\\d\\d)/; print' (\d\d\d\d) have a look at perldoc perlop to see what tr or y really does: tr/SEARCHLIST/REPLACEMENTLIST/cds y/SEARCHLIST/REPLACEMENTLIST/cds Transliterates al

Re: Use parentheses in translation strings

2008-01-02 Thread Chas. Owens
On Jan 1, 2008 4:20 PM, <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm quite new to perl, and now having problem with using parentheses > in translation strings. For example, I want to replace the 4 digit > year code '' with '(\d\d\d\d)', so it can be used for grouping in > string matching la

checking $@ (was: Re: converting text ... to values)

2008-01-02 Thread Dr.Ruud
"Chas. Owens" schreef: > Adarsh Srivastava: >> 1. Perl doest seem to catch errors like divide-by-zero error. Eg: >> for an input expression like 99 / 0, it simply displays nothing as >> output. (no errors thrown). > > Not true. If you aren't seeing the errors then you aren't checking $@ > like I

values of DBI statement handle not getting written into text file

2008-01-02 Thread Siva Prasad
Hi gurus, I have a problem printing values of DBI statement handle into a text file. The detail problem is as bellows: I am sending a query to one of the subroutines of a package and getting the statement handle with return statement If I print the values in statement handle

Re: Problem with adding a connection with Win32::NetResource

2008-01-02 Thread Nash
Thanks to Rob and purlgurl, who answered me by mail. It turns out RemoteName was wrong. Nevertheless, it worked when I didn't define other RemoteShare parameters. Could anyone explain that? Since I have a shared folder named Nash on computer named Nash, \\\ \Nash\\Nash did the trick. Tried answerin

Re: Optimization in PERL

2008-01-02 Thread Paul Johnson
On Tue, Jan 01, 2008 at 09:11:58PM -0800, Prabu Ayyappan wrote: > Hi All, > Below are some of the way to optimize the perl code. You can add more to > this if you have something more. Just a few comments ... > 1) use a reference instead of the variable directly > Use reference in passing large a

Re: Optimization in PERL

2008-01-02 Thread John W. Krahn
Prabu Ayyappan wrote: Hi All, Hello, Below are some of the way to optimize the perl code. You can add more to this if you have something more. perldoc -q "How can I make my Perl program run faster" perldoc -q "How can I make my Perl program take less memory" perldoc -q "How can I free an

Re: absolute beginner: perlrefs to "stack" values

2008-01-02 Thread groups spamtrap
thanks everyone a lot, you cleared up any doubt, *very* insightful have a wonderful happy new year! On Jan 1, 2008 8:36 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Jan 1, 2008 2:32 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > snip > > You can deal with this by using the anonymous arrayref g

Use parentheses in translation strings

2008-01-02 Thread yellowbluetest
Hi there, I'm quite new to perl, and now having problem with using parentheses in translation strings. For example, I want to replace the 4 digit year code '' with '(\d\d\d\d)', so it can be used for grouping in string matching later. I expected the code would be like: $org_str =~ tr//\(

Re: Optimization in PERL

2008-01-02 Thread Randal L. Schwartz
> "Prabu" == Prabu Ayyappan <[EMAIL PROTECTED]> writes: Prabu> Below are some of the way to optimize the perl code. You can add more Prabu> to this if you have something more. How about subtract from things that are wrong? Prabu> 2) Static string Handling Prabu> use single quotes rather than

Perl Script for Network bandwidth consumption by a particular Application

2008-01-02 Thread Anirban Adhikary
Hi Firstly a warm wish to all of u guys a very happy new year 2008. I have written a script that will check the total usage of network from eth0 and total number of concurrent connection established from eth0. The syntax of usage of this code is following perl network.pl eth0 and it produces th

Perl Script for Network bandwidth consumption by a particular Application

2008-01-02 Thread Anirban Adhikary
Hi Firstly a warm wish to all of u guys a very happy new year 2008. I have written a script that will check the total usage of network from eth0 and total number of concurrent connection established from eth0. The syntax of usage of this code is following perl network.pl eth0 and it produces th

Re: converting text expressions (like "1+1") to values

2008-01-02 Thread Chas. Owens
On Jan 2, 2008 12:06 AM, Adarsh Srivastava <[EMAIL PROTECTED]> wrote: > > Hello, > > Thanks a lot Chas, Jenda , Venkat...the solution (eval)works fine, now > that I have implemented it. There seem to be some issues though: > > 1. Perl doest seem to catch errors like divide-by-zero error. Eg: for an

Optimization in PERL

2008-01-02 Thread Prabu Ayyappan
Hi All, Below are some of the way to optimize the perl code. You can add more to this if you have something more. 1) use a reference instead of the variable directly Use reference in passing large arrays in a function call. Because without a reference it will copy the entire array or hash onto th

RE: converting text expressions (like "1+1") to values

2008-01-02 Thread Adarsh Srivastava
Hello, Thanks a lot Chas, Jenda , Venkat...the solution (eval)works fine, now that I have implemented it. There seem to be some issues though: 1. Perl doest seem to catch errors like divide-by-zero error. Eg: for an input expression like 99 / 0, it simply displays nothing as output. (no errors t