getting shell environment varibale in perl after sourcing a file

2005-09-25 Thread Manish Sapariya
Hi all, I have some SHELL environment file which I need to get the variable from and use it my perl script. As I understand, the ENV hash will be populated using the environment of the shell that I have executed the perl script from. Is there any way for me to update the ENV hash by sourcing som

Re: how do I grep and have the matched single line in perl variable

2005-09-23 Thread Manish Sapariya
interpret the perl-grep man page. Thanks for help. Regards, Manish On 09/23/2005 06:59 PM, Jeff 'japhy' Pinyan wrote: On Sep 23, Manish Sapariya said: I want to have pure perl equivalent of following: my $out = `my_utility | grep manish`; which will give me the lines containing

how do I grep and have the matched single line in perl variable

2005-09-23 Thread Manish Sapariya
I want to have pure perl equivalent of following: my $out = `my_utility | grep manish`; which will give me the lines containing manish in the output of my_utility in variable $out. - my $out = doMyUtility(); # I dont know how to now grep on $out and process it the ma

reusing DBI statement handle

2005-09-23 Thread Manish Sapariya
In following db functions I am using returned "statement handle " and afterword just ignoring it and overwrite it with the newly returned value. Does this cause memory leak/ or any kind of resouce leak? Can I reuse statement handle in such a way? If not, what is cleaner way to do it? ---

Re: getopt long behaviour

2005-09-09 Thread Manish Sapariya
Oh, my understanding is that when I specify "output=s" its a mandatory parameter and if not specified on command line, GetOptions should return error. Am i missing something? Thanks, Manish On 09/09/2005 05:56 PM, Chris Devers wrote: On Fri, 9 Sep 2005, Manish Sapa

Re: getopt long behaviour

2005-09-09 Thread Manish Sapariya
Oh, my understanding is that when I specify "output=s" its a mandatory parameter and if not specified on command line, GetOptions should return error. Am i missing something? Thanks, Manish On 09/09/2005 05:56 PM, Chris Devers wrote: On Fri, 9 Sep 2005, Manish Sapariya wrote:

getopt long behaviour

2005-09-09 Thread Manish Sapariya
Shouldn't following snippet throw error message when it is called without any parameter? I can't see any error messsage, why? # /tmp/test.pl Executed successfully # -- #!/usr/bin/perl use Getopt::Long; GetOptions("verbose" => \$verbose, "debug"=> \$d

Re: perl message passing module

2005-06-29 Thread Manish Sapariya
newsgroup, but didnt get any reply. Thanks for the help. Regards, Manish On 06/28/2005 10:12 PM, Wiggins d'Anconia wrote: Manish Sapariya wrote: Hi List, Am looking for some messaging module, using which I can pass message between, perl programs. Looked at search CPAN, and found ebXML

perl message passing module

2005-06-28 Thread Manish Sapariya
Hi List, Am looking for some messaging module, using which I can pass message between, perl programs. Looked at search CPAN, and found ebXML. Any comments on ebXML, or any other messaging module will be of great help. Thanks, Manish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: route STDOUT to file

2005-06-27 Thread Manish Sapariya
I use screen as my tool to deal with unstable network connection. Its command line version of vncviewer. Screen dameon allows me to reconnect the previously opened screen, if I by mistake detache or exit the current shell, or network forces my connection down. I assume a non-perlish solution wil

digging into the perl Mime::Entity modules....

2005-05-18 Thread Manish Sapariya
While using MIME::Entity smtpsend method I ran across some problem and wanted to add some debug messages in the module code. To my surprise the smtpsend() subroutine in the Internet.pm never gets called by the perl code. However subrouting in following ./lib/perl5/site_perl/5.8.5/auto/Mail/Inter

Re: is there be better way to write regex for

2005-05-18 Thread Manish Sapariya
Hi Ing, example u gave compiles well and after diffing your and my code it shows that the single quotes in my $ip = '((?:\d{1,3}\.){3}\d{1,3})' made the code compile. Thanks for the help. Regards, Manish On 05/18/2005 02:49 PM, Ing. Branislav Gerzo wrote: Manish Sapariya [MS], on Wedn

Re: is there be better way to write regex for

