Re: Basic Math Problem

2006-01-03 Thread David Newman
On Tue, 3 Jan 2006, Tom Phoenix wrote: On 1/3/06, David Newman <[EMAIL PROTECTED]> wrote: One quick fix here is to use printf instead: printf "\n\%02f = %02f", $result, $result; I believe you were doing this to round off "money numbers": numbers with exactly two digits after the decimal poi

Re: Basic Math Problem

2006-01-03 Thread David Newman
On Tue, 3 Jan 2006, [EMAIL PROTECTED] wrote: $result = 1.00 - 9991.05; print "\n\$result = $result"; The result that is being printed is "8.950073" instead of "8.95". Can someone please tell me why perl acts this way. I am beginning to doubt perl's basic math capabilities.

RE: about eval and stdin

2006-01-03 Thread Timothy Johnson
Ok, I think I see the problem. I re-wrote your script a little (watch for line breaks), and you should be able to see what the problem is when you run it. Your substitution isn't doing what you think it's doing. In the future it always helps to add these kinds of "debug lines" when it seems

calling subroutine via hash

2006-01-03 Thread John W. Burns
The following code calls only the first subroutine not the second. It seems to recoginize both subroutines but executes only the first one. Can anyone help me figure out how to get the code to call the second subroutine as well? Both subroutines when run as standard routines and not part of a has

RE: fileno

2006-01-03 Thread Timothy Johnson
You should be able to open a pipe to gpg. Here is something I've used on Windows (watch for line wraps): open(GPG,"| gpg.exe -q --passphrase-fd 0 -o \"$decrypted\" -d \"$encrypted\""); print GPG 'passphrase'."\n"; close GPG; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

RE: Re: Basic Math Problem

2006-01-03 Thread Timothy Johnson
One more thing: there are a few modules on CPAN that deal with this topic. Go to http://search.cpan.org and look up "precision" It looks like Math::FixedPrecision which uses Math::BigFloat is what you are looking for. -Original Message- From: Timothy Johnson Sent: Tuesday, January

RE: Re: Basic Math Problem

2006-01-03 Thread Timothy Johnson
Also check out 'perldoc perlnumber'. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Dr.Ruud Sent: Tuesday, January 03, 2006 5:30 PM To: beginners@perl.org Subject: Re: Basic Math Problem [EMAIL PROTECTED] schreef: > printed is "8.950073" > instead of "8.95"

Re: Basic Math Problem

2006-01-03 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > printed is "8.950073" > instead of "8.95". perldoc -q numbers -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Basic Math Problem

2006-01-03 Thread Sanbuah
Hello, Here's my problem. I have the following lines coded in my perl program: $result = 1.00 - 9991.05; print "\n\$result = $result"; The result that is being printed is "8.950073" instead of "8.95". Can someone please tell me why perl acts this way. I am beginning to doub

Re: new for regular expression in Perl

2006-01-03 Thread Chris Charley
- Original Message - From: "chen li" <[EMAIL PROTECTED]> Hi all, Here is my problem: my $string="chen schen"; I want to use regular expression to find the exact match in the string. So when I want to match "chen" I expect "chen" only. But use the following line I get both "chen"

RE: new for regular expression in Perl

2006-01-03 Thread Timothy Johnson
Do you mean that you only want the first match, or that you only want the word "chen" when it's not preceeded or followed by other characters? You can use \b (word boundary) to make sure you got the whole word. $string =~ /\b(chen)\b/g; -Original Message- From: chen li [mailto:[EMAIL PRO

RE: new for regular expression in Perl

2006-01-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
chen li wrote: > Hi all, > > Here is my problem: > > my $string="chen schen"; > > I want to use regular expression to find the exact > match in the string. So when I want to match "chen" I > expect "chen" only. > But use the following line I get both "chen" and > "schen" at the same time. > $st

new for regular expression in Perl

2006-01-03 Thread chen li
Hi all, Here is my problem: my $string="chen schen"; I want to use regular expression to find the exact match in the string. So when I want to match "chen" I expect "chen" only. But use the following line I get both "chen" and "schen" at the same time. $string=~/chen/g; How do I get what I exp

Re: pod2html

2006-01-03 Thread Tom Phoenix
On 1/3/06, Gergely Buday <[EMAIL PROTECTED]> wrote: > I'm to use pod2html but I don't have administrator rights so would > like to install it in my home directory. Is that possible? What happens when you try installing it in your home directory? --Tom Phoenix Stonehenge Perl Training -- To unsub

Re: fileno

2006-01-03 Thread Tom Phoenix
On 1/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am using gpg within a Perl program to decrypt some data files. In order > to decrypt a passphrase has to be passed to the gpg binary and I choose to > use fileno function but it is hanging waiting on the passphrase. It's generally diffic

RE: about eval and stdin

2006-01-03 Thread Timothy Johnson
I think when you include the parentheses in your pattern $1 is being set to the value inside the partentheses. It's as if you typed: if(/(dir)ectory/gi) which will set $1 to 'dir', which is probably not what you want. I think you can avoid this if you change the line to: if(/($pat

Re: pack an array

2006-01-03 Thread DBSMITH
"JupiterHost.Net" <[EMAIL PROTECTED] st.net>

fileno

2006-01-03 Thread DBSMITH
Perl'ers I am using gpg within a Perl program to decrypt some data files. In order to decrypt a passphrase has to be passed to the gpg binary and I choose to use fileno function but it is hanging waiting on the passphrase. I am trying to pass the passphrase to the binary via fileno. Any ideas on

Re: pack an array

2006-01-03 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: what is this pack actually doing compressing the data in each element or the entire array or both? Derek, I know you know about perldoc, I've seen it recommended to you dozens of times :) perldoc -f pack Takes a LIST of values and converts it into a string usi

Re: pack an array

2006-01-03 Thread DBSMITH
what is this pack actually doing compressing the data in each element or the entire array or both? Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams Gerard Robin

pod2html

2006-01-03 Thread Gergely Buday
Hi there, I'm to use pod2html but I don't have administrator rights so would like to install it in my home directory. Is that possible? - G -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]