Help downloading a file

2007-05-01 Thread Moon, John
Below is code I presently use to download to clients and the generated html. One client objects to the generated html - the "Content-Disposition" ... Does any one have another method to download AND display the pdf with perl. sub Display_PDF { my ($pdf, $pdf_size) = @_; $|=0; print $q

RE: Premature end of script headers

2005-02-08 Thread Moon, John
Subject: Premature end of script headers hello, I am getting following error. Premature end of script headers Can anybody plz tell me what is the cause of this. Have you tried to execute the script from the command line? That is sometimes helpful in finding the error... jwm -- To unsub

RE: A little off topic

2004-08-16 Thread Moon, John
Thanks for the reply... I guess it was a little too much coffee. The problem was in the function it's self... Once I fixed that error everything worked OK jwm -Original Message- From: Shaun Fryer [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 11:55 AM To: Moon, John Su

A little off topic

2004-08-13 Thread Moon, John
Has anyone has experience getting the to work? Where MyFunction is a JavaScript... with IE ? Thanks in advance jwm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Help with CGI & HTML

2004-07-06 Thread Moon, John
I have a form that targets a reply to a "new" window. I would like to post the progress of the reply then display an option to "display" or "save" the file I generate. Here is what I have so far (which is not working)...: $|++; print $q->header(); ... print "progress..."; ... print "progress...";

RE: What are you really trying to do? - document type = applicat ion/vnd.ms-excel

2004-02-27 Thread Moon, John
-Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 3:10 PM To: 'Moon, John'; CGI Beginners Subject: RE: What are you really trying to do? - document type = applicat ion/vnd.ms-excel Moon, John wrote: > What I'm trying to

document type = application/vnd.ms-excel

2004-02-26 Thread Moon, John
I am trying to generate a web page with : print $q->header("application/vnd.ms-excel"), This tries to launch Excel but I get the error: "File cannot be opened because: A declaration was not closed Line 1, Position 1 <" When I use: print $q->header("text/html"), The page displays correctly and I

RE: What are you really trying to do? - document type = applicat ion/vnd.ms-excel

2004-02-26 Thread Moon, John
adsheet... Any thoughts would be greatly appreciated... Thanks, jwm -Original Message- From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 1:51 PM To: Moon, John; CGI Beginners Subject: Re: document type = application/vnd.ms-excel > I am trying to genera

RE: What are you really trying to do? - document type = applicat ion/vnd.ms-excel

2004-02-26 Thread Moon, John
-Original Message- From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 3:03 PM To: Moon, John; CGI Beginners Subject: RE: What are you really trying to do? - document type = applicat ion/vnd.ms-excel Gotcha, please bottom post... > What I'm tryi

RE: unlink help.

2003-10-29 Thread Moon, John
Another way ... opendir REMOVEIT, $dir or die "Open Failed"; my @gone = grep /\.bak$/ , map "$dir/$_". readdir REMOVEIT; closedir REMOVEIT; print "Remove ", join(',', @gone), "? :"; my $cnt; if (<> =~ /y/i) { $cnt = unlink @gone; print "Removed $cnt files from $dir ending in .bak\n" if (

RE: Table Options.

2001-11-24 Thread Moon, John
A good place to start may be: http://www.w3.org/ I am not an O'Reilly salesperson but I use the book: HTLM Pocket Reference by Jennifer Niederest The ISBN I believe is 1-56592-579-3 as a quick reference ... O'Reilly also has a "subscription" service which I use (pay for) and you may wish to l

RE: read I/O function

2001-10-25 Thread Moon, John
@size=stat FILEHANDLE; $size=$size[7]; Hope this helps ... Can this file get very big ? If so you may wish to re-consider what you are doing... If you are looking for one thing in the file you may wish to look into grep or egrep ... #! /usr/local/bin/perl $found = `egrep '^[0-9]+ bytes sent'

RE: Printing Hash Keys

2001-10-24 Thread Moon, John
... @seq = qw(dirt sand land air wind breath); foreach (@seq) { print $param{$_} . "\n"; } is one way ... -Original Message- From: Shannon Murdoch [mailto:[EMAIL PROTECTED]] Sent: October 24, 2001 19:01 To: [EMAIL PROTECTED] Subject: Re: Printing Hash Keys Thanks RaFaL,

RE: CGI.pm hidden field problem

2001-10-17 Thread Moon, John
Try the pragma use CGI qw/-nosticky/; but I ended up doing a $q->delete_all(); after I process the form variables. But I first put all of the form variables in a hash pre-loaded with "default" values - for the form variables I don't receive back but use. So I don't really work with $q->param

RE: Determine number or word

2001-10-11 Thread Moon, John
page 75 of the Camel book .. $cnt = tr/0-9//; count the digits in $_ hope this gets you started ... -Original Message- From: Rene Verharen [mailto:[EMAIL PROTECTED]] Sent: October 11, 2001 15:59 To: Beginners-CGI List Subject: Determine number or word Hi, Is there a simple way to d

Any suggested response ? FW: Need PERL module DBI on SUN1

2001-10-03 Thread Moon, John
> Does anyone have any suggestions as to how to reply to this gentleman ? > > jwm > > -Original Message- > From: [jwm] *deleted* > Sent: October 03, 2001 09:03 > To:[jwm] *deleted* > Cc: Moon, John > Subject: RE: Need PERL module DBI on S

RE: How to save and retrieve form

2001-09-26 Thread Moon, John
FYI ... I generate reports on a monthly (/daily/weekly/etc) basis ... for various "types" but the same report per "type" each period ... The reports are store in ./Reports/"Type"/Archive/mm.txt.gz So any one "Type" path may have any number of mm.txt.gz files ... I build a screen for m

RE: reg exp

2001-09-20 Thread Moon, John
Try open (FILE, "$file") or die 'Open failed'; # where $file = 'some path and/or file name' while () { print "$_" if /\.\?$/; # the only the last character of the line is a <.,?> ! } hope this give you some ideas ... -Original Message- From: David Draley [m

RE: aanother simple question

2001-09-20 Thread Moon, John
"==" is a numeric operator ... Try "eq" Hope this helps ... -Original Message- From: Wagner [mailto:[EMAIL PROTECTED]] Sent: September 20, 2001 10:18 To: [EMAIL PROTECTED] Subject: aanother simple question Hi, I have another simple question: In my script i have a variable $host that

RE: CGI::POST_MAX use and control

2001-08-23 Thread Moon, John
For myself I would prefer not to "abort" a script on this type of error... A simple JavaScript to check for the max size of a textarea and an "alert" is a much better way to handle this type of error, in my option... see "OnSubmit" in some JavaScript reference and you should be able to find an ex

RE: executing a cgi-script continously

2001-08-16 Thread Moon, John
Please ask your question a different way ... I do not understand what you want to accomplish ... Generally "all" of my scripts "execute them selves again" ... They "reply" to the previous request and wait for the next of many actions a single form could request... If you want the screen to "con

RE: default named parameter values

2001-08-10 Thread Moon, John
So was I ... I could not find a very good discussing on the topic so maybe someone else can supply some references but the "answer" is the "-nosticky" option and pragma ... "use CGI qw/-nosticky/;" I would guess that the idea was for the CGI user NOT to have to re-reference a "named" parameter

RE: popup-menue in a html-page

2001-08-07 Thread Moon, John
Hope this helps ... you can run this from the command line then enter "Ctrl+d" to see what is generates... I'm sure there are other ways of doing this ... You make wish to check the permissions on /etc/password at your shop .. use CGI; $q->new CGI; while (($name,undef,$uid)= getpwent) {

RE: running a Java Script from a CGI

2001-08-06 Thread Moon, John
Stefan, I too had A LOT of trouble with JavaScripts , with Netscape. The original code worked on IE but then when I tried Netscape here is what I had to do: 1) Any JavaScript I wanted to include from a separate file ... my $csript = IncludeScript(); print $q->start_html(-title=>$title, -script=>

RE: Regexes

2001-08-06 Thread Moon, John
Or ... as Mel reminded me ... $a = '08'; $a=sprintf("%d", $a); IF $a is an integer IF $a is NOT an integer $a=sprintf("%f", $a); # but need to say how many decimal places you want to see ... -Original Message- From: Curtis Poe [mailto:[EMAIL PROTECTED]] Sent: August 06, 200

RE: simple

2001-07-31 Thread Moon, John
Why not ... .. if ($true) { print $q->a({-href=>'some.cgi'}, 'This is a Link'); } else { print $q->u('This is a Link'); } The only other way I would know how to do this would be with some Javascript ... but if your "condition" can be determined by the CGI have the

RE: Way off topic...

2001-07-31 Thread Moon, John
"F* Up Beyond All Recognition" (which is what happens to the best of all of us at times ...) ... an "old" military term ... I had that happen once to a program I wrote ... a CGI program ... a PERL CGI program ... in fact ... several programs ... but I now use "strict" -Original Me

RE: Help with Install of DBI - on Unix

2001-07-26 Thread Moon, John
Thank you for the information ... This site has several versions of perl installed ... but I am doing the "perl Makefile.PL" as "perl5.00502 Makefile.pl" Next I changed three references of gcc to cc --- seemed to help ... Then got a version check ... so changed the tokens #PERL = /usr

Help with Install of DBI - on Unix

2001-07-26 Thread Moon, John
I am trying to install DBI (then DBD::ORACLE) in my own library but looks like the build was intended to be for *root* to use ... I cann't find any doc's on making a private copy Has anyone installed DBI in a private/local library ? The error I'm getting is: gcc -c -DDEBUGGING -O -DVER

RE: counting in CGI - any pointers?

2001-07-25 Thread Moon, John
total)); push @sites, $site; print $q->header; print $q->start_html(-title=>'Web Site URL'), $q->table({-align=>'CENTER', -border}, $q->Tr( [ @sites ])), $q->end_html; -Original Message- From:

RE: This is driving me crazy....

2001-07-24 Thread Moon, John
The *[ ]* is telling Tr to make two row ... -Original Message- From: James Kelty [mailto:[EMAIL PROTECTED]] Sent: July 24, 2001 17:15 To: [EMAIL PROTECTED] Subject: This is driving me crazy I am just testing the table capabilities of the CGI.pm, and this is the code that I have wri

RE: counting in CGI - any pointers?

2001-07-24 Thread Moon, John
One Line of data has *foo* and another has *3* and ... OR *foo 3 bleed 45 blee 56 stuff 67 * ? If it's the second can *stuff* = *stuff more stuff then still more stuff* ? Is the record *fixed* or *typed* ? -Original Message- From: Adam Mc Gregor [mailto:[EMAIL PROTECTED]] Sent: Ju

RE: need help with start_table

2001-07-18 Thread Moon, John
One way would be : my $table =''; while(my @row=$sth->fetchrow_array){ print $cgi->Tr({-align => 'left', -valign => 'middle'}, [$cgi->td({}, [@row]) ] ); } print $cgi->table({-border => '1'}, $table); -Original Message- From: Tina Messmann [mailto:[EMA

RE: Perl checking for truth in SQL

2001-07-17 Thread Moon, John
Here is away ... I like to keep all over my *IO* in sub's and treat the sub like a "cursor" so I have the sub return an *undef* value when when the query is finished ... here is a typical IO sub for me ... sub MySchema_Charge { sub dienice;# declare dienice in main my($dbh, $initial, $acct

RE: cgi scripting

2001-07-10 Thread Moon, John
If you supply the code for the programs we may be able to take a look and help... as it is the snipit you supplied works ... -Original Message- From: roops roopa [mailto:[EMAIL PROTECTED]] Sent: July 11, 2001 00:28 To: [EMAIL PROTECTED] Subject: cgi scripting hi all, I am new to progra

RE: dropping off a few decimal points

2001-07-10 Thread Moon, John
One way to do it ... perl -e '$x=1234.5678; ($y)=$x=~/(\d*\.{0,1}\d{0,2})/;print $y ."\n";' -Original Message- From: Thomas Jakub [mailto:[EMAIL PROTECTED]] Sent: July 10, 2001 15:44 To: [EMAIL PROTECTED] Subject: dropping off a few decimal points okay... so how do I drop of all but

RE: Reposting - Please help with error message

2001-07-05 Thread Moon, John
.. -Original Message- From: fliptop [mailto:[EMAIL PROTECTED]] Sent: July 05, 2001 17:37 To: Moon, John Subject: Re: Reposting - Please help with error message "Moon, John" wrote: > > -src=>'Library/JavaScripts/misc_services_menu.js'}); does

Reposting - Please help with error message

2001-07-05 Thread Moon, John
--Original Message----- From: Moon, John [mailto:[EMAIL PROTECTED]] Sent: July 03, 2001 17:38 To: CGI Beginners Subject: Please help with error message Can anyone explain what this error message is trying to tell me ... [03/Jul/2001:17:31:08] catastrophe (20762): for host ... trying to GET /ITP_Billi

RE: Opening HTML file from PERL

2001-07-05 Thread Moon, John
Thanks Curtis ... -Original Message- From: Curtis Poe [mailto:[EMAIL PROTECTED]] Sent: July 05, 2001 15:27 To: CGI Subject: RE: Opening HTML file from PERL --- "Moon, John" <[EMAIL PROTECTED]> wrote: > Don't know if this will help but I am doing something simila

RE: Opening HTML file from PERL

2001-07-05 Thread Moon, John
Don't know if this will help but I am doing something similar ... use strict; no strict "refs"; ... my %DISPLAY = ( # *form value* => *sub name* 10 => 'Personnel', 20 => 'DataCom', 80 => 'Unisys', 30 => 'IBM', 100 => 'Unix',

Please help with error message

2001-07-03 Thread Moon, John
Can anyone explain what this error message is trying to tell me ... [03/Jul/2001:17:31:08] catastrophe (20762): for host ... trying to GET /ITP_Billing/cgi-bin/Library/JavaScripts/misc_services_menu.js, cgieng_start_ou tput reports: could not fork new process (exec() failure [Exec format error]

RE: hidden field value not getting set

2001-06-29 Thread Moon, John
t; parameter ? I guess I'm not understanding "what/how much" is being "sticky" ... Can anyone expand on this ? -Original Message- From: Howdy! [mailto:[EMAIL PROTECTED]] Sent: June 28, 2001 22:13 To: Moon, John Subject: Re: hidden field value not g

hidden field value not getting set

2001-06-28 Thread Moon, John
Below is code to generate one or two forms... When both forms are generated the "hidden" value for the second form is not getting replaced with the "correct" value... Does anyone see a problem with this code ? Thanks in advance ... print $q->p($q->center( "Items from $REQUEST{

RE: split function question

2001-06-28 Thread Moon, John
perl -e 'print "Enter your values as 1,2,3...:"; $_=<>; chomp; my @asLine=split (/,/, $_); foreach (@asLine) { print "asLine[".$i++."]=<$_>\n"; }' You may want to see what you have print "<$_>\n" for example just before you try the split ... -Original Message- From:

Help with make

2001-06-27 Thread Moon, John
Any one know what to do next ... ? I've never used "make" before ... SUN1>perl5.00502 Makefile.PL INSTALLDIRS=site INSTALLSITELIB=/opt/common/html/actual/cgi-bin/Library/CGI then SUN1>make returns ... mkdir blib mkdir blib/lib mkdir blib/arch mkdir blib/arch/auto mkdir blib/arch/auto/CGI m

RE: Help with Download

2001-06-27 Thread Moon, John
Thanks again for the help ... needed to change my default mask to allow tar to create dirs with correct permissions ... I was/am not use to what tar does ... now the make ... -Original Message- From: Moon, John [mailto:[EMAIL PROTECTED]] Sent: June 27, 2001 14:30 To: CGI Beginners

RE: Help with Download

2001-06-27 Thread Moon, John
- cannot create Results of gunzip & tar: SUN1>ls CGI.pm-2.752 CGI_pm_tar SUN1>ls -l .. total 0 drwxrwxrwx 3 usract admin 96 Jun 27 14:25 CGI SUN1> -Original Message- From: fliptop [mailto:[EMAIL PROTECTED]] Sent: June 27, 2001 13:01 To: Moon, John Cc:

Help with Download

2001-06-27 Thread Moon, John
I have downloaded http://stein.cshl.org/WWW/software/CGI/CGI.pm.tar.gz (to pc then ftp to Unix as binary to directory when I want to install ) but am not familiar with the tar processor... When I tried : SUN2>tar xvf *.tar got the following message ... tar: directory checksum error Please help

RE: ? embed scalars in the sql

2001-06-25 Thread Moon, John
What database are you using ? John W Moon -Original Message- From: Francesco Scaglioni [mailto:[EMAIL PROTECTED]] Sent: June 25, 2001 10:59 To: [EMAIL PROTECTED] Subject: ? embed scalars in the sql Hi, Is it possible to embed a scalar into the sql such that the value of the scalar co

RE: Extra ?

2001-06-21 Thread Moon, John
Curtis, Thank you for the suggestion ... This is for "beginners" and I have a lot to learn ! ... I'll use the OO format - just got lazy ... never used "strict" before because it was s strict but some guy named Curtis (and others) kept saying to use it so Thanks for letting me know abo

RE: Extra ?

2001-06-21 Thread Moon, John
urt Edmiston [mailto:[EMAIL PROTECTED]] Sent: June 21, 2001 12:00 To: Moon, John Cc: [EMAIL PROTECTED] Subject: RE: Extra ? > >print $q->endform, "\n"; # offending code maybe ? <== <== ># ># form for input of estimates, sends confirmation/results of submit >

RE: Extra ?

2001-06-21 Thread Moon, John
-maxlength =>$ids{$_}{size})),"\n"); } print "\n"; print center($q->submit({-name=>'Get', -value=>' Get '})); print p( center( 'View Estimate by:', $q->radio_group(-name=>'ACTION', -values=>['ACCOUNT

RE: Extra ?

2001-06-21 Thread Moon, John
From: Mel Matsuoka [mailto:[EMAIL PROTECTED]] Sent: June 21, 2001 00:53 To: [EMAIL PROTECTED] Subject:Re: Extra ? At 10:45 AM 06/21/2001 -0400, Moon, John wrote: >I keep seeing thes

Extra ?

2001-06-21 Thread Moon, John
I keep seeing these "extra" hidden fields in my source ... Does anyone know where/what/why they are being generated ? John W Moon

Server Push - ditto

2001-06-19 Thread Moon, John
Ditto ... any body doing this ?... I too want to uses frames to send a message to another frame without regenerating the form in the originating frame ... or is there a CGI solution I'm not seeing ? John W Moon -Original Message- From: Geraint Jones [mailto:[EMAIL PROTECTED]] Sent: June

RE: How to generate a table ?

2001-06-18 Thread Moon, John
ad habits are hard to break ! John W Moon -Original Message- From: Tillema, Glenn [mailto:[EMAIL PROTECTED]] Sent: June 15, 2001 18:56 To: 'Moon, John'; [EMAIL PROTECTED] Subject: RE: How to generate a table ? #!/usr/local/bin/perl -w use CGI qw/:standard *table/;

How to generate a table ?

2001-06-15 Thread Moon, John
Could someone please suggest a "simpler" way to generate this table ... print '', '', '', 'Customer Id : ', '', '', $q->textfield(-name=>'NEWCUST_ID', -default=>$cust_id,-size=>10, -maxlength=>10), '', "\n", '', '',

RE: Making use of "use" dynamic ?

2001-06-09 Thread Moon, John
Use is a "declaration" so you may want to "use" all of them ... then "call" the one wanted from main ... meaning the name of the sub would need to reflect which "class" "foo1, foo2, foo3" ... perl -e 'print "class ?:"; $class=<>;chomp($class); $sub="foo$class"; &$sub; print "back from <$sub>\n";

RE: Regex question

2001-06-09 Thread Moon, John
Hope this helps ... >perl -e '$str="/blabla/dir/nextdir/name.txt"; ($path,$filenm)=$str=~m/(^.+)\/(\w+\.\w+$)/; print "path=<$path>,file name=<$filenm>\n";' path=,file name= John W Moon -Original Message- From: Bruno Veldeman [mailto:[EMAIL PROTECTED]] Sent: June 09, 2001 16:08 To: [EMA

RE: using modules installed in local CGI bin

2001-06-08 Thread Moon, John
Sorry Al, the script should be ... jwm print "Content-Type:text/html\n\n"; # w/o space works OK on my server :) print

RE: using modules installed in local CGI bin

2001-06-08 Thread Moon, John
Oops ... too much paste ... John W Moon -Original Message- From: Al Hospers [mailto:[EMAIL PROTECTED]] Sent: June 08, 2001 15:57 To: [EMAIL PROTECTED] Subject: RE: using modules installed in local CGI bin is this correct? #!/usr/local/bin/perl print "Content-Type:text/html\n\n"; print

RE: using modules installed in local CGI bin

2001-06-08 Thread Moon, John
Try using BEGIN { $ENV{PATH}.="../libnet/net"; } You may wish to print your "path" and other environment variables just to see what you are getting when you enter Perl... #!/usr/local/bin/perl5.00502 print "Content-Type:text/html\n\n"; print

RE: Decimal To Binary

2001-06-07 Thread Moon, John
Please read about "$_" ... IT is the "default" for the "shift" function ... Perl tries to help ... The Camel has a good discussion on subroutines (ref. Ch 2 "Subroutines" ) ... also see Ch 2 "Global Special Variables" Before I coded any Perl I found the Llama book very helpful and found myself

RE: INSERTing problems

2001-06-07 Thread Moon, John
I have been very successful using Perl's debug feature ... I use this for both CGI programs and "normal" Perl scripts... I always test my cgi programs out on the Unix until I get the expected results THEN go to the browser ... For DBI I usually code my "selects/inserts/updates" as separa

RE: problem

2001-06-04 Thread Moon, John
Derek, Have you tried: print "...", "...", "..."; When writing html I try to make it as easy as I can to read ... later. Also I like the use the cgi modules to print "standard" html entries... again, for readability ... or a "here" document (ref. Chapter 2, Terms in the Ca