Browsing a site and checking/posting webmail using perl...

2004-08-03 Thread Sanjay Arora
I am using RH9, postgreSQL and perl5. I would like to get my system to automatically visit a site, go to the login url, login, browse to the mail/messages link and get the messages one by one and save them in a postgreSQL database. Also, I would like my system to post messages from the database

Finding out about perl installation on your machine..

2004-08-03 Thread Sanjay Arora
Hi I am a newbie to perl. Am using RH9. Perl has been installed by RH anaconda at Linux install time. I would like to find out what perl modules are installed on my machine. How do I do that? With best regards. Sanjay. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: finding Makefiles which containing a backslash continuation character where the next line is blank or whitespace

2004-08-03 Thread John W. Krahn
Ken Wolcott wrote: Hi; Hello, I need to find Makefiles that contain a backslash line continuation character followed by a blank (or whitespace only) line. I tried a regular expression first but just couldn't get it right. I then tried comparing by a pair of strings, but that isn't right either.

RE: finding out what is uninitialized

2004-08-03 Thread Charles K. Clarkson
From: Tim McGeary wrote: : I don't get any errors either with the sample.pl and : sample files. So I wonder if the data is bad in the : middle of the file. I guess that has to be it since : I get the errors with sample.pl and the full data file. : : What is the best w

Module to merge arbitrary multi-level data structures?

2004-08-03 Thread Randy W. Sims
Does anyone know of a module that can take a reference to two arbitrarily organized data structures, and return a merged structure? Thanks, Randy. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: finding out what is uninitialized

2004-08-03 Thread Gunnar Hjalmarsson
Tim McGeary wrote: I don't get any errors either with the sample.pl and sample files. So I wonder if the data is bad in the middle of the file. I guess that has to be it since I get the errors with sample.pl and the full data file. There is no way line 136 can result in an "uninitialized" warning

Re: finding out what is uninitialized

2004-08-03 Thread Tim McGeary
I don't get any errors either with the sample.pl and sample files. So I wonder if the data is bad in the middle of the file. I guess that has to be it since I get the errors with sample.pl and the full data file. What is the best way to redirect that bad data to a different file or array? Tim

RE: finding out what is uninitialized

2004-08-03 Thread Charles K. Clarkson
Charles K. Clarkson wrote: : From: Tim McGeary wrote: : : : I am still having an error, though. Should I send my full : : data file? It's a bit large. : : Send it to me off-list. After receiving the file I get three errors. Which, a

RE: finding out what is uninitialized

2004-08-03 Thread Charles K. Clarkson
From: Tim McGeary wrote: : I am still having an error, though. Should I send my full data : file? It's a bit large. Send it to me off-list. HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: finding out what is uninitialized

2004-08-03 Thread Tim McGeary
I am still having an error, though. Should I send my full data file? It's a bit large. Tim Tim McGeary Senior Library Systems Specialist Lehigh University 610-758-4998 [EMAIL PROTECTED] Charles K. Clarkson wrote: Tim McGeary <[EMAIL PROTECTED]> wrote: : The blank line was my mistake of pulling a

RE: finding out what is uninitialized

2004-08-03 Thread Charles K. Clarkson
Tim McGeary <[EMAIL PROTECTED]> wrote: : The blank line was my mistake of pulling a limited amount : of data. There is no blank line at the end of my real : data file. Then there is also no error. So, what's your question? : Charles K. Clarkson wrote: : : From: Tim McGeary

Re: finding out what is uninitialized

2004-08-03 Thread Tim McGeary
The blank line was my mistake of pulling a limited amount of data. There is no blank line at the end of my real data file. Tim McGeary Senior Library Systems Specialist Lehigh University 610-758-4998 [EMAIL PROTECTED] Charles K. Clarkson wrote: From: Tim McGeary wrote:

RE: finding out what is uninitialized

2004-08-03 Thread Charles K. Clarkson
From: Tim McGeary wrote: : Here are two sample data files and the full script : minus a bunch of comments that aren't needed.. When I ran the sample.pl script I got this. The errors can be eliminated by deleting the blank line in sample.txt. I didn't get any er

finding Makefiles which containing a backslash continuation character where the next line is blank or whitespace

2004-08-03 Thread Ken Wolcott
Hi; I need to find Makefiles that contain a backslash line continuation character followed by a blank (or whitespace only) line. I tried a regular expression first but just couldn't get it right. I then tried comparing by a pair of strings, but that isn't right either. First try:

Re: finding out what is uninitialized