2005-05-18 Thread Manish Sapariya
ssfully. Thanks and Regards, Manish On 05/17/2005 07:54 PM, Ing. Branislav Gerzo wrote: Manish Sapariya [MS], on Tuesday, May 17, 2005 at 17:38 (+0530) has on mind: MS> echo "1: 192.168.0.180:32866 - 192.168.0.183:143 (a2b) MS> 17> 14< (complete)" | perl -lane 'pr

Re: is there be better way to write regex for

2005-05-18 Thread Manish Sapariya
mplex i run into syntax problems. Thanks and Regards, Manish On 05/17/2005 07:54 PM, Ing. Branislav Gerzo wrote: Manish Sapariya [MS], on Tuesday, May 17, 2005 at 17:38 (+0530) has on mind: MS> echo "1: 192.168.0.180:32866 - 192.168.0.183:143 (a2b) MS> 17> 14< (complete)" | perl

Re: is there be better way to write regex for

2005-05-18 Thread Manish Sapariya
mplex i run into syntax problems. Thanks and Regards, Manish On 05/17/2005 07:54 PM, Ing. Branislav Gerzo wrote: Manish Sapariya [MS], on Tuesday, May 17, 2005 at 17:38 (+0530) has on mind: MS> echo "1: 192.168.0.180:32866 - 192.168.0.183:143 (a2b) MS> 17> 14< (complete)" | perl

is there be better way to write regex for

2005-05-17 Thread Manish Sapariya
Hi List, I have following regex: echo "1: 192.168.0.180:32866 - 192.168.0.183:143 (a2b) 17> 14< (complete)" | perl -lane 'print$_;if($_ =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5}) - (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})/) {print "Source IP = $1, Source Port = $2, Destinati

core in perl??? i am not sure where to report this...

2005-04-26 Thread Manish Sapariya
[EMAIL PROTECTED] gdb /usr/bin/perl core.24670 GNU gdb Red Hat Linux (5.2.1-4) Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying"

Re: setting PERL5LIB path

2005-04-26 Thread Manish Sapariya
k into the local libs but didnt use them did i miss something?? Thanks, Manish On 04/18/2005 04:49 PM, Zentara wrote: On Mon, 18 Apr 2005 10:42:04 +0530, [EMAIL PROTECTED] (Manish Sapariya) wrote: Hi, So can't I set PERL5LIB so that the perl will search first my local lib directory and

Re: getting file name/line num info

2005-04-26 Thread Manish Sapariya
Thanks, I did not realize that (caller) is a function call and [1,2] was a slicing operation. Thanks for the info. Regards, Manish On 04/25/2005 08:49 PM, Jay Savage wrote: On 4/25/05, Manish Sapariya <[EMAIL PROTECTED]> wrote: Hello, Can somebody explain me the magic here sub

getting file name/line num info

2005-04-25 Thread Manish Sapariya
Hello, Can somebody explain me the magic here = sub vprint (@) { return unless $Utils::verbose; my ($file, $line) = (caller)[1,2]; my $subr = (caller 1)[3] || 'main'; $file =~ s!.*/!!; print STDERR "$subr($file:$line): ", @_; } What wo

Comparing results of type unknown

2005-04-22 Thread Manish Sapariya
Hi List, I want to compare the two rows of db result returned by query using DBI module. If I simply use != operator it gives me error when comparing the columns which are of char type. Does there exist anyway wherein I can do one liner compare irrespective of data types? OR checking the column nam

Re: using reference to the fetched rows

2005-04-22 Thread Manish Sapariya
ake a reference to an element. See also "bind_columns". = Thanks anyways, :-) -Manish On 04/22/2005 11:27 AM, Manish Sapariya wrote: Hi list, When using DBI module as, my $return_list = $sth->fetchrow_arrayref; Can I copy the reference to some other variable say, e.g

using reference to the fetched rows

2005-04-22 Thread Manish Sapariya
Hi list, When using DBI module as, my $return_list = $sth->fetchrow_arrayref; Can I copy the reference to some other variable say, e.g. my $CopyOfResult = $return_list; and do another query using the same handle and use $CopyOfResult and $return_list? My question is how does perl will release the m

