[10833] in Perl-Users-Digest
Perl-Users Digest, Issue: 4434 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 16 00:07:31 1998
Date: Tue, 15 Dec 98 21:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 15 Dec 1998 Volume: 8 Number: 4434
Today's topics:
Re: 'pipe' an 8-bit file <btate@primary.net>
Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/) (Emmett McLean)
Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/) (Ronald J Kimball)
Re: Decent Editor <rra@stanford.edu>
Re: Getting compiled /usr/include files for Digital Uni (Tad McClellan)
Re: Hashref Compatibility with Perl 4.0 -- TIA (Tad McClellan)
Re: Help: File size weirdness with db's <perl@nullspace.com>
Re: how do I do this common text import task? <rick.delaney@home.com>
Re: making html change (Tad McClellan)
Re: making html change (Tad McClellan)
manipulation of internet addresses jbharvey@corp.home.net
Re: manipulation of internet addresses (Martien Verbruggen)
Re: need Sun Solaris 2.6 sun4u gcc binaires <euclid@crl.com>
Re: need Sun Solaris 2.6 sun4u gcc binaires (Martien Verbruggen)
Re: Perl & Microsoft IIS Server imchat@ionet.net
Personal Web Server, Windows 95-98, Perl. <adam@simpledia.com>
Re: Personal Web Server, Windows 95-98, Perl. (Martien Verbruggen)
Re: Problem with script "... cgi-bin\signup.pl' script imchat@ionet.net
Re: Problem with script "... cgi-bin\signup.pl' script (Worldmall)
Q: When did the Perl FAQ become an official component o (Joseph R. Justice)
suppress error msg of shell commands <mikel@iname.com>
Re: suppress error msg of shell commands <rick.delaney@home.com>
Re: Trying to get all directories recursively <uri@sysarch.com>
Re: Trying to get all directories recursively <perlguy@technologist.com>
Re: uuencoded data in scripts failing to decode / unpac <rmlynch@best.com>
Re: wanted: form that calculates totals (Worldmall)
Re: Why Is Perl not a Language? (Ronald J Kimball)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Dec 1998 21:33:02 -0600
From: "Bob Tate" <btate@primary.net>
Subject: Re: 'pipe' an 8-bit file
Message-Id: <36772841.0@news.primary.net>
I am in the same place as far as coding e-mail. I use the SENDMAIL program
for normal e-mail functions and it is great. I am tring now to develop a
process by wich I can send a message with an attached file via a mailing
list.
The below code works fine in the fact that it will send a message to me and
show the attachment. When attempting to view the attachment however, I get
an error trying to open it. I have done some research on this and believe
that I have found the problem. The file is not being passed as binary but
as ASCII. I am on Solaris 2.6. While I believe that I am close to finding
the answer that I seek, does anyone know what step I might be missing for
the attached file to be sent as binary?
============================================
#!/usr/local/bin/perl
$email_loc = "/export/home/fltops/public_html/fltops/email/notify.lst";
$post_line = "MIME-Version: 1.0\n";
$post_line .= "Content-Type: application/x-zip-compressed;
name=\"bids.zip\"\n";
$post_line .= "Content-Transfer-Encoding: binary\n";
$post_line .= "Content-Disposition: attachment; filename=\"bids.zip\"\n\n";
$subject = "Monthly Bid Package";
open
(FILE,"/export/home/fltops/public_html/fltops/bid/download/100684.zip");
binmode(FILE);
while(<FILE>)
{
$post_line .= $_;
}
close(FILE);
open(FILE,"$email_loc");
while(<FILE>)
{
$line = $_;
@row = split(/\|/,$line);
if ($row[3] == 1)
{
open (SENDMAIL, "| /usr/lib/sendmail -t -n");
print SENDMAIL "From: TWA\n";
print SENDMAIL "To: $row[1]\n";
print SENDMAIL "Subject: $subject\n";
print SENDMAIL $post_line;
close(SENDMAIL);
}
}
close(FILE);
=========================================
------------------------------
Date: 15 Dec 1998 20:49:50 -0800
From: emclean@slip.net (Emmett McLean)
Subject: Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/)
Message-Id: <757e5e$j1e@slip.net>
I think some of the people in this thread should concentrate
on Perl and lighten up a bit.
Emmett
In article <fl_aggie-1412981003240001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>In article <752gnd$shi@slip.net>, emclean@slip.net (Emmett McLean) wrote:
>
>+ >The FAQ doesn't get posted because it is INCLUDED with your copy of
>+ >Perl.
>+
>+ Not mine.
>
>Then its broken. Complain to the appropriate person(s).
>
>+ > And a mini-FAQ gets posted here every few days that says that.
>+
>+ You're grasping, I searched the most recent listing of 500 messages and didn't
>+ find a match on FAQ.
>
>Really? I just did a subject search on my not-so-local-spool, and I came
>up with 4 matches on 'FAQ'. Of that, two where pertinent:
>
>Message-ID: <perl-resource-list-1-913604402@frii.com> [posted 13 Dec]
>Message-ID: <pfaqmessage913116240.3330@news.teleport.com> [posted 8 Dec]
>
>What was your argument again?
>
>+ And another mini-FAQ gets posted
>+ >every few days to comp.lang.perl.announce as well. Do we need to
>+ >attach this info to EVERY post? <sigh>
>+
>+ Absolutely not. If you are not inclined to answer you can pass.
>
>Really, now? I'll expect a full apology for that statement.
>
>+ >Emmett> In my case I researched the question for over a half hour with
>+ >Emmett> Wall's text and didn't come up with an answer.
>+ >
>+ >Yes, I am intimately familiar with that text, and I can assure you
>+ >that the answer is not there. :)
>
>+ Hum, first you complain I didn't read the FAQ then you agree that the
>+ answer is not there.
>
>Wall's text is now the FAQ? well, perhaps...
>
>+ That would be best. I'd appreciate answers and helpful suggestions
>+ but don't look forward arrogance, grumpy posts and disparaging comments.
>
>Here's a suggestion. Spend a week reading thru Programming Perl. Spend
>another couple of days familiarizing yourself with 'perldoc' the command.
>During that time, lurk here, and learn to work Dejanews.
>
>Thems that learn to reach for the book on their shelf, and not the <post>
>button, usually get better, faster answers...
>
>James
------------------------------
Date: Tue, 15 Dec 1998 23:52:41 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/)
Message-Id: <1dk3pvo.1bib7sq4muhdsN@bay1-177.quincy.ziplink.net>
Randal Schwartz <merlyn@stonehenge.com> wrote:
> And for the 72nd time... it's not *parole*, it's *probation*.
> I've not been to "the big house". I did not "get out early".
And he was not on "good behavior".
:-)
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 15 Dec 1998 20:16:23 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Decent Editor
Message-Id: <ylr9u04t7s.fsf@windlord.stanford.edu>
Matt Schuette <schuette@umr.edu> writes:
> Can't we all just get along? The only descent editor for Person X is
> the one that Person X writes from scratch.
You heard it here first, folks. The only decent editor is Perl
one-liners.
:)
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Tue, 15 Dec 1998 19:48:43 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Getting compiled /usr/include files for Digital Unix
Message-Id: <rh3757.ige.ln@magna.metronet.com>
ftidev@fhb.clickcharge.com wrote:
: Also, let me ask the general question. If I attempt to fix this problem,
: and the solution is in a modification of some Perl-distributed software,
: what is the Perl-approved method of getting my correction into the next
: version of perl?
perldoc perlbug
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Dec 1998 19:41:54 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Hashref Compatibility with Perl 4.0 -- TIA
Message-Id: <253757.ige.ln@magna.metronet.com>
Christian M. Aranda (christian.aranda@iiginc.com) wrote:
: I have the need to write perl scripts using only verion 4.0. There
: are many reasons that I can not use a current version. Here is the
: exact version of perl I'm using --
Your boss has pointy hair, I take it?
Crackers are gonna like it at your house (see www.cert.org
if you want to see how your door might be wide open...)
: ----------
: This is perl, version 4.0
: $RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
That's an odd filename extension for a Perl program...
: I need to use a hashref which I've grown to know and love lately, but
: can't seem to get it to work with 4.0. Here is the hashref I'm
: initializing:
: %how_found_map = (
: "code review" => $phase_intro[0],
%how_found_map = (
"code review", $phase_intro[0],
...
: There must be a
: "correct" way to initialize a hashref with perl 4.0,
There is *not*.
4.0 does not have references.
That's OK for what you are trying to do though, since you are
initializing a _hash_, not a hash reference.
: but I have
: exhausted my resources.
It seems clearly explained in the perldata man page...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Dec 1998 19:06:14 -0800
From: Steve Harris <perl@nullspace.com>
Subject: Re: Help: File size weirdness with db's
Message-Id: <367723A6.8BE39285@nullspace.com>
This is in the NDBM and DB docs. This should
NOT be happening with GDBM, though, as far as I
know. At least on my system that is how I got rid
of the anomaly. GDBM files are bigger than the others
in reality, but I haven't found this to be a problem.
This is normal for SDBM and is in the docs. As I said,
I haven't noticed this for GDBM. It shouldn't present
a problem so long as your data is "FTP'able".
--Steve
Perry Friedman wrote:
>
> I have tested this on PC Solaris and Sparc Solaris with various versions
> of Perl 5, and all have shown the same symptoms:
>
> I create a DB (either using tie or dbmopen). It doesn't matter whether
> it is NDBM_File, GDBM_File, SDBM_File, etc. The symptoms are always the same.
> In a nut shell, the file size reported by "ls -l" for the individual file
> does not jive with the file size reported by "du" or "df -k" or even the
> total for the directory using ls.
>
> Furthermore, if I "cp" the file, the new file behaves normally wrt to du
> and df -k.
>
> Here is an example of what I mean:
> I create an NDBM db. Here is an ls -l on the directory:
>
> total 16392
> -rw------- 1 pickem staff 4096 Dec 15 17:45 NEW.dir
> -rw------- 1 pickem staff 33230848 Dec 15 17:45 NEW.pag
>
> Here is a du -k on the directory:
> 8197
>
> Now, the file looks to be about four times as big as is reported by du or
> even the directory total.
>
> Now I do a "cp NEW.pag N"
>
> ls -l reports:
> total 81352
> -rw------- 1 pickem staff 33230848 Dec 15 17:49 N
> -rw------- 1 pickem staff 4096 Dec 15 17:45 NEW.dir
> -rw------- 1 pickem staff 33230848 Dec 15 17:45 NEW.pag
>
> and du -k reports:
> 40677
>
> The amount of K added jives with the individual file size, as does the number
> of blocks added. But the total is still off.
> This is really weird.
>
> Anyone know why this would be? Is this a bug in Perl? In Solaris? In ls?
> Actually, it is not just Solaris. I just tested this with SDBM_File on BSD
> and also experienced the same symptoms.
>
> It is very odd.
>
> Perry
------------------------------
Date: Wed, 16 Dec 1998 04:01:52 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: how do I do this common text import task?
Message-Id: <36773253.950F459F@home.com>
[posted & mailed]
Larry Rosler wrote:
>
> In article <36770063.9871B481@home.com> on Wed, 16 Dec 1998 00:28:34
> GMT, Rick Delaney <rick.delaney@home.com> says...
> >
> > print join(',', / (\w+)/g), "\n" while <DATA>;
>
> Yes. I didn't notice the letters in the data or the missing letters
> in the output from my test.
>
> Perhaps for generality the leading space in the regex should be
> "[ \t]". It can't be "\s" because of the newlines in each record.
One final word (at least from me :-). Since we are interested in
pulling out the last 'word' on each line, it might be worthwhile to
construct the regex to reflect this.
"/\S+$/gm" would do it for 'words' defined as a sequence of
non-whitspace characters.
If we wanted to allow whitespace in the fields then we could just pull
out everything after the label:
print join(',', /\w+[ \t]+(.*)/g), "\n" while <DATA>;
Like you say, "[ \t]" is needed because the newline would be slurped
into "\s" in the case of an empty field.
Okay, that was more than one word, but I did mean the "final" part.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Tue, 15 Dec 1998 20:45:01 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: making html change
Message-Id: <dr6757.ige.ln@magna.metronet.com>
Kevin Johnson (kevin@utig.ig.utexas.edu) wrote:
: Hi. I'm missing something simple here I'm sure. I've added quite a bit
: of code trying various things, but maybe one of you could point out my
: mistakes.
: What I have is a directory full of html files. I would like to search
: for the names of
: these files in a html document I specify. When I find a match, I would
: like to change
: the text to an href pointing to the html file it corresponds to.
Uhhh.
I'm missing something simple here I'm sure.
What problem are you having?
Got any symptoms?
Like: I expected A but I'm getting B
I get these messages...
It is puttin an extra '.htm' in the href attribute
It only changes the very first file and ignores the rest
It dumps core
It hangs up
???
: This is my program so far...
: markup.pl:
: if ($ARGV[0]) {$ifile=$ARGV[0];} else {die "markup.pl file.html"}
^^^^^^^^^
If you use the $0 special variable there instead, you won't
need to update it everytime you change the script's name.
: open(HTML,"$ifile") || die "Can't open $ifile";
You should include the $! special variable for more help
in diagnosing what went wrong:
open(HTML,"$ifile") || die "Can't open $ifile $!";
: open(OUT,">$ifile.bak");
You checked the return value from the first open() but
not from this one?
: opendir(THIS,"../patches");
You should check the return value here too.
: for ($i=0;$i<=$#files;$i++) {
: $href = "<a href=\"../patches/$files[$i].htm\">$files[$i]</a>";
: $t = $_;
: $t =~ s/$files[$i]/$href/og;
^
^
You have broken the promise that you made to perl.
When you use the o option, you are promising to never change
the pattern, yet you are changing the pattern.
Shame on you! ;-)
If you cannot leave the pattern unchanged, then don't promise
to leave it unchanged (remove the o option).
You don't need to copy it to $t, change $t, and copy it back
either. You can just change $_ directly...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Dec 1998 20:59:14 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: making html change
Message-Id: <2m7757.bpe.ln@magna.metronet.com>
Tad McClellan (tadmc@metronet.com) wrote:
: : if ($ARGV[0]) {$ifile=$ARGV[0];} else {die "markup.pl file.html"}
: ^^^^^^^^^
: If you use the $0 special variable there instead, you won't
: need to update it everytime you change the script's name.
Which would be pretty silly in this case, since the
die() will print the filename anyway...
... never mind.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 16 Dec 1998 03:37:16 GMT
From: jbharvey@corp.home.net
Subject: manipulation of internet addresses
Message-Id: <MVFd2.321$v6.411@news.rdc1.sfba.home.com>
Does Perl have any modules or example code for converting and dealing
with CIDR block addresses?
--
Justin B. Harvey @Home Network
@Work Software Engineer 425 Broadway
jbharvey@corp.home.net Redwood City, CA 94063
Voice: (650) 569-5692 http://www.home.net
------------------------------
Date: Wed, 16 Dec 1998 04:45:14 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: manipulation of internet addresses
Message-Id: <uVGd2.130$595.238@nsw.nnrp.telstra.net>
In article <MVFd2.321$v6.411@news.rdc1.sfba.home.com>,
jbharvey@corp.home.net writes:
> Does Perl have any modules or example code for converting and dealing
> with CIDR block addresses?
# perl -MCPAN -e shell
cpan> i /CIDR/
Distribution M/MA/MARKPRIOR/CIDR-Assign-0.01.tar.gz
Module CIDR::Assign (M/MA/MARKPRIOR/CIDR-Assign-0.01.tar.gz)
cpan>
Maybe that module does what you need. You could have also found this
out by going to http://www.perl.com/CPAN/modules, and checking the
modules lists there.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: Tue, 15 Dec 1998 19:58:29 -0800
From: euclid <euclid@crl.com>
Subject: Re: need Sun Solaris 2.6 sun4u gcc binaires
Message-Id: <36772FE5.67BAF8BF@crl.com>
I desparately need Sun Solaris 2.6 sun4u gcc binaires in order to build
Perl and Apache..(uh... right) I am wondering if this will even work..
any Perl/Apache on Sun Solaris 2.6 sun4u??
;-(
regards,
mike anderson
p.s. I have posted to gc. gcc. gc++..etc.. (no one is home there)
------------------------------
Date: Wed, 16 Dec 1998 04:48:13 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: need Sun Solaris 2.6 sun4u gcc binaires
Message-Id: <hYGd2.131$595.238@nsw.nnrp.telstra.net>
In article <36772FE5.67BAF8BF@crl.com>,
euclid <euclid@crl.com> writes:
> I desparately need Sun Solaris 2.6 sun4u gcc binaires in order to build
> Perl and Apache..(uh... right) I am wondering if this will even work..
> any Perl/Apache on Sun Solaris 2.6 sun4u??
> ;-(
> regards,
> mike anderson
> p.s. I have posted to gc. gcc. gc++..etc.. (no one is home there)
How long did you wait for an answer from one of them? Those are
definitely much more appropriate groups. A group for solaris would
probably have been even more appropriate.
Oh, what the hell. I'm feeling generous today.
Solaris precompiled stuff:
http://smc.vnet.net/solaris_2.5.html
The same site has pages for other versions of Solaris as well.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | You can't have everything, where would
Commercial Dynamics Pty. Ltd. | you put it?
NSW, Australia |
------------------------------
Date: Wed, 16 Dec 1998 03:45:38 GMT
From: imchat@ionet.net
Subject: Re: Perl & Microsoft IIS Server
Message-Id: <36772c2b.1040526227@news.ionet.net>
On Tue, 15 Dec 1998 18:47:03 -0600, johkar <johkar@netins.net> wrote:
>At work
they just switched to a Microsoft server.<
LOL, they'll learn to regret that descision. Get Xitami webserver, or
even, Hey, Apache? Free and whip MS butt from here till next
Christmas.
------------------------------
Date: Wed, 16 Dec 1998 04:17:43 GMT
From: "Adam Michela" <adam@simpledia.com>
Subject: Personal Web Server, Windows 95-98, Perl.
Message-Id: <HvGd2.31$bX1.2306@typhoon.nycap.rr.com>
Anyone know if it is possible to set up personal web server with perl on a
windows95, or 98 system, I see alot of references about it. But I see
nothing telling you how.
Any help would be appreciated, thank you.
Adam Michela
------------------------------
Date: Wed, 16 Dec 1998 04:51:21 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Personal Web Server, Windows 95-98, Perl.
Message-Id: <d%Gd2.132$595.238@nsw.nnrp.telstra.net>
In article <HvGd2.31$bX1.2306@typhoon.nycap.rr.com>,
"Adam Michela" <adam@simpledia.com> writes:
> Anyone know if it is possible to set up personal web server with perl on a
> windows95, or 98 system, I see alot of references about it. But I see
> nothing telling you how.
Yes, someone knows. That someone most likely is currently reading one
of the newsgroups in the comp.infosystems.www.* hierarchy, which is
where they actually talk about the www, HTTP, HTML, CGI, and web
servers and their configurations.
I therefore advise you to post this question in the most appropriate
group over there, and leave us to discuss Perl, the genetic
manipulation of camel foetuses, cucumber growing and the new colour
for the exit signs, just above the door to your right.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: Wed, 16 Dec 1998 03:41:17 GMT
From: imchat@ionet.net
Subject: Re: Problem with script "... cgi-bin\signup.pl' script produced no output "
Message-Id: <36772ad3.1040182433@news.ionet.net>
You might want to post a bit of code. FWIW I suggest you get a web
server that doesn't limit you. Its not NT server but the web server
thats limiting the perl. I use Xitami at home on NT and my shebang
line goes something like this.
#!/usr/bin/perl
Thats the same line I use with my Unix server!
Xitami doesn't give a crap about whats in the registry either.
On 16 Dec 1998 02:22:34 GMT, careermngr@aol.com (CareerMngr) wrote:
>Problem with script "... cgi-bin\signup.pl' script produced no output "
>
>Any ideas why a perl script installed to a NT server might produce the above
>error message (or know someone who can help me)? I've installed the scripts
>more than a dozen times to UNIX and freebsd servers without a problem.
>
>I know NT wants everything it's own way so I:
>
>- changed *.cgi extensions to *.pl
>- Replaced all instances of #!/usr/bin/perl with [print "HTTP/1.0 200 OK\n";]
>- Removed all instance of [print "Content-type: text/html\n\n";]
>- Changed all required references to something like [$lib =
>"d:\\inetpub\\users\\mysite\\cgi-bin\\";]
>- Moved cgi's to /cgi-bin, since the NT server I'm installing to prohibits cgi
>applications to run anywhere other than /cgi-bin.
>
>Before I made the last change only blank pages were loading, now I get the
>following error message: 'd:\inetpub\users\ledscc\cgi-bin\signup.pl' script
>produced no output' :(
>
>Any ideas how I go about fixing this?
>
>Thanks for your help!
>
>Andre'
>
------------------------------
Date: 16 Dec 1998 03:50:36 GMT
From: worldmall@aol.com (Worldmall)
Subject: Re: Problem with script "... cgi-bin\signup.pl' script produced no output "
Message-Id: <19981215225036.15582.00003916@ng-fi1.aol.com>
>You might want to post a bit of code. FWIW I suggest you get a web
>server that doesn't limit you. Its not NT server but the web server
>thats limiting the perl. I use Xitami at home on NT and my shebang
>line goes something like this.
>#!/usr/bin/perl
>Thats the same line I use with my Unix server!
>Xitami doesn't give a crap about whats in the registry either.
Yes, I have xitami too (and love it) but do not have a dedicated web connection
of my own, therefore I must use the services of an ISP. If you know an
inexpensive way to control a dedicated connection so I can run xitami for
myself please let me know.
Thanks!
Andre'
p.s. Here's the code:
print "HTTP/1.0 200 OK\n";
###########################################################
# Pull in system configuration
#
$lib = "/cgi-bin";
require "d:/inetpub/users/leads/config.pl";
#
# Pull in required libraries
#
require "d:/inetpub/users/leads/cgi-bin/mail.pl";
require "d:/inetpub/users/leads/cgi-bin/dbmember.pl";
require "d:/inetpub/users/leads/cgi-bin/dbcompany.pl";
require "d:/inetpub/users/leads/cgi-bin/ez_html.pl";
require "d:/inetpub/users/leads/cgi-bin/web_basic.pl";
#
# Global variables
#
&HTML_Header( "$MLMWEB_NAME Signup Results" );
if ( $disable ) {
&HTML_Section( "$MLMWEB_NAME Signup Disabled",
"The Automatic Web Page system for $MLMWEB_NAME is \n".
"temporarily down for maintenance. We apologize for \n".
"any inconvenience.\n" );
&HTML_Footer;
exit;
}
%in=&Get_Form_Data;
if ( scalar keys %in <= 0 ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"The form you submitted contained no data. If this was\n".
"not the case, your browser may not handle posting form\n".
"data properly.\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
}
&OpenMemberDB;
&OpenCompanyDB;
#
# Check for valid entry fields
#
if ( $in{'htmltitle'} eq '' ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"You must give a title for your web page.\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
}
if ( $in{'email'} !~ /(\S+?\@\S+)/ ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"You must give a valid Internet e-mail address \n".
"(i.e. me\@foo.bar)\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
} else {
$in{'email'} = $1;
}
if ( $in{'phone'} eq '' ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"You must give a phone number.\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
}
if ( !&ValidateKey( $in{'key'} ) ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"You must enter a username");
&HTML_Footer;
&CloseMemberDB();
exit;
}
if ( length $in{'password'} < $min_password_size ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"Your password must be at least 6 characters.\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
}
if ( $in{'password'} ne $in{'confirm_password'} ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"Your confirmed password entry does not match.\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
}
if ( $in{'firstname'} eq '' || $in{'lastname'} eq '' ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"You must give a first and last name.\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
}
if ( $in{'address'} eq '' || $in{'city'} eq '' || $in{'state'} eq ''
|| $in{'zip'} eq '' || $in{'country'} eq '' ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"You must fill out all of the address information." );
&HTML_Footer;
&CloseMemberDB();
exit;
}
if ( !defined $dbmember_index{ $in{'sponsor'} } &&
scalar keys %dbmember_index > 0 ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"The sponsor id '$in{'sponsor'}' is invalid.
Please\n".
"check your input and make sure it was entered \n".
"exactly as it appears on your sponsor's page.\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
} else {
if ( scalar keys %dbmember_index == 0 ) {
$in{'parent'} = '';
$in{'key'} = $default_key;
} else {
$in{'parent'} = $in{'sponsor'};
}
}
if ( defined $dbmember_index{ $in{'key'} } ) {
&HTML_Section( "$MLMWEB_NAME Signup Error",
"The id '$in{'key'}' is already in use. Please \n".
"choose a different combination of letters and \n".
"digits and try again.\n" );
&HTML_Footer;
&CloseMemberDB();
exit;
}
$in{'company list'} = "#new#".time();
#
# Generate the member page and remove the old counter, if any.
#
open MEMBER_PAGE, ">$member_dir/$in{'key'}.html";
print MEMBER_PAGE $template_page;
close MEMBER_PAGE;
system "rm $member_dir/.$in{'key'}.dat";
#
# Insert the member
#
$in{'creation'} = time();
$in{'password'} = &EncryptPassword($in{'key'}, $in{'password'});
$in{'children'} = '';
&InsertMember( \%in );
$level = &QueryLevel( $in{'key'} );
#
# Update the statistics log
#
open STATLOG, ">>$statistics_file";
flock STATLOG, $LOCK_EX;
print STATLOG "SIGNUP|$in{'firstname'} $in{'lastname'}|$in{'key'}|".
"$in{'email'}|$level|$in{'parent'}|".time()."\n";
close STATLOG;
#
# Generate the notification e-mails
#
%sponsor_fields = &LoadMember( $in{'parent'} );
# Notify sponsor
$info{'to'} = "$sponsor_fields{'firstname'} $sponsor_fields{'lastname'}";
$info{'to_email'} = $sponsor_fields{'email'};
$info{'from'} = "$MLMWEB_NAME Web Page System";
$info{'from_email'} = $admin_email;
$info{'reply_to'} = $in{'email'};
$info{'message_file'} = 'sponsor_notify.msg';
$info{'subject'} = "Your New $MLMWEB_NAME Signup";
$info{'delivery'} = 'immediate';
$subs{'SPONSOR_FIRST_NAME'} = $sponsor_fields{'firstname'};
$subs{'SPONSOR_LAST_NAME'} = $sponsor_fields{'lastname'};
$subs{'SPONSOR_NAME'} = "$sponsor_fields{'firstname'}
$sponsor_fields{'lastname'}";
$subs{'SPONSOR_EMAIL'} = $sponsor_fields{'email'};
$subs{'MEMBER_FIRST_NAME'} = $in{'firstname'};
$subs{'MEMBER_LAST_NAME'} = $in{'lastname'};
$subs{'MEMBER_NAME'} = "$in{'firstname'} $in{'lastname'}";
$subs{'MEMBER_ID'} = $in{'key'};
$subs{'MEMBER_EMAIL'} = $in{'email'};
$subs{'MEMBER_PAGE_URL'} = $member_base_url.$in{'key'}.".html";
$subs{'MEMBER_ADDRESS'} = $in{'address'};
$subs{'MEMBER_ADDRESS2'} =
"$in{'city'}, $in{'state'} $in{'zip'} $in{'country'}";
$subs{'MEMBER_PHONE'} = $in{'phone'};
$subs{'MEMBER_FAX'} = $in{'fax'};
&SendMail( \%info, \%subs );
# Send welcome message to member
delete $info{'reply_to'};
$info{'to'} = "$in{'firstname'} $in{'lastname'}";
$info{'to_email'} = $in{'email'};
$info{'from'} = "$MLMWEB_NAME Web Page System";
$info{'from_email'} = $admin_email;
$info{'message_file'} = 'welcome.msg';
$info{'subject'} = "$MLMWEB_NAME Signup";
$info{'delivery'} = 'immediate';
&SendMail( \%info, \%subs );
&HTML_Section( "$MLMWEB_NAME Signup Successful",
"A new personal web page has been created for you at\n".
"<P><A TARGET=\"_top\" HREF=\"$member_base_url/".
"$in{'key'}.html\">"."$member_base_url/"."$in{'key'}.html</A>".
"<P>Your $MLMWEB_NAME identification number is ".
"<B><CODE>$in{'key'}</CODE></B>.\n".
"<P>Please write this down.<P>".
"You will be emailed instructions on what\n".
"to do next." );
$in{'login key'} = $in{'key'};
&HTML_Footer('LONG');
&CloseCompanyDB;
&CloseMemberDB;
------------------------------
Date: 15 Dec 1998 22:01:44 -0500
From: jrj@radix.this-is.a-false.address (Joseph R. Justice)
Subject: Q: When did the Perl FAQ become an official component of the "perl distribution"?
Message-Id: <7577qo$gjh$1@saltmine.radix.net>
[Boilerplate warning: The From: address displayed is deliberately
corrupted in an attempt to foil spammers. My correct e-mail address
has (at the end) "radix.net", begins with "jrj", and has an
at-sign in the middle. Thanks. -- J]
[Boilerplate warning: NOTICE! My reading of Usenet newsgroups is
*sporadic* and random in the extreme! Therefore, if you post a
response here to this article, I may *not* see it! If you want to
make sure I see your response, please CC me via e-mail with it, and
indicate within it that it has been both posted and e-mailed to me.
Thanks. -- J]
[P (and M to Emmett). -- J]
Hi, Emmett. Just FYI, I'm (basically) a Perl newbie too. I've
lurked, and ocassionally posted, in this newsgroup on and off for a
while now, but I am definitely not one of the Grand Old Men of Perl
(be it books, Usenet newsgroups, depth and breadth of Perl knowledge
in general, etc), such as Wall, Schwartz, et al. Just telling you
this so you know where *I* am coming from.
Ummm... From reading this thread so far, including other responses to
your post I'm responding to, I get the feeling that there's more than
a little misunderstanding, hurt feelings, miscommunication, etc going
on on both sides. "They" are, in fact, right in much or most of what
they said, but, y'know, you're right too, at least in part. It's just
that this kind of thing is an ongoing battle, a constant source of
tension in this newsgroup, and many of the regulars here see it day in
and day out and are tired of it, which is probably why you've gotten
some of the responses you've gotten (if you hadn't yet realized why
you were getting the responses you have).
However, there's one specific thing you mention below that I don't
think has been explicitly addressed yet. To wit:
According to Emmett McLean <emclean@slip.net>:
> Randal asked ?
> >Emmett> Just a comment. Aside from the fact that no one has bothered
> >Emmett> to post the FAQ in a long time.
> >
> >The FAQ doesn't get posted because it is INCLUDED with your copy of
> >Perl.
>
> Not mine.
followed by comments on this thread of "your distribution is broken
because you didn't get a FAQ document with it", etc.
Well, as it turns out, in the *current* distribution of perl (from
www.perl.com, that's, like, 5.005_02), it is indeed the case that all
the FAQ documents are part of the source distribution, and are
supposed to be provided with any binary-only distribution (or else can
be easily gotten from the distributor or some other reasonable
source). And, furthermore, it is indeed the case that this *has* been
the case for a fair while now, I *believe* since some past version of
Perl v5 was released. However, I don't myself know *which* specific
version of Perl v5 incorporated the FAQ documents as an official part
of the distribution.
This leads to two interesting questions:
(1) What version of Perl do *you* have? You should be able to
determine this with a command line of "perl -v".
(2) Which specific version of Perl was the first to have the FAQ
documents included as an official part of the distribution? I
don't see an answer in perlfaq, perlfaq1, perlfaq2, "What is Perl
5", "perldelta for 5.004" or "perldelta for 5.005", all of which I
just now skimmed. Looking at perlhist, I suspect (but am *not*
sure) that they weren't in the original perl 5.000. So, when
*were* they added? Can anyone give a definitive answer?
Further notes: Reviewing the following URL:
<http://www.oasis.leo.org/perl/src/perl5/perl5.00X.dsc-list.html>,
tends to make me believe the FAQ documents were not an official
part of Perl 5 up through at least 5.003. So, if Mr. McLean's
version is, say, pre 5.004, it's very likely his distribution
*didn't* come with FAQ documents, and furthermore wasn't broken in
not coming with them! (Agreed, he's still using a fairly
out-of-date version of Perl, but that's a separate issue.)
Anyway. Hope this has been of some use and interest, and succeeded in
bringing forth some light, and not heat. Thanks for your time. Be
well.
Joseph
--
Joseph R. Justice == jrj, at radix.net ==
?????, at anon.penet.fi == ?????, at anon.twwells.com
(EFNet) IRC: jrj, jrjx, jrjxx http://www.radix.net/~jrj
"Just Another Member of the DigExodus"
------------------------------
Date: Tue, 15 Dec 1998 18:56:13 -0800
From: Mike <mikel@iname.com>
Subject: suppress error msg of shell commands
Message-Id: <3677214D.ACE91766@iname.com>
Maybe this is very trival, but I could not seem to find
a way doing it.
I want to suppress all error messages when I do the follwoing
inside perl scripts.
$osver=`rsh $host uname -r`;
It spits out "Permission denied" when it coud not rsh to $host.
thanks a million! Please reply to my email at milin@cisco.com
Mike
------------------------------
Date: Wed, 16 Dec 1998 04:29:21 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: suppress error msg of shell commands
Message-Id: <367738E0.AD2EAD17@home.com>
[posted & mailed]
Mike wrote:
>
> Maybe this is very trival, but I could not seem to find
> a way doing it.
>
It's not so trivial that it hasn't been asked frequently before.
> I want to suppress all error messages when I do the follwoing
> inside perl scripts.
>
> $osver=`rsh $host uname -r`;
>
> It spits out "Permission denied" when it coud not rsh to $host.
See perlfaq8, "How can I capture STDERR from an external command?".
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: 15 Dec 1998 22:00:45 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Trying to get all directories recursively
Message-Id: <x7hfuwpz8i.fsf@sysarch.com>
>>>>> "MV" == Martien Verbruggen <mgjv@comdyn.com.au> writes:
MV> In article <3677151e.9665451@news.ntplx.net>,
MV> parenc@rpi.edu (Christopher Parent) writes:
>> I can't use the FInd command. Eventually I'll be using the algorithm
MV> Are you saying you can't use the File::Find module? Why not? Every
MV> recent perl ships with it. If you have an older perl, you should
MV> upgrade, if not for this reason, then for many others.
i think the newbie is confusing the unix find command with the
module. it sounds like he doesn't even know what modules are since he
didn't recognize the earlier replies which mentioned File::Find.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 15 Dec 1998 21:56:09 -0600
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Trying to get all directories recursively
Message-Id: <36772F59.8751A52E@technologist.com>
Chris,
1) I believe that the File::Find module will do what you are looking
for.
2) If you still want to do this program to learn, I had a similar
problem solving a similar problem... I think your variables are getting
clobbered when you call the subroutine recursively. I solved this by
using "my" in front of all of the variables in my subroutine. This then
made them all "local" to the current instance of the subroutine that
called them...
Good luck!
Brent
--
Java? I've heard of it, it is what I drink while hacking Perl! -me
+----------------------------------------+
| Brent Michalski |
| -- Perl Evangelist -- |
| E-Mail: perlguy@technologist.com |
| Resume: http://www.inlink.com/~perlguy |
+----------------------------------------+
------------------------------
Date: Tue, 15 Dec 1998 20:46:23 -0800
From: Robert Lynch <rmlynch@best.com>
Subject: Re: uuencoded data in scripts failing to decode / unpack ?
Message-Id: <36773B1F.4202DB92@best.com>
Jihad Battikha wrote:
>
> Can someone give me a clue as to why neither of the following scripts
> uudecodes the uuencoded data properly? The encoding/decoding works just
> fine when I'm passing the strings in RAM but when I print the uuencoded
> ASCII data into the scripts, only the first small chunk of the encoded
> file gets printed.
[snip]
> ---< test1.pl >---
> #!/usr/bin/perl5
> # DATA packed via pack ("u", $string);
> @gifuue = (<DATA>);
> $gifbin = join ('', @gifuue);
> if ($ARGV[0]) {
> # binmode (STDOUT); # same result, with/without
> $gifbin = unpack ("u", $gifuue);
> print "Content-type: image/gif\n\n$gifbin";
> } else {
> print "Content-type: text/html\n\n",
> "<html><img src=\"/cgi-bin/test1.pl?gif\"></html>";
> }
> __DATA__
> M1TE&.#EA.@`M`/<`````````````````,P`S```S,P!F``!F,P!F9@"9``"9
> M,P#,``#_`#,`,S,S,S-F,S-F9C-FF3.9,S/,,V8S9F9F9F:99F:9F6;__YF9
[snip]
This first one works if you change it to:
----------
# DATA packed via pack ("u", $string);
@gifuue = (<DATA>);
$gifbin = join ('', @gifuue);
if ($ARGV[0]) {
# binmode (STDOUT); # same result, with/without
$gifbin2 = unpack ("u", $gifbin);
print "Content-type: image/gif\n\n$gifbin2";
} else {
print "Content-type: text/html\n\n",
"<html><img src=\"/cgi-bin/test1.pl?gif\"></html>";
}
__DATA__
M1TE&.#EA.@`M`/<`````````````````,P`S```S,P!F``!F,P!F9@"9``"9
M,P#,``#_`#,`,S,S,S-F,S-F9C-FF3.9,S/,,V8S9F9F9F:99F:9F6;__YF9
... etc...
--------
HTH.
Bob L.
--
Robert Lynch-Berkeley CA USA-rmlynch@best.com
http://www.best.com/~rmlynch/
------------------------------
Date: 16 Dec 1998 03:43:10 GMT
From: worldmall@aol.com (Worldmall)
Subject: Re: wanted: form that calculates totals
Message-Id: <19981215224310.15582.00003913@ng-fi1.aol.com>
>i am looking for someone who can make one of forms in our website calculate
>totals. the form is all set up and was created using frontpage. you can
>check it out at:
>http://www.goodtimeweb.com/clientwebsites/aan/order/ordformfrm.htm. we just
>need to know the price and how long it will take. it is needed by tuesday
>12/15/98. my email address is roger@goodtimeweb.com
Hello Roger, I just read your post and visited your site. Do you still need
assistance? If so please let me know. I can help you calculate the page using
javascript.
Andre'
------------------------------
Date: Tue, 15 Dec 1998 23:52:42 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Why Is Perl not a Language?
Message-Id: <1dk3r5r.1iqjyzndj9oboN@bay1-177.quincy.ziplink.net>
Bart Lateur <bart.lateur@skynet.be> wrote:
> Daniel Grisinger wrote:
>
> >I suspect, however, that you are using `interactive' as a synonym for
> >`graphical'.
>
> No I'm not.
>
> "Interactive" means that the programs stops in situations like:
>
> Well here's the data I've got so far, now tell me what to do with it.
>
> Programs without an interface don't stop and ask. They go from start to
> finish in one go.
This works for "interactive", but for "interface", this is the most
ridiculous definition I've ever seen.
How often is the program with an interface supposed to "stop and ask"?
Every five minutes? Every time it's processed 1 kilobyte of data?
Every time rand() returns a number less than .2?
If a program just stops once while it's executing, is that enough for an
interface? Twice? Three times? Is it an absolute number, or is it
relative to how long the program runs?
An "interface" is a place where two things communicate or interact with
each other. A "user interface" is where a user interacts with a
computer program. If a user communicates with a program by typing on
the command line, then that is the program's user interface. It has
absolutely nothing to do with how often the program requests
interaction.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4434
**************************************