2004-08-03 Thread Tim McGeary
Here are two sample data files and the full script minus a bunch of comments that aren't needed.. Thanks, Tim Tim McGeary Senior Library Systems Specialist Lehigh University 610-758-4998 [EMAIL PROTECTED] Charles K. Clarkson wrote: From: Tim McGeary wrote: : Ok, here's

RE: finding out what is uninitialized

2004-08-03 Thread Charles K. Clarkson
From: Tim McGeary wrote: : Ok, here's the code that is pushing $cat_key, $title, : $url, and $code into the @fund_array: : : @sirsi_array has a DB_key, a Title and "data" which : is either a code or a URL, in such a manner: : : 101|Journal of Nature|PBIO| : 101|Journa

Re: finding out what is uninitialized

2004-08-03 Thread Gunnar Hjalmarsson
[ Please type your replies below the quoted part of the message you respond to. Please only quote what's needed to give context. ] Tim McGeary wrote: Gunnar Hjalmarsson wrote: Before digging into it, and so we know which problem we are helping you to solve: *Is* the warning referring to the push()

Re: finding out what is uninitialized

2004-08-03 Thread Tim McGeary
No, the warning statement is when I'm printing to the file. In both case, it refers to the process of writing to a file from the foreach $item (@fund_array) process. Tim Tim McGeary Senior Library Systems Specialist Lehigh University 610-758-4998 [EMAIL PROTECTED] Gunnar Hjalmarsson wrote: Tim Mc

Re: finding out what is uninitialized

2004-08-03 Thread Gunnar Hjalmarsson
Tim McGeary wrote: Ok, here's the code that is pushing $cat_key, $title, $url, and $code into the @fund_array: Before digging into it, and so we know which problem we are helping you to solve: *Is* the warning referring to the push() statement? -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-

Re: finding out what is uninitialized

2004-08-03 Thread Tim McGeary
Ok, here's the code that is pushing $cat_key, $title, $url, and $code into the @fund_array: @sirsi_array has a DB_key, a Title and "data" which is either a code or a URL, in such a manner: 101|Journal of Nature|PBIO| 101|Journal of Nature|http://www.nature.org/| 102|Journal of Crap|PBIO| 102|Jo

Re: Determining Odd and Even Numbers

2004-08-03 Thread Jimstone77
Thanks everyone!

RE: question about ( () if () ) while ();

2004-08-03 Thread West, William M
>Check 'perldoc perlsyn'. It explains that the "statement modifiers", >things like '... if CONDITION' and '... while CONDITION' are only allowed >after *simple* statements -- what they really should say is "expressions". > >You're allowed to write > > print 1 if /willy/; > >because 'print 1' is

Re: question about ( () if () ) while ();

2004-08-03 Thread Jeff 'japhy' Pinyan
On Aug 3, West, William M said: >$ perl -e ' $entry = "willy"; (print "1") if (/$entry/) while ($_ = "will"); >print "0"' >syntax error at -e line 1, near ") while" >Execution of -e aborted due to compilation errors. Check 'perldoc perlsyn'. It explains that the "statement modifiers", things lik

Re: Determining Odd and Even Numbers

2004-08-03 Thread Jeff 'japhy' Pinyan
On Aug 3, David Dorward said: >On 3 Aug 2004, at 13:26, [EMAIL PROTECTED] wrote: >> Does anyone know a simple way to determine if a number is odd or even? > >Use the modulus operator. If $foo % 2 has remainder 1, then it is odd, >if it has remainder 0, then it is even. While I find this a silly q

RE: Determining Odd and Even Numbers

2004-08-03 Thread Jenda Krynicky
From: <[EMAIL PROTECTED]> > Well, > > All the above said answers are perfectly fine, but just to make it > more efficient what we can do is, we can avoid the if statement or ?: > operator. > > This is because whenever we go for a decision statement, it takes some > extra processing time. Wheneve

Re: finding out what is uninitialized

2004-08-03 Thread Script Monkey
Good point. Tim, how are $cat_key, $title, $url, and $code being populated? SM On Aug 3, 2004, at 9:14 AM, James Edward Gray II wrote: On Aug 3, 2004, at 9:12 AM, Gunnar Hjalmarsson wrote: where the @fund_array is defined by : push(@fund_array,"$cat_key\|$title\|$url\|$code\|"); If that's the o

Re: Newbie question

2004-08-03 Thread Paul Kraus
Go to a command prompt.Type ppm hit enter. use this tool to install modules of windows. On Sat, Jul 31, 2004 at 11:22:37PM -0500, Drue Reeves wrote: > Sorry for the newbie question but, I'm having trouble using the Perldap > module. I downloaded the binaries and I am trying to install them into >

Re: finding out what is uninitialized

2004-08-03 Thread James Edward Gray II
On Aug 3, 2004, at 9:12 AM, Gunnar Hjalmarsson wrote: where the @fund_array is defined by : push(@fund_array,"$cat_key\|$title\|$url\|$code\|"); If that's the only way @fund_array gets populated, there is no way it can contain undefined elements. Is the warning pointing to the push() line though

question about ( () if () ) while ();

2004-08-03 Thread West, William M
$ perl -e ' $entry = "willy"; (print "1") if (/$entry/) while ($_ = "will"); print "0"' syntax error at -e line 1, near ") while" Execution of -e aborted due to compilation errors. seperating the bits seems to work. it seems to break down when i want to use the if statement in combination wit

Re: finding out what is uninitialized

2004-08-03 Thread Gunnar Hjalmarsson
Tim McGeary wrote: I have two arrays that I am printing to a file and I get the "Use of uninitialized value..." warning. But I get that for less than 100 of 3000+ lines. Is there a way that I can log what data is uninitialized. Here's the snippet of code I am using: foreach $coded (@fund_array) {

Re: finding out what is uninitialized

2004-08-03 Thread Tim McGeary
So if I don't have this, what is printed to my file? Nothing? Just an error to the screen? What I don't understand is that if the data wasn't there, I wouldn't have pushed it to the array previously. And I've gone over that code in depth and everything is being set before it's push together

Re: Module to merge arbitrary multi-level data structures?

2004-08-03 Thread Randy W. Sims
Randy W. Sims wrote: Does anyone know of a module that can take a reference to two arbitrarily organized data structures, and return a merged structure? Scratch that. Hash::Merge seems to do what I want. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: finding out what is uninitialized

2004-08-03 Thread Script Monkey
Here is what I do for uninitialized variables: foreach $coded (@fund_array) { if (defined($coded) { printf (FILE "$coded\n"); }else{ printf(FILE,"\n"); } } or drop off the else statement if you don't want the blank line. Rod, On Aug 3, 2004,

RE: Determining Odd and Even Numbers

2004-08-03 Thread kamal.gupta
Well, All the above said answers are perfectly fine, but just to make it more efficient what we can do is, we can avoid the if statement or ?: operator. This is because whenever we go for a decision statement, it takes some extra processing time. A solution to avoid using if or ?: is as follows

finding out what is uninitialized

2004-08-03 Thread Tim McGeary
I have two arrays that I am printing to a file and I get the "Use of uninitialized value..." warning. But I get that for less than 100 of 3000+ lines. Is there a way that I can log what data is uninitialized. Here's the snippet of code I am using: foreach $coded (@fund_array) { printf (FI

OT: Re: Determining Odd and Even Numbers

2004-08-03 Thread Wiggins d Anconia
> > > > Does anyone know a simple way to determine if a number is odd or even? For > example 220 would come out even while 221 would come out as an odd number. > > The chosen examples struck me as funny. Movie Quiz time (probably just for the americans): Ron: "Are you going to put in 220?

Re: Determining Odd and Even Numbers

2004-08-03 Thread Harald Richard Ashburner
[EMAIL PROTECTED] said: > > >Does anyone know a simple way to determine if a number is odd or even? For >example 220 would come out even while 221 would come out as an odd number. perl -e '($number % 2)?print "even":print "odd"; print "\n";' % is the modulus operator, and returns the remainder

Re: Determining Odd and Even Numbers

2004-08-03 Thread David Dorward
On 3 Aug 2004, at 13:26, [EMAIL PROTECTED] wrote: Does anyone know a simple way to determine if a number is odd or even? Use the modulus operator. If $foo % 2 has remainder 1, then it is odd, if it has remainder 0, then it is even. -- David Dorward

Determining Odd and Even Numbers

2004-08-03 Thread Jimstone77
Does anyone know a simple way to determine if a number is odd or even? For example 220 would come out even while 221 would come out as an odd number.

Re: Return values of "system"

2004-08-03 Thread Jose Alves de Castro
On Mon, 2004-08-02 at 14:52, Prasanna Kothari wrote: > Hi, Hi > [... code ...] I have tried your code and it works... > Notice that the code snippet is executing vi with a file and hence > editor opens up the file. After typing if I give a wrong vi command for > eg: "W" instead of "w"; $val g