[25397] in Perl-Users-Digest
Perl-Users Digest, Issue: 7642 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 13 18:05:51 2005
Date: Thu, 13 Jan 2005 15:05:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 13 Jan 2005 Volume: 10 Number: 7642
Today's topics:
Adapting perl script to a web environment (Emma-O)
Re: Adapting perl script to a web environment <spamtrap@dot-app.org>
Re: Adapting perl script to a web environment <jgibson@mail.arc.nasa.gov>
Re: Adapting perl script to a web environment <upierz@escomphackers.org>
Re: Adapting perl script to a web environment <spamtrap@dot-app.org>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <spamtrap@dot-app.org>
Advice on starting form based application dbmeyers23@yahoo.com
Re: Advice on starting form based application <no@email.com>
Re: Advice on starting form based application <no@email.com>
Re: Advice on starting form based application xhoster@gmail.com
Re: Advice on starting form based application dbmeyers23@yahoo.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Jan 2005 12:22:34 -0800
From: emma_o_san@hotmail.com (Emma-O)
Subject: Adapting perl script to a web environment
Message-Id: <90aaf2a4.0501131222.11b4b49@posting.google.com>
Hello,
I'm trying to adapt a GNU perl script for using it on a web
environment through CGI.
The script, called textcat, is a language guesser based on n-grams.
This is the source code:
http://odur.let.rug.nl/~vannoord/TextCat/text_cat
And this is the web demo (code doesn't seem to be available, otherwise
I wouldn't ask):
html form: http://odur.let.rug.nl/~vannoord/TextCat/Demo/textcat
cgi: http://wodan.let.rug.nl/vannoord_bin/tc
There's also this code adapted for spam assassin as a pm:
http://spamassassin.rediris.es/full/2.4x/dist/lib/Mail/SpamAssassin/TextCat.pm
I have almost no knowledge of perl but I can understand the code,
since it is quite similar to other programming languages.
Could anyone give some advise to adapt the code for a cgi?
Thanks in advance,
- upierz
------------------------------
Date: Thu, 13 Jan 2005 15:42:55 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Adapting perl script to a web environment
Message-Id: <tIudna2FAtvMQHvcRVn-vA@adelphia.com>
Emma-O wrote:
> I have almost no knowledge of perl but I can understand the code,
> since it is quite similar to other programming languages.
>
> Could anyone give some advise to adapt the code for a cgi?
A good place to start learning Perl is:
<http://learn.perl.org>.
The author of CGI.pm maintains a tutorial about it:
<http://stein.cshl.org/WWW/software/CGI/>
Also, if you haven't done so already, you should read the posting guidelines
for this group - they're posted here often.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Thu, 13 Jan 2005 12:55:05 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Adapting perl script to a web environment
Message-Id: <130120051255055186%jgibson@mail.arc.nasa.gov>
In article <90aaf2a4.0501131222.11b4b49@posting.google.com>, Emma-O
<emma_o_san@hotmail.com> wrote:
> Hello,
>
> I'm trying to adapt a GNU perl script for using it on a web
> environment through CGI.
>
[ details snipped ]
>
> I have almost no knowledge of perl but I can understand the code,
> since it is quite similar to other programming languages.
Why don't you write a CGI script that calls the Perl script? You can
leave the Perl as it is and write your CGI script in a language more
familiar to you.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
------------------------------
Date: Thu, 13 Jan 2005 22:12:06 +0100
From: Emma-O <upierz@escomphackers.org>
Subject: Re: Adapting perl script to a web environment
Message-Id: <cs6o05$11i$1@domitilla.aioe.org>
Sherm Pendley said the following on 13/01/2005 21:42:
> A good place to start learning Perl is:
> <http://learn.perl.org>.
>
> The author of CGI.pm maintains a tutorial about it:
> <http://stein.cshl.org/WWW/software/CGI/>
>
> Also, if you haven't done so already, you should read the posting guidelines
> for this group - they're posted here often.
>
> sherm--
Sherm, thanks for the information.
However, I hoped to get something more specific. I don't expect you to
do this for me, just point me to the right direction in this
*particular* issue.
When somebody asks me something more or less concrete about php, for
instance, I try to answer to that - perhaps in a general fashion - but
I'd never say: go and learn php.
:(
I've tried to adapt the code before coming here. I'm here because I
thought that some specific information would help.
Many thanks,
- upierz
------------------------------
Date: Thu, 13 Jan 2005 16:23:27 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Adapting perl script to a web environment
Message-Id: <P_CdnawfJ8ZMe3vcRVn-rA@adelphia.com>
Emma-O wrote:
> However, I hoped to get something more specific.
Well, to be frank your question was a bit too vague for a more specific
answer. I gave it my best guess. :-(
Based on what you've given though, I'd have to say the best approach to
adapting such a script would be to not adapt the script itself at all.
Instead, I'd just write a simple CGI wrapper around it.
In the simplest case that would just be a matter of passing a few command
line switches and reading whatever output came from the script. Perl's
"open" function accepts piped input from other apps, just like a shell
would - see "perldoc -f open" and "perldoc perlopentut" for details.
For a more complex script, there's an Expect module on CPAN that does pretty
much the same thing as the program of the same name. Have a look on
<http://www.cpan.org> to find that.
You said you've been programming for a while in other languages, so I assume
you're familiar with the usual dangers of passing arbitrary user input to a
command line. The same thing applies to Perl that would apply to any other
language in that regard. For more perl-specific security tips, have a look
at "perldoc perlsec".
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Thu, 13 Jan 2005 21:50:09 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <iejdu0hscocnlu8c6nvpra3ghv9qdumh56@4ax.com>
On 12 Jan 2005 19:20:48 GMT, Martin Kissner <news@chaos-net.de> wrote:
>However, here is some code for you.
>Since I'm new to Perl, too, this is certanly not the best way to solve
>your problem, but it works.
>I took your OP, to analyze the problem by myself and practice coding.
>
> 1 #!/usr/bin/perl
There's hardly any need IMHO to include line numbers. To be fair,
personally I find them to be disturbing...
> 3 use warnings;
> 4 use strict;
Good!
> 5 my $lastline="";
> 6 my @lastline;
> 7
> 8 while (<DATA>)
> 9 {
> 10 chomp ($lastline) if (/^\D/);
> 11 &printline;
> 12 $lastline = $_;
Do you _really_ need this $lastline algorithmic madness?
> 13 }
> 14 &printline;
There's no need to use the &-form of sub call in Perl5: most likely it
won't do what you mean. See 'perldoc perlsub'.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 21:50:14 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <jujdu0lqcjiin51ncqn3hbgck1ps0604mc@4ax.com>
On 12 Jan 2005 08:25:31 -0800, toomanyjoes@mail.utexas.edu wrote:
>This way I can go from a text file to Excel and then into a database.
>Could anyone help me with this?
Incidentally, I have very little experience with databases, but if
this is your purpose then there are much much much better ways (all in
perl, that is) to accomplish the task than following the awkward path
you've chosen.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 21:50:16 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <m4kdu0t1102eq5b1m4uhk1e5eg47itq6d1@4ax.com>
On 12 Jan 2005 09:31:43 -0800, toomanyjoes@mail.utexas.edu wrote:
>Anyone can feel free to post helpful messages despite Paul Lalli's
>post. I realize it is trivial, I'm not a Perl programmer, and I am
>reading up, but my project is waiting for this one simple task to be
>completed before moving on so the faster I figure this out the better.
This _does_ make sense, per se. BUT if you analize the matter more
closely, then you find out the kind of question you asked is SO
elementary that you can hardly imagine one to have even the slightest
good will to "move on" if he refuses to accept the advices he's given
as a good chance to learn. He's not directed you to a study that could
possibly take you days or even hours, it's just a matter of 5 minutes
or so, period.
So there are two possibilities: (i) you don't know Perl, and you don't
want to, and claim so; so you're asking una tantum: so far so fine!
Then most probably someone will give you a helping hand anyway. (ii)
you need/must/want to use perl more than once, as your postS suggest,
then it' UNREASONABLE to proceed without learning how to do such a
simple task as the one you described: it's typically described in the
very first few pages of any introductory text, be it either in
commercial hardcopy or in the form of a free document online. It may
not seem to you to be so, but you've been KINDLY directed to the
relevant piecese od documentation.
I say "KINDLY", because anybody who would send you to said docs is
doing you a favour.
>Paul if its so easy why not code to do it? I suggest you read up on
>newsgroup etiquette.
Does any newsgroup etiquette you're implicitly claiming to be so
familiar with recommend to post replies with no reference whatsoever
to the message they're following up to?!?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 21:50:17 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <mpkdu098er5tan1nktaea78krm6v3sguq6@4ax.com>
On 12 Jan 2005 09:32:09 -0800, toomanyjoes@mail.utexas.edu wrote:
>Anyone can feel free to post helpful messages despite Paul Lalli's
[snip]
>Paul if its so easy why not post code to do it? I suggest YOU read up
>on newsgroup etiquette.
PLEASE do NOT post articles containing no reference whatsoever to...
whatever you're replying to.
PLEASE do NOT post the same article twice.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 21:50:19 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <mskdu01m23rrkdh1kv5oqdcv9vinn7ns2l@4ax.com>
On 12 Jan 2005 10:07:10 -0800, toomanyjoes@mail.utexas.edu wrote:
>In spite of Scotts message anyone can feel free to post useful
>information. Scott, I already knew about those references. I've been
>going through them. My post did not violate any rules for this group, I
Your post indeed violated partly implicit partly explicit behavioural
rules arosen from some sort of general consensus amongst the regulars
here out of common sense to make communications here achieve a high
signal/noise ratio.
>have read those too. I am not new to newgroups, only to the Perl
>language. You guys could make someone new here a little more
>comfortable posting questions. Rather than more people telling me how
You'd be surprised to hear this, and you're free not to trust me on my
word (but you really should, instead!) but newbies more or less at
your level continuously ask questions more or less at the level of
yours. And you won't believe how many of them thank the regulars here
with cmts like "thank you for the responsiveness, what a wonderful
group"!
However no matter how little one knows about Perl, (i) WHAT one asks,
(ii) HOW he/she asks it and (iii) HOW they're willing to accept the
replies DO matter...
This kind of people, when directed to the relevant docs, even by means
of a "gentle RTFM!" have the intelligence and the common sense to
understand that they've been given good advice.
OTOH every now and again newbies with an attitude pop in reacting
harshly, like you did, to just the same kind of replies and start
arguing about how unfriendly the group is and similar stuff, thus
rapidly ending in the killfile of the most helpful, knowledgeable and
resourceful regulars.
>little I know about Perl, I would be much oblidged to anyone who can
>post a little snippet of code for me.
The point is that as long as this is una tantum it's ok. But the claim
that you're willing to know more about Perl is INCOMPATIBLE with the
refusal of finding by yourself "how to do it", especially when finding
out "how to do it" in the relevant docs you've been pointed to is a
matter of 5 MINUTES!!
Incidentally, FWIW I think it's incompatible with the claim that "you
already knew about those references", because you can't have read them
and not know "how to do it" or else you must be a complete moron. Are
you? Are you willing to give that impression?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 21:50:31 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <4pldu0d4noisddisjkb956gabi8j79nj8r@4ax.com>
On 12 Jan 2005 10:43:23 -0800, toomanyjoes@mail.utexas.edu wrote:
>Ahhhh...Thank you guys. I apologize for this threads explosion, it got
>a little out of hand. I just in practice never reply to a post unless I
>have the answer so it irks me when others don't follow that practice.
Please note that just about EVERYBODY who answered in the first place
DID have the answer, be it in the RTFM form or not. And IN THIS CASE
indeed the RTFM ones were the best.
>Next time I'll just remain silent. I really thank you guys for your
>help.
3rd attempt: please include (properly trimmed down to the bare
necessary minimum) quotes of the relevant material you're replying
to!!! (especially taking into account your claims about etiquette -
that begin to sound ridicule!)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 21:50:42 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <evldu01qaaulg6nvael5osie5bd9nmlbu6@4ax.com>
4th attempt: please include (properly trimmed down to the bare
necessary minimum) quotes of the relevant material you're replying
to!!! (especially taking into account your claims about etiquette -
that begin to sound ridicule!)
On 12 Jan 2005 11:15:36 -0800, toomanyjoes@mail.utexas.edu wrote:
>One last post Sherm, then I'm done. No matter what obscenities you
>respond with, and understand this, I'm happy. The code snippet Jim and
Up to the point I read this post in this thread, no obscenity had
popped in. For sure not in Sherm's post, that oh... you didn't quote,
BTW.
>Brian gave me worked. Though in the spirit of learning I wouldn't mind
>getting a break down of what each portion does, RegEx's confuse me.
COMPLEX regexen tend to become confusing, that's what /x is for.
However they can still be confusing, but that's to a large extent a
personal matter. There's NO way a regex just as simple and elementary
like the one required for your purpose can be confusing, or else
abandon Perl (and whatever has to do with regexen) altogether,
forever.
>But heres what I want to say, and in all logic try to understand,
>putting emotions aside. When you ask someone how to do something and
IMHO comparing what others wrote in this thread and the kind of
reaction you responded with suggest that there's only one person that
should put emotions aside, namely YOU. But that is MHO...
>they say "read the manual" in practice that is basically dismissing the
No it isn't, IF RTM is a matter of a few lines that first or later you
will have to read anyway, if you're willing to do anything useful in
Perl, that is...
>question. It has an arrogant "better than thou" tone to it. Is this
No, it doesn't. I think you're about the only one who interpreted it
so. I ASSURE you that nobody would ever assume such a tone in relation
to such a trivial matter.
>hard to understand? Perhaps Paul didn't understand this and still
>doesn't recognize it. Perhaps he didn't even mean it this way, but
>anyone who has asked a question and gotten "Pssh, thats easy read the
>manual" knows exactly what I mean. First that assumes I haven't read
I know that when it happened to me so, it has been a good chance to
learn something new. I have accepted the advice respectfully...
Granted, first or later you'll find idiots who think to be experts and
will give you an RTFM kinda answer even whtn "RTFM" is not so obvious.
Quite similarly first or later you'll find idiots who will give you
ready-made answers (often of mediocre quality at best) when "RTFM"
would have been the kind of answer you would have benefit most.
In practice, had you lurked for a while here, you would have
understood with no doubt that Paul is an extremely helping person and
a knowledgeable contributor to the group, so that if he points you to
the FM, you could at least concede yourself a doubt that he's done so
for your convenience.
>those docs. Which I am still doing (and was doing before I asked the
>question) because I have a few more things I need to do in Perl after
>this. But I don't see the harm in posting a question before I know
>everything about Perl. Now I realize it is a mortal sin to have any
Nobody is urging you to become an excellent Perl hacker in a week or
so. Nobody is bashing you for not knowing everything about Perl.
You're being bashed for your refusal to understand that you can't
proceed any further without at least knowing such BASIC.
>kind of response to a person on newsgroups who basically tells you to
>"fuck off" without multiple allies otherwise you get a barrage of
>emails from that person and his cronies defending him. Thats a mistake
>I made. I'm lucky that some people still were willing to help me
>because no matter what you say after you have a swarm of enemies
>bombarding you with replies, you always come out the bad guy. So thanks
>to those who helped. But I just want to make that clear.
Please note that those who helped did so DESPITE and not BECAUSE OF
your arrogance. Quite about anybody here could have helped you the way
you mean "to help", but you have to understand that those who gave you
a different answer did help you as well...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 21:51:03 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <43ndu05djc9imjfnmkrdv86itsocmeu563@4ax.com>
On 12 Jan 2005 10:08:27 -0800, toomanyjoes@mail.utexas.edu wrote:
>In spite of Scotts message anyone can feel free to post useful
[snip]
>little I know about Perl, I would be much oblidged to anyone who can
>post a little snippet of code for me.
5th attempt: please include (properly trimmed down to the bare
necessary minimum) quotes of the relevant material you're replying
to!!! (especially taking into account your claims about etiquette -
that begin to sound ridicule!)
Please do not send multiple copies of the same posts...
Please, do your best to stop harassing the group...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 21:51:18 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <m4ndu05nh35ssbi2g17aivv2tfr8oq7o48@4ax.com>
6th attempt: please include (properly trimmed down to the bare
necessary minimum) quotes of the relevant material you're replying
to!!! (especially taking into account your claims about etiquette -
that begin to sound ridicule!)
On 12 Jan 2005 10:18:35 -0800, toomanyjoes@mail.utexas.edu wrote:
>I'm not going to let my temper get the better of me Paul, like you just
>did. Showing the passion of your emotions is very unattractive in
>groups like this. Perhaps my "project coordinator" hired the wrong
HUH?!? He made a joke, but once again it seems to me that you're
really attributing to others your own faults for nobody but YOU let
his own temper get the best of himself...
>"staff", true. But the facts are:
>
>1) I have to get this done
OK!
>2) Your post was of no help to me
It would have been, had you the care of reading those docs.
And if you did read them as you've repeatedly claimed (but I find it
hard to believe!) then you should have pointed so in the first place,
and you should have pointed out what you find so hard to understand
about them, too, so that somebody could have provided useful comments
on those particular issues.
>3) I still need help
So what?!?
>I hope you will accept an apology for insulting you. I have read the
>guidelines for this group. I've been posting on these groups for over
>10 years back when it was DejaNews and it has and probably will remain
>a forum to ask people to write code for you, many people learn this way.
(I) Technically "these groups" (which ones? As far as I can see you're
only posting to clpmisc) are NOT "a forum". (II) It has NEVER "been
DejaNews", just as much as now it is NOT "Google".
Claims like these tend to strenghten the impression you've not the
smallest clue about what you're talking about and together with the
arrogant tone you're bringing them in give them impression you're
trying to do the best to make a fool of yourself...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 13 Jan 2005 16:04:22 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <NuGdnX68JPLLf3vcRVn-hw@adelphia.com>
Michele Dondi wrote:
> There's hardly any need IMHO to include line numbers. To be fair,
> personally I find them to be disturbing...
10 PRINT "Having BASIC flashbacks, Michele? :-)"
20 GOTO 10
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: 13 Jan 2005 13:42:07 -0800
From: dbmeyers23@yahoo.com
Subject: Advice on starting form based application
Message-Id: <1105652527.011060.314010@f14g2000cwb.googlegroups.com>
All (sorry so long),
I've been handed a large word document that has many fields (150+)
fields in it. Management would like this form to be web based, so
errors can be detected and hopefully fixed before the form is submitted
and data can be required before submission.
The flow of this form will be the following:
1) User fills out form, but only will be filling in a handful of the
150+ fields.
2) User submits form, and a supervisor will recieve an email. At this
point, all they want is a basic text document with the data formatted
nicely so the supervisor can make changes and save the document. The
document will then be sent to a third party via email. FYI...data is
not sensitive, so a .doc or .txt would suffice.
My question is:
Is there a quick way to only display form values via cgi that have data
in them? So after hitting submit, a text file would be created that
only contains the values that they filled in. For example, if they
only fill in 5 of the 150 form values, what's the best way to display
only the data they filled in. I know how to test this for individual
values...but it will be lengthy for the amount of fields.
Thanks much.
------------------------------
Date: Thu, 13 Jan 2005 21:53:25 +0000
From: Brian Wakem <no@email.com>
Subject: Re: Advice on starting form based application
Message-Id: <34o8umF46chraU1@individual.net>
dbmeyers23@yahoo.com wrote:
> All (sorry so long),
>
> I've been handed a large word document that has many fields (150+)
> fields in it. Management would like this form to be web based, so
> errors can be detected and hopefully fixed before the form is submitted
> and data can be required before submission.
>
> The flow of this form will be the following:
>
> 1) User fills out form, but only will be filling in a handful of the
> 150+ fields.
> 2) User submits form, and a supervisor will recieve an email. At this
> point, all they want is a basic text document with the data formatted
> nicely so the supervisor can make changes and save the document. The
> document will then be sent to a third party via email. FYI...data is
> not sensitive, so a .doc or .txt would suffice.
>
> My question is:
>
> Is there a quick way to only display form values via cgi that have data
> in them? So after hitting submit, a text file would be created that
> only contains the values that they filled in. For example, if they
> only fill in 5 of the 150 form values, what's the best way to display
> only the data they filled in. I know how to test this for individual
> values...but it will be lengthy for the amount of fields.
> Thanks much.
#!/usr/bin/perl
use strict;
use CGI;
my $query = new CGI;
foreach($query->param()) {
if ($query->param($_) {
# print to text file
}
}
--
Brian Wakem
------------------------------
Date: Thu, 13 Jan 2005 22:04:58 +0000
From: Brian Wakem <no@email.com>
Subject: Re: Advice on starting form based application
Message-Id: <34o9kaF46chraU2@individual.net>
Brian Wakem wrote:
> #!/usr/bin/perl
>
> use strict;
> use CGI;
> my $query = new CGI;
>
> foreach($query->param()) {
> if ($query->param($_) {
> # print to text file
> }
> }
>
>
Spot the deliberate mistake!
#!/usr/bin/perl
use strict;
use CGI;
my $query = new CGI;
foreach($query->param()) {
if ($query->param($_)) {
# print to text file
}
}
--
Brian Wakem
------------------------------
Date: 13 Jan 2005 22:06:44 GMT
From: xhoster@gmail.com
Subject: Re: Advice on starting form based application
Message-Id: <20050113170644.177$HC@newsreader.com>
dbmeyers23@yahoo.com wrote:
> For example, if they
> only fill in 5 of the 150 form values, what's the best way to display
> only the data they filled in. I know how to test this for individual
> values...but it will be lengthy for the amount of fields.
Take the way you would test it for individual values, and put in a loop.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 13 Jan 2005 14:41:56 -0800
From: dbmeyers23@yahoo.com
Subject: Re: Advice on starting form based application
Message-Id: <1105656116.891038.247490@f14g2000cwb.googlegroups.com>
actually, i don't see yer mistake;-)
Okay, I guess my other problem would be this.
If I'm printing these results to a file, is there a way to know where
the values came from?
$query = CGI::new();
print $query->header();
$clientname = $query->param("clientname");
$agency = $query->param("agency");
$homedate = $query->param("homedate");
$a1 = $query->param("a1");
$a2 = $query->param("a2");
and on, and on....
So let's say they fill in everything above, excpet "a2"...how could
easily print this to a flat file so it looks like this.
Agency: Paper co.
Home Date: 12-12-2005
etc....
So if
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 7642
***************************************