Can't figure out Error.pm

2005-09-17 Thread Peter Rabbitson
I am trying to incorporate cleaner exception handling in my code. Here is a small illustration (meaningless) of what most of my code looks like: package main; use warnings; use strict; my $average = Computer::get_average(); unless ($average) { print "$Computer::ERROR\n"; } 1; package Com

Re: displaying a message using perl code

2005-09-17 Thread Owen Cook
On Sat, 17 Sep 2005, David Swiderski wrote: > > Hi Owen, Thanks for your reply to my email. Follows is my perl script which > I'm trying to get it to display a message. > > perl script email.pl > #!/usr/bin/perl > # Gets the data from the form > &parse_form; Wow OK, looks like you are u

Re: extract web pages from a web site

2005-09-17 Thread Scott R. Godin
Siegfried Heintze wrote: I recommend Lincoln Stein's book "Perl Networking". Even if you are too cheap to buy his book, you can google for it and download the source code for an example program that uses HTML::Parser to extract and download all the gif files from a page. His example actually par

Re: spreadsheets to ldif (trouble looping through array)..

2005-09-17 Thread John W. Krahn
Harold Castro wrote: > > #This line is too tricky for me, all I know is that it > has a ternary hook operator which returns $_ if the > expression my @fields = map length() is true, > otherwise, substitute empty fields with 'NA'. I looked > into perldoc -f map as well as length() and as far as > I

Re: displaying a message using perl code

2005-09-17 Thread David Swiderski
Hi Owen, Thanks for your reply to my email. Follows is my perl script which I'm trying to get it to display a message. perl script email.pl #!/usr/bin/perl # # email.pl # # emails the data from the alumni mailing list.html form

Re: Assistance needed with script.......

2005-09-17 Thread John W. Krahn
Bryan Jones wrote: > Hello all, Hello, > I am somewhat new to perl. I have tried to read everything that I can. I > have a somewhat simple script, so might think. I have attached the script > and the file that I am reading to gather the data. I am trying to parse > this file to gather informa

Need C compiler to run under Windoze 98

2005-09-17 Thread Paul Plamondon
Perl Mavens, I need a C compiler that I can run under Windows 98. Already d/l Cygwin and gcc-4.0.1 but not sure how to get things working correctly. I am working with a mentor locally to get my skills improved; can someone else point me in the correct direction to complete this necessary piece?

Package require question again

2005-09-17 Thread Luinrandir
I want to thank everyone who has helped me with this. and I'm trying to remember to bottom post ok I have the program working again. but how do I get a var from the package? At the time you are reading this I am still experimenting wih the following: the package has this line in it. $Options="B

Re: displaying a message using perl code

2005-09-17 Thread Owen Cook
On Sat, 17 Sep 2005, David Swiderski wrote: > > My perl question is, is there a simple way to display some text/message on > the users screen such as > > your information has been sent. > Thank You for joining the alumni community! > We hope to see you at the next reunion. Well the answer to

displaying a message using perl code

2005-09-17 Thread David Swiderski
Hello to all on the perl email list. I am new to this list and being a newbie, don't have much experience or knowledge of perl but have managed to modify my first simple perl script which sends information via email from an html form that I created and which gets filled out by the user. I was

Re: Assignment modifiers

2005-09-17 Thread John W. Krahn
Peter Rabbitson wrote: > I stumbled upon a script with the following assignment: > ... = v(numeric value); > > I tried to see how it works and the following: > my $a = v65; > print $a; > > produces ascii 65 (capital A) > > Where can I read more about these assignment modifiers? perldoc perldat

Re: Regex $1

2005-09-17 Thread John W. Krahn
Chad wrote: > I have a file with the following: > (0 rows affected) > SQL1\SQLPROD4 > > When I run the following code it finds my match, but why isn't $1 populated? $1 is populated from the first set of parentheses in the regular expression and $2 is populated from the second set of parentheses,

Re: problems with getpwent

2005-09-17 Thread John W. Krahn
Binish A R wrote: > Hello, Hello, > I've a doubt with getpwent function. > The following code [ getpwent in list context ] is getting into an infinite > loop: > > #!/usr/bin/perl -l > > while ($ref = [ getpwent() ]) { > print $ref->[0]; > } A reference in boolean context is *ALWAYS* tru

Re: Getting html site

2005-09-17 Thread Chris Devers
On Sat, 17 Sep 2005, hengky wrote: > example if you open at browser http://www.abc.com/rates.cgi > it shows >result=0&rates=9830 > at the site > > and now i want to get the links using perl and grep the result into > variabel so i can prosessing to input to sql > > please some advice Many o

Re: Regex $1

2005-09-17 Thread Owen Cook
On Sat, 17 Sep 2005, Chad wrote: > I have a file with the following: > (0 rows affected) > SQL1\SQLPROD4 > > When I run the following code it finds my match, but why isn't $1 populated? > > $/ = ''; > open (VALIDFILE, "valid.txt") || die "Couldn't open file: $!"; > while ( ) > { > >

Regex $1

2005-09-17 Thread Chad
I have a file with the following: (0 rows affected) SQL1\SQLPROD4 When I run the following code it finds my match, but why isn't $1 populated? $/ = ''; open (VALIDFILE, "valid.txt") || die "Couldn't open file: $!"; while ( ) { if (/SQL1\\SQLPROD4/) { print "The text

Getting html site

2005-09-17 Thread hengky
guys, my name is hengky and i got problem to get html site example if you open at browser http://www.abc.com/rates.cgi it shows result=0&rates=9830 at the site and now i want to get the links using perl and grep the result into variabel so i can prosessing to input to sql please some advice

Re: problems with getpwent

2005-09-17 Thread Binish A R
Gerard Robin wrote: On Sat, Sep 17, 2005 at 08:20:55PM +0530 Binish A R wrote: Hello, I've a doubt with getpwent function. The following code [ getpwent in list context ] is getting into an infinite loop: #!/usr/bin/perl -l while ($ref = [ get

Re: problems with getpwent

2005-09-17 Thread Gerard Robin
On Sat, Sep 17, 2005 at 08:20:55PM +0530 Binish A R wrote: > Hello, > > I've a doubt with getpwent function. > The following code [ getpwent in list context ] is getting into an infinite > loop: > #!/usr/bin/perl -l > > > while ($ref = [ getpwent() ]) { > last unless @$ref;

Assignment modifiers

2005-09-17 Thread Peter Rabbitson
I stumbled upon a script with the following assignment: ... = v(numeric value); I tried to see how it works and the following: my $a = v65; print $a; produces ascii 65 (capital A) Where can I read more about these assignment modifiers? Peter -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

problems with getpwent

2005-09-17 Thread Binish A R
Hello, I've a doubt with getpwent function. The following code [ getpwent in list context ] is getting into an infinite loop: #!/usr/bin/perl -l while ($ref = [ getpwent() ]) { print $ref->[0]; } Actually its printing the list before going into infinite loop. when i tried the below cod

backticks in s///?

2005-09-17 Thread Bryan Harris
When I first learned perl I wrote the classic "replace text in files" script that probably everybody else writes. It is run with: % replace 'sometext' 'some other text' ... where $match gets the first arg, and $replace gets the second. It didn't work at first, but someone on this list reco