Re: setting PERL5LIB path

2005-04-18 Thread Manish Sapariya
n the default version installed by perl. And I dont want to upgrade the system modules and still use the newer once to be used by CPAN modules. Thanks, Manish On 04/15/2005 06:23 PM, Zentara wrote: On Thu, 14 Apr 2005 18:27:23 +0530, [EMAIL PROTECTED] (Manish Sapariya) wrote: Hi List, I have default

Re: Passing array as refer ?

2005-04-18 Thread Manish Sapariya
Hi John, &printlist([EMAIL PROTECTED]); ^ You probably don't need the special behaviour that the ampersand provides. What special does '&' provide?? How do I find the exact help regarding this kind of usage in perldoc? Thanks, Manish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

setting PERL5LIB path

2005-04-14 Thread Manish Sapariya
Hi List, I have default MIME module installed and I have installed the lated version in one of my own directory. Any my perl code needs the latest version which I have installed in local_perl_lib. How do I instruct perl interpreter to use the latest one in the $PERL5LIB and not the one in the defau

Re: sub declarations

2005-04-09 Thread Manish Sapariya
Noria wrote: On Apr 7, 2005, at 14:47, Manish Sapariya wrote: Hi List, Can anybody tell me difference among all of the following sub declaration. 1. sub abc {} 2. sub xyz() {} # Please not round brackets, When I had this definition, I got following error. The former is a regular subroutine

sub declarations

2005-04-08 Thread Manish Sapariya
Hi List, Can anybody tell me difference among all of the following sub declaration. 1. sub abc {} 2. sub xyz() {} # Please not round brackets, When I had this definition, I got following error. - Too many arguments for main::smtp at ./gencap.pl line 201, near "$temp_capfile)

Re: Converting a retruned string value to a number

2005-04-07 Thread Manish Sapariya
t;$mail->findvalue('loopcount')"; 124 if($loopcount == 0) {$loopcount = 1}; So is that the value returned by findvalue is not string and something else. Thanks and Regards, Manish On 04/06/2005 09:41 PM, Offer Kaye wrote: On Apr 6, 2005 5:17 PM, Manish Sapariya wrote: Hi Li

Re: Converting a retruned string value to a number

2005-04-07 Thread Manish Sapariya
. Is it the problem with my mail client. I am using ThunderBird. I have not still seen my last two messages. :-(. On 04/06/2005 09:41 PM, Offer Kaye wrote: On Apr 6, 2005 5:17 PM, Manish Sapariya wrote: Hi List, How do i convert a string variable returned by some XPath API into a number so that I can

Re: Converting a retruned string value to a number

2005-04-07 Thread Manish Sapariya
anks and Regards, Manish On 04/06/2005 09:41 PM, Offer Kaye wrote: On Apr 6, 2005 5:17 PM, Manish Sapariya wrote: Hi List, How do i convert a string variable returned by some XPath API into a number so that I can compare it or loop using this number. I am reading one number from XML and I want t

Converting a retruned string value to a number

2005-04-06 Thread Manish Sapariya
Hi List, How do i convert a string variable returned by some XPath API into a number so that I can compare it or loop using this number. I am reading one number from XML and I want to use it for looping. Thanks and Regards, Manish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

a module query

2005-04-06 Thread Manish Sapariya
Hi List, Can somebody throw some light on what the following code snippet is doing... == @Utils::ISA = qw(Exporter); @Utils::EXPORT = qw(set_verbose vprint logmsg convert_size ip2int int2ip time2str); ===

XML::XPath query

2005-04-05 Thread Manish Sapariya
Hi List, I doing XML for the first path and got the things as I wanted using XPath. However only one thing I cannot figure out is how do I get Telephone number in a separate list. What the module returning to me is concatenated list of Telephone number and I have to add extra delimiter " " (space)

t/ framework

2005-03-31 Thread Manish Sapariya
Hi there, I frequently come across this "module uses the t/ framework". What its all about? What functionality does it provide? Thanks, Manish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

ideintifying whether a module is already installed or not

2005-03-27 Thread Manish Sapariya
Hi list, How do I know whether a given module is installed on machine or not? Thanks and Regards, Manish -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]