In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Rafal Pocztarski)
wrote:
> You could write something like this:
>
> print join "\t", @params{'q001'..'q100'};
or for a slightly better golf score
print "$params{$_}\t" for sort keys %params;
# that is the correct idiom, right?
> i
Thanks guys! You're 2 minutes of wisdom has brought my 100+ line script
down to 20 or so =)
Thanks for your continued support of this newsgroup and its users!
-Shannon Murdoch
> You could write something like this:
>
> print join "\t", @params{'q001'..'q100'};
>
> instead of:
>
> print "$p
On Tue, 16 Oct 2001, Shannon Murdoch wrote:
> So the script halves in size and now becomes:
> print OUTFILE
> "$entrynumber\t$params{q1_1}\t$params{q1_2}\t$params{q1_3}\t$params{q1_4}\t$
> params{q1_5}\t$params{q1_6}\t$params{q1_7}\t$params{q1_8}\t$params{q1_9}\t$p
> arams{q1_10}\t$params{q1_11}
Shannon Murdoch wrote:
> print OUTFILE
> "$entrynumber\t$params{q1_1}\t$params{q1_2}\t$params{q1_3}\t$params{q1_4}\t$
> params{q1_5}\t$params{q1_6}\t$params{q1_7}\t$params{q1_8}\t$params{q1_9}\t$p
> arams{q1_10}\t$params{q1_11}\t$params{q1_12}\t$params{q1_13}\t$params{q1_14}
> \t$params{q1_15}\t$
So the script halves in size and now becomes:
---
#!/usr/bin/perl -w
use CGI qw(:standard);
my $cgi = new CGI;
my %params = $cgi->Vars;
open(COUNTER,"entrycount.txt");
while(){
$entrynumber = $_; ###get previous entry number
last;
}
close(COUNTER);
op
Thanks Brett, that's very handy to know!
Cheers,
-Shannon
> From: "Brett W. McCoy" <[EMAIL PROTECTED]>
> Date: Mon, 15 Oct 2001 23:53:56 -0400 (EDT)
> To: Shannon Murdoch <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Subject: Re: (simple) c
On Tue, 16 Oct 2001, Shannon Murdoch wrote:
> So far my script puts every form item in to it's own variable, and calls
> upon that variable when it is writing the tab-delimited file (which will be
> used in Exel or SPSS etc for data analysis.
>
> Is there an easier way to do this than I have?
Yo
Hi all, I have a small question regarding the processing of variables that
come to my script via the web (using the cgi.pm module to parse and access
item elements).
I have created an online form for my father's doctoral research to process
the answers he's received as he gets them. The form ret