weird math

2004-05-27 Thread Andrew Gaffney
I am writing a program to parse a CSV file downloaded from my bank. I have it keep a running balance, but I'm getting a weird total. Apparently, -457.16 + 460.93 = 3.769998. But when 20 is subtracted from that, I get -16.23. There are no weird numbers like that in my input data. All numb

Re: Question on Net::FTP.

2004-05-27 Thread Silky Manwani
Never mind. Figured it out. :) On May 27, 2004, at 4:40 PM, Silky Manwani wrote: Hello, I have this program where I am trying to ftp a file from one machine to another. so code somewhat looks like this: $ftp = Net::FTP->new(host, (Debug => 1, Timeout =>600, Passive =>1)); $ftp->login($user,$pass)

Question on Net::FTP.

2004-05-27 Thread Silky Manwani
Hello, I have this program where I am trying to ftp a file from one machine to another. so code somewhat looks like this: $ftp = Net::FTP->new(host, (Debug => 1, Timeout =>600, Passive =>1)); $ftp->login($user,$pass); $ftp->binary(); $ftp->put($file); At some point this code was working and now i

RE: appending to a file

2004-05-27 Thread Tim Johnson
To append to a file, you must open() the file, like so: open(OUTFILE,">>myfile.txt") || die "Could not open myfile.txt for appending!\n"; Then when you want to write to the file, use print(), like so: print OUTFILE "The text I want to add to the end of my file\n"; -Orig

appending to a file

2004-05-27 Thread DBSMITH
more help please! I looked through my Learning Perl book and only see code >>filename for appending to a file. Here is my code but it is not writing to STDOUT designated as my file. my $foreigntapes="/usr/local/log/foreign_tapes.log"; delete $ENV{'IFS'}; local $ENV{'PAT

inserting text, with a rename

2004-05-27 Thread DBSMITH
understood! ok now if the *.bak file exists would I say something like: in order to make a bakup or a bakup use warnings; use strict; my @ejectapes = qw(/usr/local/bin/perld/exports); ($^I, @ARGV) = ('.bak', @ejectapes); if ( -s '.bak' ) { rename (".bak", ".bak1") || die "cannot renam

Re: displaying to_char formatting in Perl

2004-05-27 Thread Andrew Gaffney
Wiggins d Anconia wrote: Please bottom post I only top-post when other people in the thread do because it keeps things a little less confusing. It annoys the crap out of me, though. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAI

Re: displaying to_char formatting in Perl

2004-05-27 Thread Wiggins d Anconia
Please bottom post > There isn't really a syntax error in your SQL query, but Perl is creating one. > Because of the interpolation issue I described in my previous post, Perl is > generating the line: > > TO_CHAR(ie_dollar_amt, ',999.99'), > Actually I think it should be TO_CHAR(ie_dollar

Re: displaying to_char formatting in Perl

2004-05-27 Thread Andrew Gaffney
MCMULLIN, NANCY wrote: Thank you kindly. That fixed it. No problem. I do that all the time ;) -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: displaying to_char formatting in Perl

2004-05-27 Thread Andrew Gaffney
There isn't really a syntax error in your SQL query, but Perl is creating one. Because of the interpolation issue I described in my previous post, Perl is generating the line: TO_CHAR(ie_dollar_amt, ',999.99'), MCMULLIN, NANCY wrote: Sorry. The original error I reported was due to a syntax erro

RE: displaying to_char formatting in Perl

2004-05-27 Thread MCMULLIN, NANCY
Thank you kindly. That fixed it. -Original Message- From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Thursday, May 27, 2004 1:42 PM To: MCMULLIN, NANCY Cc: Wiggins d Anconia; [EMAIL PROTECTED] Subject: Re: displaying to_char formatting in Perl MCMULLIN, NANCY wrote: > The error is "

Re: displaying to_char formatting in Perl

2004-05-27 Thread Andrew Gaffney
MCMULLIN, NANCY wrote: The error is "Internal Server Error". As soon as I comment out the (2)lines below: -- TO_CHAR(ie_dollar_amt, '$999,999.99'), it works just fine. Here's the code: == #!c:/activeperl/bin/perl use strict; use DBI; use DBD::Oracle; use CGI qw(:standard *table *Tr

RE: displaying to_char formatting in Perl

2004-05-27 Thread MCMULLIN, NANCY
Sorry. The original error I reported was due to a syntax error. I fixed that. What's happening is when I do not include the line: TO_CHAR(ie_dollar_amt, '$999,999.99'), it displays 366 records correctly. With that line included - it comes up with "Query returned 0 records" - no data. (Thank you

RE: displaying to_char formatting in Perl

2004-05-27 Thread Wiggins d Anconia
Please bottom post... > The error is "Internal Server Error". This error generally indicates that either the script fails to compile or there is output appearing before a valid HTTP header. What appears in the error log for the web server? That is the error you need to find to determine what th

RE: displaying to_char formatting in Perl

2004-05-27 Thread Jan Eden
Hi Nancy, MCMULLIN, NANCY wrote on 27.05.2004: >The error is "Internal Server Error". >As soon as I comment out the (2)lines below: >-- TO_CHAR(ie_dollar_amt, '$999,999.99'), >it works just fine. As suggested before: use CGI::Carp qw(fatalsToBrowser); You'll get a more informative error messag

RE: displaying to_char formatting in Perl

2004-05-27 Thread MCMULLIN, NANCY
The error is "Internal Server Error". As soon as I comment out the (2)lines below: -- TO_CHAR(ie_dollar_amt, '$999,999.99'), it works just fine. Here's the code: == #!c:/activeperl/bin/perl use strict; use DBI; use DBD::Oracle; use CGI qw(:standard *table *Tr ); my $dbh = DBI->

Re: displaying to_char formatting in Perl

2004-05-27 Thread Wiggins d Anconia
> When attempting to display a formatted string in Perl using Oracle - > > SELECT >TO_CHAR(dollar_amt, '$999,999.99') >FROM >table; > > It breaks the code. It does work as a straight SQL query outside of Perl. Any ideas? > "It breaks the code" is a rather vague statement. How d

displaying to_char formatting in Perl

2004-05-27 Thread MCMULLIN, NANCY
When attempting to display a formatted string in Perl using Oracle - SELECT TO_CHAR(dollar_amt, '$999,999.99') FROM table; It breaks the code. It does work as a straight SQL query outside of Perl. Any ideas? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Re: entering text within a file

2004-05-27 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: no thanks! but why are you setting ejectapes as an array and then calling it with @ instead of $? my @ejectapes = qw(/usr/local/bin/perld/exports); ($^I, @ARGV) = ('.bak', @ejectapes); instead of my @ejectapes = qw(/usr/local/bin/perld/exports); ($^I, @ARGV) = (

Re: entering text within a file

2004-05-27 Thread DBSMITH
no thanks! but why are you setting ejectapes as an array and then calling it with @ instead of $? my @ejectapes = qw(/usr/local/bin/perld/exports); ($^I, @ARGV) = ('.bak', @ejectapes); instead of my @ejectapes = qw(/usr/local/bin/perld/exports); ($^I, @ARGV) = ('.bak', $ejectapes);

Re: entering text within a file

2004-05-27 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: the last mail was the solution! Thanks for the persistence! Glad it worked out! Just a couple more notes below to make it even better :) the code is to insert eject 0,0,0 string in front of the E string like so:eject0,0,0E4030 from a file

Re: entering text within a file

2004-05-27 Thread DBSMITH
the last mail was the solution! Thanks for the persistence! the code is to insert eject 0,0,0 string in front of the E string like so: eject 0,0,0 E4030 from a file that contains just E strings #!/usr/local/bin/perl -w use strict; my $ejectapes = qw(/usr/local/bin/perld/exports);

Re: Program to scan dictionary for words with letters in a

2004-05-27 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jose Alves De Castro) writes: >On Thu, 2004-05-27 at 11:21, Ramprasad A Padmanabhan wrote: >> But to think of it there is one hitch >> >> suppose my string is 'god' >> >> Assume >> $word = "good" >> $r = qr/^[god]+$/ >> >> >> then $r would mat

