Sum not producing zero

2008-03-12 Thread Moon, John
Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. #!/usr/local/bin/perl use vars qw($this_account_total $this_customer_total $this_run_total); while (main::DATA) { chomp; my ($amt_gj, $amt_adj) =

Re: Sum not producing zero

2008-03-12 Thread Gunnar Hjalmarsson
Moon, John wrote: Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. code snipped First, you run your code without having enabled strictures and warnings. Second, you probably want to study the FAQ entry perldoc -q

RE: Sum not producing zero

2008-03-12 Thread Thomas Bätzler
Hi, Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. Don't use floating point math for accounting - convert your money sums to cents first and use these for calculation. HTH, Thomas -- To unsubscribe, e-mail:

reg help: printing line numbers in file

2008-03-12 Thread Gowri Chandra Sekhar Barla, TLS, Chennai
Hi I am new to perl Can any one please give the scripting for appending line numbers for the code lines For example: /* requesting for the script * for printing line number */ Fun_script() { Int a; /* local parameter */ Int b; /* local parameter */ /* adding the Two numbers */

Re: reg help: printing line numbers in file

2008-03-12 Thread John W. Krahn
Gowri Chandra Sekhar Barla, TLS, Chennai wrote: Hi Hello, I am new to perl Can any one please give the scripting for appending line numbers for the code lines For example: /* requesting for the script * for printing line number */ Fun_script() { Int a; /* local parameter */ Int b;

Re: Sum not producing zero

2008-03-12 Thread John W. Krahn
Moon, John wrote: Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. http://perlmonks.org/?node_id=665673 perldoc -q perldoc perlnumber John -- Perl isn't a toolbox, but a small machine shop where you can

Re: reg help: printing line numbers in file

2008-03-12 Thread yitzle
If you are using Unix and don't necessarily want it done via a Perl script, you can just use the cat command. cat -n file -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: Sum not producing zero

2008-03-12 Thread Moon, John
Thank you everyone for your input... I forgot the basics... This was only happening in about 1 in 150 cases... Solution was: sub IFormat_num{ # # value = number to format, required # places= decimal places, required # float = character to prefix string with #

print spanish symbols

2008-03-12 Thread obdulio santana
I want to show some áéíóú or ñ Ñ in my program but I dont know how to print it in a properly way; perl -e print \algodón\n\ algod¾n thanks in advance.

tie - any alternatives?

2008-03-12 Thread ken uhl
Hi, I am researching tie as a means to pass huge complex data structure ( an array of hash references ) between scripts ( and not textify the hash refs ) but I apparently don't have tie installed. Is there some other way ? Ken Berkeley -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: tie - any alternatives?

2008-03-12 Thread Rob Dixon
ken uhl wrote: I am researching tie as a means to pass huge complex data structure ( an array of hash references ) between scripts ( and not textify the hash refs ) but I apparently don't have tie installed. Is there some other way ? Hello Ken. 'tie' is a Perl language word and doesn't

Re: tie - any alternatives?

2008-03-12 Thread ken uhl
Rob Dixon wrote: ken uhl wrote: I am researching tie as a means to pass huge complex data structure ( an array of hash references ) between scripts ( and not textify the hash refs ) but I apparently don't have tie installed. Is there some other way ? Hello Ken. 'tie' is a Perl language

How do I get the contents of a url?

2008-03-12 Thread Jonathan Mast
How do I get the contents of a url? I mean passing a url to whatever object and receiving the content of that webpage as a scalar. I have a web service I want to test with perl, but I can't seem to find the right command or module to this despite looking quite a bit. thanks

Re: How do I get the contents of a url?

2008-03-12 Thread ken Foskey
On Wed, 2008-03-12 at 17:00 -0400, Jonathan Mast wrote: How do I get the contents of a url? I mean passing a url to whatever object and receiving the content of that webpage as a scalar. I have a web service I want to test with perl, but I can't seem to find the right command or module to

Re: tie - any alternatives?

2008-03-12 Thread eMko
I have found that if I try to describe my needs, then I get flamed ( go to school, RTFM , hire help ) so I am taking baby steps, trying to find out which manuals to read... AFAIK this is a discussion group for beginners. So no one should punish you for asking a beginner question ;-) Have

Re: print spanish symbols

2008-03-12 Thread eMko
I do not know if this helps you (I am a Perl beginner, too - previously i used Java where I did not have problems with character encoding), but when I needed to print out some special Czech symbols (ěščřžýáíéďťň etc.), I had to tell Perl to use an utf8 encoding. use utf8; binmode (STDIN, 'utf8');

Re: tie - any alternatives?

2008-03-12 Thread Jenda Krynicky
From: ken uhl [EMAIL PROTECTED] I have been looking at IPC as well. Seems like the basic open() may be a viable solution. I want to take a page with records displayed in HTML table with Check Boxes, select some records to be deleted, and pass the selected records to a confirmation page

Re: print spanish symbols

2008-03-12 Thread Jenda Krynicky
From: obdulio santana [EMAIL PROTECTED] I want to show some áéíóú or ~n ~N in my program but I dont know how to print it in a properly way; perl -e print \algodón\n\ algod 3/4 n thanks in advance. I'm afraid you'll have to tell us what operating system you use. The problem is most

Re: Sum not producing zero

2008-03-12 Thread Tom Phoenix
On Wed, Mar 12, 2008 at 8:43 AM, Moon, John [EMAIL PROTECTED] wrote: sub IFormat_num{ # # value = number to format, required # places= decimal places, required # float = character to prefix string with # credit= credit format, (1,2,3) = (surround string with ,

Learning Modules

2008-03-12 Thread Richard Lee
Hello there, I would like someone's experince on learning modules. I have been avoiding learning modules for couple reasons 1)to learn and try to reinvent some of the wheels to learn the tricks 2)and I just don't really understand OO modules. It is very difficult for me to understand modules

Re: Learning Modules

2008-03-12 Thread yitzle
I've been avoiding modules somewhat, too. However, you don't really need to be that familiar with OO to learn to use the modules. Are you trying to read the module's code to learn about them? Most people just use the documentation on CPAN. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Learning Modules

2008-03-12 Thread Richard Lee
yitzle wrote: I've been avoiding modules somewhat, too. However, you don't really need to be that familiar with OO to learn to use the modules. Are you trying to read the module's code to learn about them? Most people just use the documentation on CPAN. Well, the one of the reason that I have

Re: Learning Modules

2008-03-12 Thread R (Chandra) Chandrasekhar
Richard Lee wrote: Hello there, I would like someone's experince on learning modules. I have been avoiding learning modules for couple reasons 1)to learn and try to reinvent some of the wheels to learn the tricks 2)and I just don't really understand OO modules. It is very difficult for me to

Re: Learning Modules

2008-03-12 Thread yitzle
On Wed, Mar 12, 2008 at 11:41 PM, Richard Lee [EMAIL PROTECTED] wrote: Well, the one of the reason that I have been avoding using the modules was that I wanted to understand what the hell I am using. And I read somewhere that reading what others have wrote is among the best way to learn

Re: Suggestions for a simple configuration management web application

2008-03-12 Thread Varjú Tamás
If you are based on debian, than you probably use CUPS for serving printers. It already has a web based administration interface on port 631. So if you type localhost:631 in the addressbar of your browser then you get what you want (if CUPS is running). For more info see the CUPS

Re: Suggestions for a simple configuration management web application

2008-03-12 Thread Sean Davis
On Tue, Mar 11, 2008 at 2:54 PM, Richard [EMAIL PROTECTED] wrote: Hey all, I am trying to find a simple, modular web based configuration application and am having a little trouble. Basically, I need something to do some simple configurations on an appliance similar to something like a

Re: Suggestions for a simple configuration management web application

2008-03-12 Thread Beginner
On 11 Mar 2008 at 11:54, Richard wrote: Hey all, I am trying to find a simple, modular web based configuration application and am having a little trouble. Basically, I need something to do some simple configurations on an appliance similar to something like a laser printer. You know the