Perl CGI: accessing a element value from the current form

2009-06-01 Thread Ravi Malghan
Hi: I have web page built using perl cgi. Generated page has the following element admin Within the perl script is there a way to access the value of the element userName and assign it to a variable? Something along the lines $currentUser = ; Thanks Ravi -- To unsubscribe, e-ma

Perl DBI->Connect: how to detect a a lost connection

2008-07-20 Thread Ravi Malghan
Hi: I have a script which connects to a database when it starts up $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;","$username", "$password", {AutoCommit => 1}); followed by a while loop which runs a query for this connection at 60 second intervals. If the database goes down for

Perl how to die without printing out a message?

2008-07-02 Thread Ravi Malghan
Hi: I connect to a database within my script. If the script cannot connect, I want it to send an email and terminate without printing any message on stdout. I have the following code   $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;","$username", "$password", {AutoCommit => 1}

Re: including LD_LIBRARY_PATH within a script

2008-06-25 Thread Ravi Malghan
ferent if your hosting use windows or linux. On Wed, Jun 25, 2008 at 1:47 PM, Ravi Malghan <[EMAIL PROTECTED]> wrote: > Hi: I have a script which runs fine when I run it from the shell prompt. But > when I run it from within another application, I get the following error > > C

including LD_LIBRARY_PATH within a script

2008-06-25 Thread Ravi Malghan
Hi: I have a script which runs fine when I run it from the shell prompt. But when I run it from within another application, I get the following error Can't load '/usr/local/lib/perl5/site_perl/5.8.7/sun4-solaris/auto/ARS/ARS.so' for module ARS: ld.so.1: perl: fatal: libicudatabmc.so.32: open fa

[RESOLVED]Re: How to find version of a module

2008-06-23 Thread Ravi Malghan
nm. I was able to get the version by running perl -MDBD::Oracle -e 'print "$DBD::Oracle::VERSION\n"' Thanks - Original Message ---- From: Ravi Malghan <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Monday, June 23, 2008 6:47:07 AM Subject: How to find version

How to find version of a module

2008-06-23 Thread Ravi Malghan
How do I find out the version of DBD:Oracle module that is installed with my perl? If I install another version, will it overwrite everything that is related to the older module? Thanks Ravi -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Out of memory! Callback called exit. END failed--call queue aborted

2008-06-22 Thread Ravi Malghan
Hi: I have a simple script which connects to a few databases. When I run the script I get the "Out of memory! Callback called exit. END failed--call queue aborted." error. It runs fine on other similar machines. Below is an example. As soon as I add the 3rd database connection it starts giving m

Regex help

2008-06-20 Thread Ravi Malghan
Hi: I am trying to extract some stuff from a string and not getting the expected results. I have looked through http://www.perl.com/doc/manual/html/pod/perlre.html and can't seem to figure this one out. I have a string which is a sequence of words and each item is comma seperated field1, lengtho

Re: Including the carriage return in extraction

2008-06-16 Thread Ravi Malghan
.Ruud <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Sunday, June 15, 2008 8:55:31 PM Subject: Re: Including the carriage return in extraction Ravi Malghan schreef: > Hi: I want to extract data between the first parenthesis and the last > in the below variable. I have tried a numbe

Including the carriage return in extraction

2008-06-15 Thread Ravi Malghan
Hi: I want to extract data between the first parenthesis and the last in the below variable. I have tried a number of combinations. I either miss the entire string or get data only until the first carriage return. Can someone help me to extract the data including the carriage return between the

Perl MQSeries API newbie help

2008-05-09 Thread Ravi Malghan
Hi: I have very little knowledge about MQ Series. I have built the MQ Client and MQSeries perl API on my server. My MQ admin also has provided me the name of ques, queue manager, MA CHannel, hostname and port. I am trying to build a simple script that will connect to a que and fetch messages. I

Perl Expect help

2008-05-02 Thread Ravi Malghan
Hi: I am trying to build a simple perl/expect program which will telnet, run a command and provide me the result of the command in a string or array to process within the script. I have gotten so far as the script telnets, runs the command the prints the result in stdout. I can't seem to figure

Building/defining variables from an value in string

