Re: passing database data to a sub

2005-04-18 Thread John Doe
Hi Mick Just some additional comments to Charles': Am Montag, 18. April 2005 06.36 schrieb Hawkes, Mick I: > Wow! > Thanks Charles, it will take a while to digest all that. > Some questions though... > > You said: > > > Second, GetOfficers() is called as a subroutine, not as a method of an > obj

Number of Items in Array

2005-04-18 Thread Aaron C. de Bruyn
In the Perl documentation (perlintro) it says that you can find out the number of elements in an array using the following syntax: print $myvar[$#mmyvar]; I am running into a problem when I try to find the number of elements in an array that is being returned from an object. I am using XML::Si

RSS feed to perl

2005-04-18 Thread Ron B
Please, tell me an easy way to put rss-feed to my home site. Ok, I know, there's zillions ready made php and perl scripts to do that, but is there an easy way to do it? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

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

Re: setting PERL5LIB path

2005-04-18 Thread Manish Sapariya
Hi, So can't I set PERL5LIB so that the perl will search first my local lib directory and then system lib directory. Something like setting PATH variable to /usr/local/bin and then /usr/bin. I want to do this because certain CPAN modueles which I use in my program are of higher version than the def

utf8 questions.

2005-04-18 Thread Rajarshi Das
Hi, I am using perl-5.8.6 on z/OS. 1) What is the BOM on z/OS ? Basically, I cant print the chars "\xFE\xFF". Even though \xFE is defined as Latin Capital Letter U with Acute, the char doesnt display. Also, \xFF isnt defined. 2) What is the difference between the utf8::encode and utf8::upgrade

RE: passing database data to a sub