RE: HTTP

2004-05-27 Thread Bob Showalter
Ramprasad A Padmanabhan wrote: > Are your sure you want to write your own in perl, then you would have > to use LWP or similar modules from CPAN > > But If you want straight download , why dont you just use tools like > "lynx -source" or "wget" or "snarf" Or lwp-download -- To unsubscribe, e-ma

Re: Program to scan dictionary for words with letters in a particular set?

2004-05-27 Thread Jose Alves de Castro
On Thu, 2004-05-27 at 11:21, Ramprasad A Padmanabhan wrote: > On Thu, 2004-05-27 at 15:09, Jose Alves de Castro wrote: > That was simply neat. I had read in a perl book ' there is always a > shorter way in perl '. I think this proves it. > > But to think of it there is one hitch > > suppose my s

Re: Line number

2004-05-27 Thread Jan Eden
Hi Jon and Jose, Jose Alves de Castro wrote on 27.05.2004: >On Thu, 2004-05-27 at 10:10, Jon Herbry wrote: >>Hi, anybody have idea find the number in a file? Assume I create a >>file call >"sample" >>and have content below: Hi, >>Jame where are you? How old a

Re: Program to scan dictionary for words with letters in a particular set?

2004-05-27 Thread Ramprasad A Padmanabhan
On Thu, 2004-05-27 at 15:09, Jose Alves de Castro wrote: > On Thu, 2004-05-27 at 06:14, Jim Witte wrote: > > Given a file of words W such as 'cat dog at home ...' (or perhaps read > > into an array, though that would be a very large array), and a set of > > letters L (a string 'aoeuidhtns' - perh

Re: Line number

2004-05-27 Thread Jose Alves de Castro
On Thu, 2004-05-27 at 10:10, Jon Herbry wrote: > Hi, anybody have idea find the number in a file? Assume I create a file call "sample" > and have content below: > > Hi, Jame where are you? > How old are you? > when you free? > can you coming my home? > -

Line number

2004-05-27 Thread Jon Herbry
Hi, anybody have idea find the number in a file? Assume I create a file call "sample" and have content below: Hi, Jame where are you? How old are you? when you free? can you coming my home? - assume if i want know string w

Re: Program to scan dictionary for words with letters in a particular set?

2004-05-27 Thread Jose Alves de Castro
On Thu, 2004-05-27 at 06:14, Jim Witte wrote: > Given a file of words W such as 'cat dog at home ...' (or perhaps read > into an array, though that would be a very large array), and a set of > letters L (a string 'aoeuidhtns' - perhaps put into a array), how would > I write a program to extract

Re: DBI and fetchrow

2004-05-27 Thread Jan Eden
MCMULLIN, NANCY wrote on 26.05.2004: >Does anyone know why this script hangs when it's executed? It's >probably due to the complex select statement, but I'm not sure how >to make it work. > >Also, is there a good 'DBI with SQL with Perl' book out there? > John already recommended O'Reilly's 'Pr