2008-04-22 Thread Ravi Malghan
Hi: I have a string with a number of variable name, type and value pairs. I want to split the field and build my variables. Below is an example $string = "field1,int,10#field2,string,abc"; @values = split(/#/,$string); I want to get two variables from the string, equivalent to the below statemen

How to check integrity of a webpage from perl

2007-07-27 Thread Ravi Malghan
Hi: I am looking to build a script that can go to a webpage, login with a username/password, download a page, perform a checksum comparison. Two things I am trying to accomplish. 1. Is the website is up 2. Has the website been compromised. I found a number of pointers when I googled some string

Re: [RESOLVED]Unable to run perl script within cron

2007-06-20 Thread Ravi Malghan
I had to set the LD_LIBRARY_PATH in the cron as following 0,5,10,15,20,25,30,35,40,45,50,55 * * * * LD_LIBRARY_PATH=/export/home/netcool/oracle/instantclient_10_2:/usr/arsapi/lib:/usr/local/lib /exp ort/home/netcool/lookForNewRequests.pl - Original Message From: Ravi Malghan <[EM

Unable to run perl script within cron

2007-06-20 Thread Ravi Malghan
Hi: I have a script which runs fine when I run it from the shell prompt. My LD_LIBRARY_PATH in the shell is as shown below bash-2.05$ env |grep LD_LIBRARY_PATH LD_LIBRARY_PATH=/export/home/netcool/oracle/instantclient_10_2:/usr/arsapi/lib:/usr/local/lib But the same script when I run from cronta

Help with compiling perl DBD using Oracle Instant client

2007-06-18 Thread Ravi Malghan
Hi: I have installed the oracle instant client and trying to install DBD-Oracle. When I run perl MakeFile, I get the following. = Using Oracle in /export/home/netcool/oracle DEFINE _SQLPLUS_RELEASE = "1002000300" (CHAR) Oracle version 10.2.0.3 (10.2) Unable to locate

dynamic loading option?

2007-06-14 Thread Ravi Malghan
A module is requiring that my perl be compiled with dynamic loading. I have installed perl from a binary. How do I figure out if my perl has the dynamic loading option? bash-2.05$ perl -V Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Platform: osname=solaris, osver

Installing module for a user who doesn't own perl

2007-04-19 Thread Ravi Malghan
Hi: I am user (non-root user) on a UX system. I want to use a module (FIle::Tail) but donot have permissions to install it under the perl since perl is owned by root user. Is there any way I can install this under my home directory and use it with the perl on the system? Maybe somewhere when I

how to pass double quotes in a url from CGI script

2007-03-29 Thread Ravi Malghan
Hi: I am having trouble passing double quotes when passing a url string. Everything after the double quotes does not go through. For example in the perl script below, the browser ends up going to http://appserver/arsys/forms/rearsp01/HPD%3AHelp+Desk/Default+User+View/?&qual='TRS%20Ticket%20Numbe

Re: help with array within another array

2007-02-27 Thread Ravi Malghan
anks Ravi --- Neal Clark <[EMAIL PROTECTED]> wrote: > ah. well in that case > > @SESSION = ( \%nodeowner, \%nodeseverity ); > > On Feb 27, 2007, at 11:59 AM, Ravi Malghan wrote: > > > One correction: SESSION is just a single > dimensional > > array @SESSIO

Re: help with array within another array

2007-02-27 Thread Ravi Malghan
One correction: SESSION is just a single dimensional array @SESSION. Thanks Ravi --- Ravi Malghan <[EMAIL PROTECTED]> wrote: > Hi: I just can't seem to figure this out. > I am trying to declare two associative array > (%nodeowner and %nodeseverity) within another array > c

help with array within another array

2007-02-27 Thread Ravi Malghan
Hi: I just can't seem to figure this out. I am trying to declare two associative array (%nodeowner and %nodeseverity) within another array called %SESSION For example %nodeowner = ("node1", "john", "node2", "nancy"); %nodeseverity = ("node1", 5, "node2", 10); How do I declare %SESSION containing

Re: Limit of number of files that can be opened in perl

2006-12-02 Thread Ravi Malghan
I am opening the files $AgentFH{$id} = *$name; open($AgentFH{$id}, ">>$filename"); I am speaking to the system admin if he can bump up the limit to 1024. Any other thoughts? TIA Ravi - Original Message From: Tom Phoenix <[EMAIL PROTECTED]> To: Ravi Malghan

Re: Limit of number of files that can be opened in perl

2006-12-01 Thread Ravi Malghan
Friday, December 1, 2006 10:16:58 PM Subject: Re: Limit of number of files that can be opened in perl Ravi Malghan wrote: > Hi: is there a limit on number of files that can be open within > perl. I am opening about 194 files and am seeing some weird > behaviour. When i write to the filehandles,

Limit of number of files that can be opened in perl

2006-12-01 Thread Ravi Malghan
Hi: is there a limit on number of files that can be open within perl. I am opening about 194 files and am seeing some weird behaviour. When i write to the filehandles, I see it writes ok to some files and not to the others. But I donot see any errors either. Just that somefiles donot have what I

How to create a string from value of another variable.

2006-11-29 Thread Ravi Malghan
Hi: I have a variable called $agent_id and want to create a string with the value of $agent_id followed by "-str". The following does not seem to work. The following example I want to create a variable called $35-str. $agent_id = 25; $agent_id."-str" = "This is test\n"; I get the following erro

Perl DBI Oracle: Multiple statements

2006-11-27 Thread Ravi Malghan
Hi: Not sure if this is the right place to post this question. My dba has asked to execute a alter statement before the select statement in a perl script. So I need to run the following. Supposedly the alter statement, helps run the select sql run faster. alter session set db_file_multiblock_re

How to check if a mount point exists.

2006-11-16 Thread Ravi Malghan
Hi: I writing some logs into a directory which is mounted. >df -k 199.11.255.50:/vol/rawdata 335544320 18471160 317073160 6%/actuate/rawdata > Is there a way to check within perl if the mount point exists before I write? Thanks ray -- To unsubscribe, e-mail: [EMA

Including code from a file into the main script if the file exists

2006-09-16 Thread Ravi Malghan
Hi: I have a script called main.pl. I want to include few lines of code from another file called user.rules if it exists. I have tried using the require statement to do that as shown below within the main.pl. if (-e "/opt/user.rules") { require "/opt/user.rules"; } I get the following error /

How to test result of an extraction?

2006-04-27 Thread Ravi Malghan
Hi: I am extracting some value from $complete_event as follows. What can I check to see if the extraction returned a valid value? "if($_)" seems to be giving incorrect values. In the following statement, $srcIp is being set to an old extracted value if there is no valid value following srcIP in my

Perl/Syslog: openlog is very slow in sending syslog message

2006-03-21 Thread Ravi Malghan
Hi: I am trying to use the following lines in a program where I want to log syslog messages. == openlog($zone, 'ndelay','local7'); syslog('debug', $log); closelog; == But the function openlog takes 30-40 seconds to complete. Any idea why it takes this long and also if there is a wa

Perl/Syslog: how to control the hostname in the syslog file?

2006-02-14 Thread Ravi Malghan
Hi: I have created a simple script to log syslog messages with the following lines openlog('lab-sensor', 'cons,ndelay,nowait','local7'); syslog('debug', 'this is a test message'); When I run this locally (local hostname: nms02), the following message shows up in the syslog file. Feb 14 16:50:37

[RESOLVED]Re: help with adding strings that are floating point numbers

2006-02-14 Thread Ravi Malghan
Thanks --- JeeBee <[EMAIL PROTECTED]> wrote: > > Just do $result = $var1 + $var2; > int returns the integer part of a number, > see: perldoc -f int > > JeeBee > > On Tue, 14 Feb 2006 07:04:18 -0800, Ravi Malghan > wrote: > > > Hi: I think this is ver

help with adding strings that are floating point numbers

2006-02-14 Thread Ravi Malghan
Hi: I think this is very trivial, but just can't seem to figure it out. I have two strings $var1 = "0.12" and $var2 = "0.3". I want to add these two and have 0.42 in $result, but $result = int($var1) + int($var2) always results to 0? What am I doing wrong. Thanks Ray ___

Recommendation for a XML Parser defined against a DTD?

2005-06-17 Thread Ravi Malghan
Hi: I have a bunch of xml files defined against a DTD. I want to parse them. I googled for perl XML reader modules and found lots of them. Anybody have used specific ones and have recommendations? Thanks Ravi __ Do You Yahoo!? Tired of spam? Yahoo!

help with perl/cgi creating a html code with pull down menu

2004-10-17 Thread Ravi Malghan
Hi: I have created a perl cgi script to grab two string inputs from users. The script shown below expects the user to type in the value. I would like to change this and give the user a pulldown menu to pick from a list of items. Could somebody provide help with what I need to change. =

collecting data from a TL1 devices

2004-03-17 Thread Ravi Malghan
Hi: has anybody built a perl scripts to receive data from multiple TL1 devices and process them? Is there a module? Or any other suggestions on how this can be done. Thanks Ravi __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yaho

upgrading perl to 5.6 from 5.005_03 question?

2004-02-02 Thread Ravi Malghan
Hello: I have perl 5.005_03 on solaris 2.8 which was installed with the OS. I would like to upgrade it to 5.6. Should I pkgrm the existing perl before I install the new perl ? or is there any other recommended way to upgrade. Thanks Ravi __ Do you Yahoo!? Yahoo! Si

Re: Array creation with a existing variable

2004-01-24 Thread Ravi Malghan
Wiggins: basically what I was trying to do is track a counter value for each router in my network. These routers may come and go. At some time I may have 10 routers at other times 100. $Counter{$router1} = {n1, n2, n3, ...nN} $Counter{$router2} = {m1, m2, m3, ...mN} ... $Counter{$routerX} = I

Re: Array creation with a existing variable

2004-01-23 Thread Ravi Malghan
I may have found the answer, I could use @{$Counter{$router}} . I will try this. Thanks Ravi --- Ravi Malghan <[EMAIL PROTECTED]> wrote: > True. Since the value(s) for @Counter$router is > going > to be array, manipulating that hash was making > things > complex for me.

Re: Array creation with a existing variable

2004-01-23 Thread Ravi Malghan
True. Since the value(s) for @Counter$router is going to be array, manipulating that hash was making things complex for me. If I use a hash (%Counter), what do I have to do such that the resulting value for $Counter{$router} is an array. Thanks Ravi --- Wiggins d Anconia <[EMAIL PROTECTED]> wrote

Array creation with a existing variable

2004-01-23 Thread Ravi Malghan
Hi: I have a existing variable called $router which is "192.168.1.1". I want to create a array which looks like @Counter192.168.1.1. @Counter.$router does not seem to work. Thanks in advance Ravi __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool

splitting a string

2003-12-10 Thread Ravi Malghan
Hi: I want to split the string 0.0.0.0.1.10.1.30.1.10.1.30.1 into 4 variables: 0.0.0.0, 1, 10.1.30.1 and 10.1.30.1 any suggestions? TIA ravi __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ -- To unsubscribe, e-mail:

Re: Capturing system call output value

2003-11-15 Thread Ravi Malghan
http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq8/How_can_I_capture_STDERR_from_an_externa.html --- [EMAIL PROTECTED] wrote: > Can someone help me with capturing an output of a > system() call? > > ie ($a)=system("uname -n"); > > where $a would have the output value. > > thanks > > > --

copying a multidimensional array

2003-11-13 Thread Ravi Malghan
Hi: whatz the best way to copy an multidimensional array onto another. I have never used something like clone, just want to know whatz the easiest route. Thanks Ravi __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/wha

Accesing hash of hashes

2003-11-12 Thread Ravi Malghan
Hello: I am trying to create and access a multidimensional hash. For example the following works == $route {$routeDest} = $cost ; print "$routeDest, Cost: $route{$routeDest}\n" = But the following does not print the $route{$NODE}{$routeDest} == $route {$NODE}{$routeDest} = $cost;

beginners@perl.org

2003-04-01 Thread Ravi Malghan
Hi: I am using a statement currently as follows if(($node =~ /ma/) && ($node =~ /ny/)) Using the following statement does not seem to be giving expected results if($node =~ /(ma&&ny)/ where as: if(($node =~ /ma/) | ($node =~ /ny/)) is same as if($node =~ /(ma|ny)/) Thanks Ravi

use of "?" operator instead of "if"

2003-04-01 Thread Ravi Malghan
Hi: I have this statement which checks for existence of the $VAL variable and performs certain actions if($VAL){ $VAL = "$VAL:$expr"; } else { $VAL = "$expr"; } Can this 4 line statement be reduced to a single line using "?" operator? Thanks Ravi ___

question about || operator

2003-03-31 Thread Ravi Malghan
Hello: I seem to have forgotten Can this statement be shortened if(($node =~ /net/) || ($node =~ /gaat/)) The following does not give me the expected results if($node =~ (/net/ || /gaat/) ) TIA Ravi __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' N