2005-04-18 Thread Charles K. Clarkson
John Doe wrote: : : return fetchall_arrayref( { HTML_ProjectName => 1 } ); : : Ok, I never used CGI::Application and HTML::Template, but : where does this sub come from? Doh! It should be this. (Again, I haven't tested this). return $sth->fetchall_arrayref( { HTM

RE: passing database data to a sub

2005-04-18 Thread Charles K. Clarkson
Code review: 1: package Test_code; 2: use base 'CGI::Application'; 3: use HTML::Template; You don't need that. C::A calls it by default and you don't use it in this module. 4: use Data::FormValidator; You don't need that. I assume you'll use it later, but comment it ou

RE: Number of Items in Array

2005-04-18 Thread Charles K. Clarkson
Aaron C. de Bruyn wrote: : In the Perl documentation (perlintro) it says that you can find out : the number of elements in an array using the following syntax: : : print $myvar[$#mmyvar]; No. That prints the value of the last element of @myvar. The number items in

Re: Number of Items in Array

2005-04-18 Thread Vladimir D Belousov
Charles K. Clarkson wrote: Aaron C. de Bruyn wrote: : In the Perl documentation (perlintro) it says that you can find out : the number of elements in an array using the following syntax: : : print $myvar[$#mmyvar]; No. That prints the value of the last element of @my

RE: Number of Items in Array

2005-04-18 Thread Thomas Bätzler
Vladimir D Belousov <[EMAIL PROTECTED]> asked: > I beg your pardon, but why $myvar[$#mmyvar] is the first > element of array? Because $#mmyvar is 0 - and if you "use warnings;" Perl will tell you that @mmyvar is undeclared. If you use $myvar[$#myvar], it will print the last element. Better yet, u

Encrpt a file

2005-04-18 Thread Anish Kumar K
Hi Can any one suggest a good algorithm for encrpt and decrypt the files ..I donot want to use any perl module for that... Thanks Anish

Re: last question on the switch statement ....

2005-04-18 Thread Vladimir D Belousov
Sorry for my English :) '&&' is a boolean operator. It returns TRUE when both statemets are ture, and false on other cases. But if the first statement is false, next statement will not be executed. For example: $hash{key} doesn't exists - if(exists($hash{key}) && $hash{key} =~ /\d+/); Is $^W is tru

Re: Passing array as refer ?

2005-04-18 Thread John W. Krahn
Manish Sapariya wrote: Hi John, Hello, &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? perldoc perlsub [snip] To call subroutines:

PERL and XML

2005-04-18 Thread marcos rebelo
For the Universaty Project, I dicided to make a study about the use of Perl and XML. I have already found somethings to read in google but they seem to be desactualized (2002, 2003). So I would like to have your help to find new articles about the Perl support to the XML and all the tecnologis aro

Re: last question on the switch statement ....

2005-04-18 Thread John W. Krahn
David Gilden wrote: Dear fellow PERL coders..., Hello, What is the "&& do" part of the code doing, i.e. I am looking to understand the syntax, the example was found in perl beginners archive, from some else's post... && is the logical 'and' operator. If the expression on its left is evaluated as

Capatalisation Question

2005-04-18 Thread N. Ganesh Babu
Dear All I want to do capitalisation of this text. I am using the following code. It works fine with all other lines. $line="Level A (Grade 1 reading level)"; @words=split(/ /,$line); for($i=0;$i<=$#words;$i++) { $words[$i]=~s!($words[$i])!\u\L$1!gi; print "$words[$i]\n"; } This

Re: Capatalisation Question

2005-04-18 Thread N. Ganesh Babu
Dear All, The output I want is "Level A (Grade 1 Reading Level)" Regards, Ganesh N. Ganesh Babu wrote: Dear All I want to do capitalisation of this text. I am using the following code. It works fine with all other lines. $line="Level A (Grade 1 reading level)"; @words=split(/ /,$line); for

Re: setting PERL5LIB path

2005-04-18 Thread John Doe
Am Montag, 18. April 2005 07.12 schrieb Manish Sapariya: > Hi, > So can't I set PERL5LIB so that the perl will search first my local lib > directory and then system lib directory. > > Something like setting PATH variable to /usr/local/bin and then /usr/bin. > > I want to do this because certain CPA

Encrypt a file, was Re: Encrpt a file

2005-04-18 Thread Chris Devers
On Mon, 18 Apr 2005, Anish Kumar K wrote: > Can [anyone] suggest a good algorithm for [encrypting] and > [decrypting] files ..I donot want to use any perl module for that... rot13 would be pretty easy to write up by hand. If you want something robust, it would be wise to use a module. Start he

Re: Number of Items in Array

2005-04-18 Thread John Doe
Am Montag, 18. April 2005 10.53 schrieb Vladimir D Belousov: > Charles K. Clarkson wrote: > >Aaron C. de Bruyn wrote: > >: In the Perl documentation (perlintro) it says that you can find out > >: the number of elements in an array using the following syntax: > >: > >: pri

Re: Number of Items in Array

2005-04-18 Thread John Doe
Am Montag, 18. April 2005 13.38 schrieb John Doe: [...] > perl -le' > use strict; use warnings; > my @a=(); > my @b=(0); > my @c=(0,1); > print $#a, " / ", $#b, " / ", "\n"; sorry, this should of course be print $#a, " / ", $#b, " / ", $#c, "\n"; (I ran it with the arrays () and (0,1) and ins

Re: Number of Items in Array

2005-04-18 Thread Vladimir D Belousov
John Doe wrote: Am Montag, 18. April 2005 10.53 schrieb Vladimir D Belousov: Charles K. Clarkson wrote: Aaron C. de Bruyn wrote: : In the Perl documentation (perlintro) it says that you can find out : the number of elements in an array using the following syntax:

General Enquiry regarding the Perl

2005-04-18 Thread Rajat Dudeja
Hi All, I have just joined this group two days back. So 'Hello' to every one out there. I am new to Perl and I want to do some project in it. I have some very basic queries in Perl, so thought of writing to the group : 1 Could some suggest me what all I can do in Perl? 2 I also want to know w

Re: General Enquiry regarding the Perl

2005-04-18 Thread Chris Devers
On Mon, 18 Apr 2005, Rajat Dudeja wrote: > 1 Could some suggest me what all I can do in Perl? It can solve many problems with computers. > 2 I also want to know what all are the applications of Perl ? Is it > only used for System Admin kind of work or things beyond that ? Yes. It can solv

Re: Capatalisation Question

2005-04-18 Thread Offer Kaye
On 4/18/05, N. Ganesh Babu wrote: > Dear All > > I want to do capitalisation of this text. I am using the following code. > It works fine with all other lines. > > $line="Level A (Grade 1 reading level)"; > > @words=split(/ /,$line); > for($i=0;$i<=$#words;$i++) > { > $words[$i]=

Re: Capatalisation Question

2005-04-18 Thread Jay Savage
On 4/18/05, N. Ganesh Babu <[EMAIL PROTECTED]> wrote: > Dear All > > I want to do capitalisation of this text. I am using the following code. > It works fine with all other lines. > > $line="Level A (Grade 1 reading level)"; > > @words=split(/ /,$line); > for($i=0;$i<=$#words;$i++) >

RE: General Enquiry regarding the Perl

2005-04-18 Thread brian . barto
Hi! "1 Could some suggest me what all I can do in Perl?" The list would be smaller if you'd asked "what CAN'T you do with perl?". Perl is a very powerful programming language. Speaking from personal experience, it's helped me elevate myself above my peers and is directly responsible for the high

Re: Capatalisation Question

2005-04-18 Thread Offer Kaye
On 4/18/05, Jay Savage wrote: > > $line =~ /(\S+)/\u\L$1/g ; > Almost right - returns "Level A (grade 1 Reading Level)" - notice the lowercase "g" in "grade"). Should be: $line =~ s/(\w+)/\u$1/g; -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

RE: Number of Items in Array

2005-04-18 Thread Charles K. Clarkson
Vladimir D Belousov wrote: : I mean 'but why $myvar[$#mmyvar] is the last element of : array', not 'first' in my letter. : I thought that $#array is equal scalar(@array). $#array equals 1 less than scalar(@array). scalar(@array) gives the number of elements in @arr

Re: utf8 questions.

2005-04-18 Thread Jay Savage
On 4/18/05, Rajarshi Das <[EMAIL PROTECTED]> wrote: > Hi, > I am using perl-5.8.6 on z/OS. > 1) What is the BOM on z/OS ? Basically, I cant print the chars "\xFE\xFF". > Even though \xFE is defined as Latin Capital Letter U with Acute, the char > doesnt display. Also, \xFF isnt defined. > > 2) Wha

Re: General Enquiry regarding the Perl

2005-04-18 Thread Octavian Rasnita
Hi, You can do many things with Perl. You can write CGI applications for web servers that run under many operating systems including Unix, Macintosh, Windows, and many others. You can write programs that run as a Apache module for the web. You can create a lot of types of programs for monitoring

Refernces on SWIG wanted

2005-04-18 Thread Tommy Nordgren
Do anyone out there know of any book on using the SWIG system for extending perl. I've tried to search amazon.com, and the major it book publisher sites that I know about, but so far I have not found anything. There are many hits on Swig on amazon, but none appears relevant to ANY computer-relat

Capturing system output to a variable

2005-04-18 Thread Hans van Leeuwen
Hello, I use the script below to print all sorts of system information from my server and mail it to me. Because these emails get rather large, I created an HTML index for easy navigation. This all works fine, but printing the output to a file and then displaying it again does not seem the best w

RE: Capturing system output to a variable

2005-04-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Hans van Leeuwen wrote: > Hello, > > I use the script below to print all sorts of system information from > my server and mail it to me. Because these emails get rather large, I > created an HTML index for easy navigation. > > This all works fine, but printing the output to a file and then > disp

Programming exercises

2005-04-18 Thread Stephen Day
Hello, Does anyone know of a website that lists some programming exercises to help in learning perl? I find it a lot easier to learning a language if I have exercises to apply it to. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Need RE. New to Perl

2005-04-18 Thread Keith Worthington
Hi All, I am new to the list and need some quick help. I have been kicking around with vi and sed for years but never took the time to learn Perl. Now I need to use Perl and could really use a jumpstart. I am writing a function in the Postgresql database using Perl because of its text processin

Unsubscrime from the list

2005-04-18 Thread Eduardo Vázquez Rodríguez
Unsubscrime from the list Thank U -- If I have seen further it is by standing on the shoulders of the giants Isaac Newton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Unsubscrime from the list

2005-04-18 Thread Chris Devers
On Mon, 18 Apr 2005, Eduardo Vázquez Rodríguez wrote: > Unsubscrime from the list > > Thank U > > -- > If I have seen further it is by standing on the shoulders of the giants > Isaac Newton > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECT

RE: Refernces on SWIG wanted

2005-04-18 Thread Ron Goral
> -Original Message- > From: Tommy Nordgren [mailto:[EMAIL PROTECTED] > Sent: Monday, April 18, 2005 12:14 PM > To: beginners perl > Subject: Refernces on SWIG wanted > > > Do anyone out there know of any book on using the SWIG system for > extending > perl. I've tried to search amazon.com,

Re: Need RE. New to Perl

2005-04-18 Thread Chris Devers
On Mon, 18 Apr 2005, Keith Worthington wrote: > Any help would be appreciated. Write a program. Use the DBI module for the database programming. Get the DBD::Pg plugin to DBI for the PostgreSQL driver. Get this stuff from CPAN if it isn't on your system already. Break the problem down into si

Re: Refernces on SWIG wanted

2005-04-18 Thread John W. Krahn
Tommy Nordgren wrote: Do anyone out there know of any book on using the SWIG system for extending perl. I've tried to search amazon.com, and the major it book publisher sites that I know about, but so far I have not found anything. There are many hits on Swig on amazon, but none appears relevant

Re: Capturing system output to a variable

2005-04-18 Thread John W. Krahn
Hans van Leeuwen wrote: Hello, Hello, I use the script below to print all sorts of system information from my server and mail it to me. Because these emails get rather large, I created an HTML index for easy navigation. This all works fine, but printing the output to a file and then displaying it a

Re: Need RE. New to Perl

2005-04-18 Thread Jay Savage
On 4/18/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > Hi All, > > I am new to the list and need some quick help. I have been kicking around > with vi and sed for years but never took the time to learn Perl. Now I need > to use Perl and could really use a jumpstart. > > I am writing a funct

Re: Encrypt a file, was Re: Encrpt a file

2005-04-18 Thread Peter_Farrar
On Mon, 18 Apr 2005, Anish Kumar K wrote: > Can [anyone] suggest a good algorithm for [encrypting] and > [decrypting] files ..I donot want to use any perl module for that... Check out the perl stuff on this site. I haven't actually used it yet, though I've been meaning to look at it. But their

Re: Need RE. New to Perl

2005-04-18 Thread Keith Worthington
On Mon, 18 Apr 2005 15:30:39 -0400, Jay Savage wrote > On 4/18/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > I am new to the list and need some quick help. I have been > > kicking around with vi and sed for years but never took the > > time to learn Perl. Now I need to use

Re: Programming exercises

2005-04-18 Thread Robert
"Stephen Day" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hello, > > Does anyone know of a website that lists some programming exercises to > help in > learning perl? > > I find it a lot easier to learning a language if I have exercises to apply > it > to. > Yes. Funny enoug

Host IP address

2005-04-18 Thread DiGregorio, Dave
Help please, I am trying to get the IP address of the host PC into a perl script. I tried using Gethostbyname() without success. I have a Bluetooth adapter connected to this PC and when I ping host name it returns the IP address of the BT adapter. Ipconfig shows the 2 ethernet adapters and the B

Re: Programming exercises

2005-04-18 Thread Stephen Day
On Monday 18 April 2005 7:39 pm, Robert wrote: > "Stephen Day" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > Hello, > > > > Does anyone know of a website that lists some programming exercises to > > help in > > learning perl? > > > > I find it a lot easier to learning a langua

Re: Encrpt a file

2005-04-18 Thread M. Kristall
Zentara wrote: On Mon, 18 Apr 2005 14:37:49 +0530, [EMAIL PROTECTED] (Anish Kumar K) wrote: Can any one suggest a good algorithm for encrpt and decrypt the files ..I donot want to use any perl module for that... I don't know if I would call it "good" encryption, but.. I wouldn't call it encr

Re: Programming exercises

2005-04-18 Thread John Doe
Hi Stephen Am Montag, 18. April 2005 22.41 schrieb Stephen Day: > On Monday 18 April 2005 7:39 pm, Robert wrote: > > "Stephen Day" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > Hello, > > > > > > Does anyone know of a website that lists some programming exercises to > >

Re: Host IP address

2005-04-18 Thread JupiterHost.Net
DiGregorio, Dave wrote: Help please, I am trying to get the IP address of the host PC into a perl script. I tried using Gethostbyname() without success. I have a Bluetooth adapter connected to this PC and when I ping host name it returns the IP address of the BT adapter. Ipconfig shows the 2 et

RE: Programming exercises

2005-04-18 Thread Charles K. Clarkson
Stephen Day wrote: : I have that book and am going though them rather fast. : : I was hoping for a link to a website that has a few more. Go to perlmonks.com. Try to answer any question in the New Questions section. Compare your answer with the answer given by oth

back to orininal question

2005-04-18 Thread Hawkes, Mick I
Guys Thanks to all the useful suggestions, especially to Charles for the code review, I will implement your suggestions throughout my code. But back to the original question. I need to put a lot of re-occurring code into subroutines (as you do) however I am hampered to a problem with passing s

Re: back to orininal question

2005-04-18 Thread Jeff 'japhy' Pinyan
On Apr 19, Hawkes, Mick I said: But back to the original question. I need to put a lot of re-occurring code into subroutines (as you do) however I am hampered to a problem with passing shift I think. This is a very simplified test code where I have tried passing shift as an argument and also as

RE: back to orininal question

2005-04-18 Thread Hawkes, Mick I
Jeff Like I said in my text. I tried BOTH solutions, it is only commented out to show this. Yes I tried that Format, I commneted out my @loop = GetOfficers(); and likewise the other bit in main menu. The crux is my @loop = GetOfficers($self); doesn't work either! On Apr 19, Haw

Re: Programming exercises

2005-04-18 Thread Randal L. Schwartz
> "Robert" == Robert <[EMAIL PROTECTED]> writes: Robert> Yes. Funny enough they are in a book called "Learning Perl". : ) Robert> P.S. Not associated with the book or author in any way unless you count that Robert> I too am going through the book. /me is associated with the book and the

RE: back to orininal question

2005-04-18 Thread Charles K. Clarkson
Hawkes, Mick I wrote: : But back to the original question. I need to put a lot of : re-occurring code into subroutines (as you do) however I am : hampered to a problem with passing shift I think. This is a : very simplified test code where I have tried passing shift : as

Re: Programming exercises

2005-04-18 Thread Randal L. Schwartz
> "Charles" == Charles K Clarkson <[EMAIL PROTECTED]> writes: Charles> Go to perlmonks.com. Try to answer any question in the Charles> New Questions section. Compare your answer with the answer Charles> given by others. Feel free to skip difficult questions, Charles> there are a few thousa

RE: back to orininal question

2005-04-18 Thread Charles K. Clarkson
Hawkes, Mick I wrote: : Jeff : : Like I said in my text. I tried BOTH solutions, it is only commented : out to show this. Yes I tried that Format, I commneted out my @loop = : GetOfficers(); and likewise the other bit in main menu. : The crux is my @loop = GetOfficers($

RE: back to orininal question

2005-04-18 Thread Hawkes, Mick I
EUREKA! It works! Thanks Charles, it was: my $loop = $self->GetOfficers(); that did the trick. (its now beginning to make sense! :-)) Also got the fetchall_arrayref to work too! Thanks again to everyone! Cheers Mick Hawkes -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Multiple programs output to separate log files + to STDOUT

2005-04-18 Thread Ambikesh Chaurasia
Hi All, I am calling many "C" programs from my perl script. I want to log output of each of these "C" programs in DIFFERENT log files as well as I want to display this output to STDOUT. Please send me your sugesstion how to do this. Please note that I have already tried using 1. IO::Tee: