[8931] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2549 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 10 11:17:45 1998

Date: Sun, 10 May 98 07:01:41 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 10 May 1998     Volume: 8 Number: 2549

Today's topics:
    Re: Creating a text file from form variables (Ronald J Kimball)
    Re: Does Perl have a IDE?I don't like command line. (Rich Morin)
    Re: Email Authentication (Alex K)
    Re: Grieving our dying community (Hakan Hjelmstrom)
        Help with building GD for perl (WercRB)
        Help with CGI string problem <missingpersons@users.reno.net>
    Re: Help with CGI string problem (Hakan Hjelmstrom)
    Re: How to export constants in modules without C code <enaiman@ndsisrael.com>
    Re: How to export constants in modules without C code (Mike Heins)
        how to ignore new line characters in textarea - in form <d.sarajlic2@wlv.ac.uk>
    Re: HTML::FormatText & parse_html - Doesn't work with t <aas@sn.no>
        I'm looking for a voting script <judas@interprice.com>
        IPC and portmap (Bart Lateur)
    Re: IPC and portmap (Mike Heins)
        is it possible to grab email address from visitor of yo <d.sarajlic2@wlv.ac.uk>
        Perl CGI problem... <bentzen_nospam_@post8.tele.dk>
    Re: Perl CGI problem... (Hakan Hjelmstrom)
    Re: Perl/Wall lingo question (David Adler)
        reading a text file w/Perl <svetter@ameritech.net>
    Re: Regexp challenge -- C to C++ conversion (Shishir Gundavaram)
        RTFM (Andre L.)
    Re: Stumped on opening file to print. <angst@scrye.com>
    Re: Submit (Alex K)
        Web Hosting (DCD)
    Re: Web Hosting <yevlesh@hempseed.com>
    Re: Web Hosting <proweb@gte.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 10 May 1998 00:05:21 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Creating a text file from form variables
Message-Id: <1d8s8og.ggmz9h19dwif4N@bay1-538.quincy.ziplink.net>

Matt McKenzie <jasmatt@es.co.nz> wrote:

> ok....here's a tricky one

Tricky how?

> 1. I want to take two variables from a form. i.e $username and $password

Okay.

> 2. Use a small perl script to create a .txt file named after the
> $username. i.e. username.txt.

open(FILE, ">${username}.txt") or
  die "Unable to open ${username}.txt: $!\n";

> 2. chmod the text file to 666

# You should probably do this step last

chmod 0666, "${username}.txt" or
  die "Unable to chmod ${username}.txt: $!\n";

> 3. insert 2 lines into the .txt file containing the $username and
> $password.

print FILE "$username\n$password\n";

> 4. place this file in a specified dir.

# You should probably do this as part of the open:

$filename = "$dir/$username.txt";
open(FILE, ">$filename") or
  die "Unable to open $filename: $!\n";

# And change the chmod to use $filename instead of "${username}.txt"

> I've had some documentation to do this, but for the life of me I can't
> find it again.

How about Perl's own documentation?  You would have found all the above
in perlfunc.

-- 
 _ / '  _      /         - aka -         rjk@coos.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: Sun, 10 May 1998 06:44:35 -0700
From: rdm@cfcl.com (Rich Morin)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <rdm-1005980644350001@140.174.42.30>

In article <6j388s$let$1@csnews.cs.colorado.edu>, tchrist@mox.perl.com
(Tom Christiansen) wrote:

> Yes, Perl has an IDE: it's called Unix.

Actually, the Unix shell is more of an RJE (Remote Job Entry) system with
mudflaps.  The typical Unix command (e.g., grep) is run in "batch" (non-
interactive) mode.  Only a few commands (e.g., vi) expect user interaction.

In contrast, most Mac OS commands are interactive; very few just take a
set of directions and run.  I can't speak for Windows (and probably
should refrain from speaking against it :-).

Anyway, I do know of one Perl system that has some IDE features: MacPerl.
The base application includes a simple editor/debugger/... which, though
limited to smallish (32 KB) files, is quite convenient.  Larger scripts
can be handled using a text editor such as BBEdit, which offers syntax-
directed text coloring and other Perl-sensitive features.

For more information on MacPerl, see the MacPerl Pages:

        http://www.ptf.com/macperl

-r

-- 
Canta Forda Computer Laboratory       | Prime Time Freeware - quality 
UNIX consulting, training, & writing  | freeware at affordable prices
+1 415-873-7841                       | +1 408-433-9662   -0727 (Fax)
Rich Morin, rdm@cfcl.com              | www.ptf.com, info@ptf.com


------------------------------

Date: Sun, 10 May 1998 16:45:15 GMT
From: techsoft@abcpages.com (Alex K)
Subject: Re: Email Authentication
Message-Id: <3555d929.2287745@news.ica.net>

try to use finger command , if it says user name , etc, than you can
go ahead and send e-mail to him , otherwise, just skip his/her
e-mail.. 


On Tue, 28 Apr 1998 23:24:13 -0500, "Orin Fink"
<orin@thirdwaveweb.com> wrote:

>This one seems like a toughy to me...mucho grande thanx to anyone that may
>lead me in a direction to solve this problem.
>
>I will be running a Perl script on an IRIX system that would send mail to
>users that have "registered" on a web site.  Problem is, I don't want to
>send mail to bunk addresses.  Is there a way to "validate" someone's e-mail
>address before sending the message.
>
>I thought I saw a switch to sendmail that would essentially send a blank
>message to a recipient and return the result but can't seem to find it
>again.
>
>Thanks again.
>
>
>
>



------------------------------

Date: Sun, 10 May 1998 10:12:18 GMT
From: hawk@algonet.se (Hakan Hjelmstrom)
Subject: Re: Grieving our dying community
Message-Id: <35577882.1159727@news.algonet.se>

On 9 May 1998 18:17:12 GMT,  Stuart McDow wrote:
> hawk@algonet.se (Hakan Hjelmstrom) writes:
> > And again; Is this a bad thing? (answering FAQ's, that is) 
> > To top it of, some of the more proficient users still might need to
> > keep an eye on all the "helpful but not clueless perl babytalkers"
> > to make sure we're not providing answers that are actually plain
> > wrong.
> That's a tall order. It would require a lot of monitoring, and
> countering an answerer's post can raise tensions and start a flame
> war. Why bother? People should be pointed at the FAQs whenever
> possible. At least they're trustworthy.

Sure, but simply pointing them at the FAQ doesn't give me the pleasure
of digging around the docs + doing some experimentation. I'd rather
try something out, hint at a solution AND point at the FAQ and docs.

As for the monitoring part, it seems to me that several of the natives
already are sifting through the majority of posts though I can't even
begin to imagine how they cope. (Well, they do seem a bit grumpy every
now and then, but that only shows they've not gone all digital yet :)

Hekan Hjelmstrvm
hawk@algonet.se


------------------------------

Date: 10 May 1998 06:40:07 GMT
From: wercrb@aol.com (WercRB)
Subject: Help with building GD for perl
Message-Id: <1998051006400700.CAA28792@ladder01.news.aol.com>

I have been unable to install GD (1.18) for perl because
the make file halts and says it can't find perlio.h.
The file in question actually exists in several
directories including the perl dir.

The docs for GD say:
 (Please do not complain to me if your build fails with an
  error about not finding perlio.h.  This file is part of more
  recent versions of Perl.  You will need a recent version of
  Perl to compile and install this package).

But I have the most recent official version (perl5.004_04) and
it is still not working.

Any suggestions for how I can solve this problem would be greatly
appreciated.

Thanks,
Jon

--------------------------------------------------------------------
Note: Sorry if I already posted this an hour ago, I didn't
        think it went through.


------------------------------

Date: Sat, 09 May 1998 15:04:37 -0700
From: Chuck <missingpersons@users.reno.net>
Subject: Help with CGI string problem
Message-Id: <3554D2F5.63B76C78@users.reno.net>

Hi Group:
    I new to programming CGI and was wondering.  How do you break up a

string.
The problem is I have a string named '$key', it equals the HTML
reference to a hit on a search.  I need to use the string except for
the last 5 digits.  Back in my programming days we wrote it like so.
b$=left$(key$,(len(key$)-5))
How can I do this in CGI?
Thanks,
Chuck at Reno



------------------------------

Date: Sun, 10 May 1998 09:50:59 GMT
From: hawk@algonet.se (Hakan Hjelmstrom)
Subject: Re: Help with CGI string problem
Message-Id: <355675f8.509893@news.algonet.se>

On Sat, 09 May 1998 15:04:37 -0700, Chuck wrote:
> I new to programming CGI and was wondering.  
> How do you break up a string.
> The problem is I have a string named '$key', it equals the HTML
> reference to a hit on a search.  I need to use the string except for
> the last 5 digits.  Back in my programming days we wrote it like so.
> b$=left$(key$,(len(key$)-5))
> How can I do this in CGI?

Provided you're using Perl, and I guess you do since you posted to
this group, I'd take a long, hard look in the documentation under the
heading "Functions for SCALARs or strings " in the perlfunc part of
the docs. More specific, use the substr function.

Hekan Hjelmstrvm
hawk@algonet.se


------------------------------

Date: 10 May 1998 09:54:39 GMT
From: "Ephrayim \"EJ\" Naiman" <enaiman@ndsisrael.com>
Subject: Re: How to export constants in modules without C code
Message-Id: <01bd7bf8$f189fce0$77140a0a@enaimanlt.ilndc.com>

> Use @EXPORT and prototyped subroutines:
> 
> package my_module;
> require Exporter;
> @ISA = qw(Exporter);
> @EXPORT = qw(ERR_NOT_FOUND);
> sub ERR_NOT_FOUND () { 47 }

I didn't realize "use constant" defined the constants as subroutines.  I
was hoping to avoid the overhead of subroutines.  I tried to create a file
called "errlist.pm" and have it filled with a bunch of "use constant ...". 
Then in all application-level files just do a "use errlist" or
require("errlist.pm") or do("errlist.pm").  None of those seem to work.

> Or, if you don't mind the "$", and would like to avoid the subroutine
call, try:
> 
> package my_module;
> require Exporter;
> @ISA = qw(Exporter);
> @EXPORT = qw($ERR_NOT_FOUND);
> $ERR_NOT_FOUND = 47;
> 
> Or, come to think of it, why not export a whole hash with the names of
> the errors as keys, and the values as, um, values?

I was trying to make it more constant-like.  I could use cpp/m4 for the
constants, but I can't be guaranteed they'll be in the production
environment.  I was hoping not to populate the scalar/subroutine namespace,
but I see there is no way around it.  I guess the hash will keep the
population down but it makes the application code ugly.

Can somebody post a small succinct example of how to use EXPORT_TAGS?  I
have not been successful at using it.  Can EXPORT_TAGS be used as
constants?  I've read the Exporter man page and see definitions but not
code use of the values.

Thank you for all your replies and time,


------------------------------

Date: 10 May 1998 06:18:37 -0500
From: mikeh@minivend.com (Mike Heins)
Subject: Re: How to export constants in modules without C code
Message-Id: <35557efd.0@news.one.net>

Ephrayim \"EJ\" Naiman <enaiman@ndsisrael.com> wrote:
>> Use @EXPORT and prototyped subroutines:
>> 
>> package my_module;
>> require Exporter;
>> @ISA = qw(Exporter);
>> @EXPORT = qw(ERR_NOT_FOUND);
>> sub ERR_NOT_FOUND () { 47 }

> I didn't realize "use constant" defined the constants as subroutines.  I
> was hoping to avoid the overhead of subroutines.  I tried to create a file
> called "errlist.pm" and have it filled with a bunch of "use constant ...". 
> Then in all application-level files just do a "use errlist" or
> require("errlist.pm") or do("errlist.pm").  None of those seem to work.

You may not be aware of this optimization in the latest Perl.
>From 'perldoc perldelta':

	Functions that have an empty prototype and that do nothing
	but return a fixed value are now inlined (e.g. sub PI () {
	3.14159 }).

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
"The U.S. Senate -- white           131 Willow Lane, Floor 2  | ||  _ \
male millionaires working           Oxford, OH  45056         | || |_) |
for YOU!" -- Dave Barry             <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\


------------------------------

Date: Sun, 10 May 1998 12:49:06 +0100
From: "Denko" <d.sarajlic2@wlv.ac.uk>
Subject: how to ignore new line characters in textarea - in forms
Message-Id: <6j44a5$902@ccuh.wlv.ac.uk>

I have problems in my script for guestbook. When I am processing the
guestbook form. If guest press ENTER inside textarea it messes up my script.
So how do you ignore enter character inside the textarea.

Denijal S.




------------------------------

Date: 10 May 1998 08:34:12 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: HTML::FormatText & parse_html - Doesn't work with tables.
Message-Id: <m3d8dmy6qj.fsf@furu.g.aas.no>

"Ben" <ben@wallroyds.demon.co.uk> writes:

> The code below ...
> 
> $plain_text = HTML::FormatText->new->format(parse_html($html_text));
> 
> Will remove HTML from a string. But, there's a problem - It doesn't work
> with tables.
> 
> I wonder if anyone know if there's any way of getting around it? Why won't
> it work with tables?! It's the easiest job in the world ... Just remove the
> <TR*> <TD*> <TABLE*> tags. How come the author doesn't like tables?

I would not call that proper formatting of tables.  The problem is
simply that nobody has cared enough to write the code that does this.
Perhaps you want to do it?

-- 
Gisle Aas


------------------------------

Date: Sun, 10 May 1998 00:37:45 -0700
From: "Dan Serban" <judas@interprice.com>
Subject: I'm looking for a voting script
Message-Id: <6j3i4s$qd1$1@news.junction.net>

I'm looking for a voting script example preferrably where both text and
multiple choice answers could be entered.  Needed for a web site.




------------------------------

Date: Sun, 10 May 1998 09:50:35 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: IPC and portmap
Message-Id: <35567495.2163276@news.tornado.be>

I'm thinking about building Perl scripts that should communicate with
each other through sockets. (Client/server type of apps: one server,
unlimited number of clients).

However, I've noticed that the usual method of doing this in Perl, is
just choose a random port number (like 2345), and hope it's not already
in use for something else.

The seems like a horribly buggy and dangerous way to do this!

I've look through the API documentation I could find, and I found that
the official way to request a port number for private use, is through
portmap. However, this looks incredibly unwell thought out. It requires
RPC (remote procedure calls), which I'm sure is not implemented in Perl.
Hence the ad hoc approach I described above.

Worse, you can ask for the port number for an app, but you need to know
the application ID number for that. This is extremely silly: how are we
supposed to know THAT? Why not just request through a name? The Windows
RegisterWindowsMessage() comes to mind on how I think it should have
been done.

Question: what is the best and safest way to do this in Perl, i.e.
"reserve" a port number (or a set of port numbers) for private use? Is
portmap the only way, and why is this so cludgy? Could there be some
"service" app, that would work as a gateway into portmap, so that the
use in apps/Perl scripts no longer requires RPC?

I'm a newby in this area, so it could be I've overlooked a simpler way,
one that IS feasable in Perl. Is there? And are there any pointers to
demo Perl scripts that I should look into,as in "This is how you should
do it"?

	Bart.


------------------------------

Date: 10 May 1998 06:37:25 -0500
From: mikeh@minivend.com (Mike Heins)
Subject: Re: IPC and portmap
Message-Id: <35558365.0@news.one.net>

Bart Lateur <bart.mediamind@tornado.be> wrote:
> I'm thinking about building Perl scripts that should communicate with
> each other through sockets. (Client/server type of apps: one server,
> unlimited number of clients).

> However, I've noticed that the usual method of doing this in Perl, is
> just choose a random port number (like 2345), and hope it's not already
> in use for something else.

> The seems like a horribly buggy and dangerous way to do this!

Not really. If you assign a port over 1024, and don't use one that
is registered by the ISI, then you are pretty safe. (For example, MySQL
uses 3306 and is ISI-registered -- same with mSQL and 1114.) I wouldn't
pick an even number or something like 3333 or 5555. Don't use the
6000 ports because of X-Windows. Personally I would pick something
like 9979 or the like.

> I've look through the API documentation I could find, and I found that
> the official way to request a port number for private use, is through
> portmap. However, this looks incredibly unwell thought out.
[snip]

> Question: what is the best and safest way to do this in Perl, i.e.
> "reserve" a port number (or a set of port numbers) for private use? Is
> portmap the only way, and why is this so cludgy? Could there be some
> "service" app, that would work as a gateway into portmap, so that the
> use in apps/Perl scripts no longer requires RPC?

If all you are doing is monitoring a single port and spawning instances,
my advice is don't bother with portmap. A lot of coding for almost
no benefit. Not to mention portability/education problems galore.

Doing something beyond a port number requires that the user update
the system equivalent of /etc/services and /etc/inetd.conf, which is
much more of a pain than just picking an arbitrary port number. That
is what such well-known apps as MySQL, mSQL, and ODBC do. They don't
use portmap -- it is a lot more complicated than just putting in an
integer. (They may support portmap, but I know for a fact that if the
service isn't mapped they happily go to their default port.)

I have been providing a server for over two years, and I arbitrarily
picked 7786 as the port. Never a whisper of trouble after thousands
of installations.

Obviously you need to make it configurable in case of an unlikely
conflict or the more likely chance of running two of your servers
on the same machine.

Regards,
-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
There ain't nothin' in this world   131 Willow Lane, Floor 2  | ||  _ \
that's worth being a snot over.     Oxford, OH  45056         | || |_) |
--Larry Wall                        <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\






------------------------------

Date: Sun, 10 May 1998 12:44:16 +0100
From: "Denko" <d.sarajlic2@wlv.ac.uk>
Subject: is it possible to grab email address from visitor of your web page
Message-Id: <6j4414$8rb@ccuh.wlv.ac.uk>

Is it possible to get email address from someone who visits your home page -
like as you can grab their IP address and things like that as environment
variables(if he/she has specified it in browser they use)

Denijal S.




------------------------------

Date: Sun, 10 May 1998 13:06:51 +0200
From: "Martin Bentzen" <bentzen_nospam_@post8.tele.dk>
Subject: Perl CGI problem...
Message-Id: <6j41pr$31dk$1@news-inn.inet.tele.dk>

I need a CGI-code for Perl

It has to write a string to a specified line-number in an text-file, and
overwrite the current line.

/Greeting
Martin Bentzen




------------------------------

Date: Sun, 10 May 1998 11:43:05 GMT
From: hawk@algonet.se (Hakan Hjelmstrom)
Subject: Re: Perl CGI problem...
Message-Id: <355590e7.7405138@news.algonet.se>

On Sun, 10 May 1998 13:06:51 +0200, Martin Bentzen wrote:
> I need a CGI-code for Perl
> It has to write a string to a specified line-number in an text-file, and
> overwrite the current line.

Check out the FAQ entry labeled 
"How do I change one line in a file/delete a line in a file/insert a  
  line in the middle of a file/append to the beginning of a file?"

You'll find it together with tons of other useful stuff at:
http://language.perl.com/faq/index.html

Hekan Hjelmstrvm
hawk@algonet.se


------------------------------

Date: 10 May 1998 08:04:50 GMT
From: dha@panix.com (David Adler)
Subject: Re: Perl/Wall lingo question
Message-Id: <6j3n32$ir2@news1.panix.com>

On Fri, 08 May 1998 20:58:37 -0400, brian d foy <comdog@computerdog.com> wrote:
>In article <6j07up$hh1@news1.panix.com>, dha@panix.com (David Adler) posted:
>
>>On Wed, 06 May 1998 23:58:56 -0400, brian d foy <comdog@computerdog.com> wrote:
>>>after my physics degree, my advisor told me it was time for religion :)
>>
>>Ah.  So *that's* why you turned to perl. :-)
>
>no - i turned to Perl for the cool Perl Mongers t-shirt.

Cool!  Where can *I* get one? ;-)

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Perhaps the Monty Python Scholar in America today"
	-New Yorker magazine 13mar89


------------------------------

Date: Sun, 10 May 1998 08:32:37 -0400
From: Scott Vetter <svetter@ameritech.net>
Subject: reading a text file w/Perl
Message-Id: <35559E65.2E0A@ameritech.net>

Is there an easy way to read a text file with Perl?  I've looked in
the book to see if there was an easy way, but so far I haven't found
it.  The read specifies that you have to give it a line length, but what
if there are viariable lenght records?


------------------------------

Date: 10 May 1998 04:55:22 GMT
From: shishir@ruby.ora.com (Shishir Gundavaram)
Subject: Re: Regexp challenge -- C to C++ conversion
Message-Id: <6j3bvq$epf$1@amber.ora.com>

Roar Andre Lauritzsen (roarl@metaphor.no) wrote:
: We have a huge C source code that we want to convert so that it may be
: compiled by C++. This means converting all the C++ reserved words (this,
: class, new, delete) which have previously been used as variable names,
: to something that C++ does not choke on (e.g. This, Class, New, Delete).
: The problem is that we don't want to change words inside comments.
: Assuming that it would be best to do a substitution on a whole file at a
: time (because of multi-line comments), I started writing something like
: this:

Here's some untested code that _should_ do the job ;-)

    #!/usr/local/bin/perl

    my (@keywords, $code, $capital, $keyword, @comments);

    @keywords = qw (this class new delete);
    $code     = '';
    $capital  = '';

    foreach $keyword (@keywords) {
        ($capital = $keyword) =~ s/^(.)/\U$1\E/;
        $code .= "s/$keyword/$capital/g;\n";
    }

    $^I = ".bak";

    while (<>) {
        @comments = ();
        s|(/\*.*?\*/)|push (@comments, $1); "\x7F_@{[ $#comments ]}_\x7F"|gse;
        eval $code;
        s|\x7F_(\d+)_\x7F|$comments[$1]|g;
        print;
    }

    exit (0);

The program stores all the comments in an array and replaces them with 
"unique" strings. Then comes the keyword replacement. Finally, we
put the comments back.

--Shishir



------------------------------

Date: Sat, 09 May 1998 23:51:19 -0500
From: alecler@cam.org (Andre L.)
Subject: RTFM
Message-Id: <alecler-0905982351190001@dialup-720.hip.cam.org>

Hello, I am a clueless newbie, and since I was told countless times to
RTFM, I went to the bookstore and asked the clerk there, 'Do you have the
Fucking Manual?' The clerk took me to a room in the back and handed me a
copy of the Kama-Sutra and some book by a Dr. Ruth. I am happy to say that
the examples shown in those manuals work great under a Unix system, but
obviously I'm not achieving the same performance in a Windows environment.
Boy, that Schwartzian transform is neat, and it does the job in a flash
too. 

Who knew studying Perl would be such hard work? Though there's something
to be said for steep learning curves.

A.L.


------------------------------

Date: 10 May 1998 04:42:41 GMT
From: angst <angst@scrye.com>
Subject: Re: Stumped on opening file to print.
Message-Id: <6j3b81$kmj$1@jelerak.scrye.com>

brian d foy <comdog@computerdog.com> wrote:
: In article <35550B03.3D01D834@purco.qc.ca>, Leon Stepanian <info@purco.qc.ca> posted:

:>I have tried opening files which were in simple html format such as;
:><html> or in perl format such as print"<html>\n"; but in both ways, I am
:>getting the code printed on the screen and not the actual html page.
:>
:>Files were opened and stored in $array or @array format then printed
:>with print<$file> or sequenced through a for($a=0;a<@file;$a++) to
:>print"$file[$a]"; but again, I am only getting the actual code printed
:>on the screen. Also tried print<@array> but again not good.

[excellent answer snipped]

Here's what I do.  In my company, cgi scripts that customers are allowed
to access have to print out a big table thingie (sidebar, etc) and set all
of the fonts, etc.  So, for dynamic HTML pages, I use something like this
(I'm only including the relevant bits here):

use BerkeleyDB; # For the example error...you don't need this.

$eqms = "/usr/local/eqms";      # location of EQMS hierarchy
$template = "$eqms/data/etc/html.tmpl";
                                # location of HTML template (background stuff)
# Print HTML headers

print "Content-type: text/html\n\n";
print "<head>\n";
print "  <title>RMC Internet Services -- EMF Setup</title>\n";
print "</head>\n\n";
open HTML, "$template";
  print while <HTML>;
close HTML;

###
### leave -- print out some crap to keep various browsers from dying
###          upon exiting.  This program should never exit any other way.
###

sub leave($$){
  my($stat,$reason) = @_;
  print "Error processing directive: $reason\n" if $stat == 1;
  print "$reason\n" if $stat == 0;
  print "<p><hr>\n";
  print "<br><a href=\"http://www.rmci.net/utilities/email/default.asp\">";
  print "Return to E-Mail Administration</a><br>\n";
  print "</span></font>\n";
  print "</td></tr></table></body>\n";
  exit;
}

# A sample error...

$lhome = "/usr/home/erik"; # just to fit in with the example
tie %mfdb,'BerkeleyDB::Hash',
  -Flags => DB_CREATE,
  -Filename => "$lhome/emf.db",
  -Mode => 0600,
or leave(1,"Could not access user configuration file.");

# end example code

html.tmpl is just a normal text file with HTML tags in it (it also defines
a table, hence the table-closing tags in leave()).  The part I think you're
missing is the print line for "Content-type: text/html\n\n".
HTH.

-- 
Erik Nielsen <eln@rmci.net>
solaris/perl/qmail/dns weenie
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support


------------------------------

Date: Sun, 10 May 1998 16:42:22 GMT
From: techsoft@abcpages.com (Alex K)
Subject: Re: Submit
Message-Id: <3555d88b.2129352@news.ica.net>

On Tue, 28 Apr 1998 00:40:57 -0500, Mikey Vaughan <mikey@in.net>
wrote:
well.., assuming you use formmail , just add several options to it ,
to check the IP of the user who submits info.., and keep it in cash
for 5 minutes , and then it will check if the person submitted
recenlty (during this 5 minutes) then it just cancel his request and
won't do anyhting.. 

hope it helps./.

>Hello,
>
>Does somebody have a routine that allows the submit button to be
>executed only once??  I have a bunch of people that keep hitting it and
>sending multiple forms.  Has someone written a routine to only allow one
>form to be submitted??  Sure would appreciate some help on this.
>
>Mikey Vaughan
>mikey@in.net
>



------------------------------

Date: Sun, 10 May 1998 00:08:08 -0400
From: sean@SSPPAAMMdcd.net (DCD)
Subject: Web Hosting
Message-Id: <sean-1005980008080001@ts9port70.port.net>

Our Standard Package for virtual servers includes free domain
name registration and free DNS mapping, and features...

    * 5Mb server space 
    * Full HTTP and FTP 
    * Unlimited mail aliasing 
    * Full support for CGIs (Perl5 and C++) 
    * Full Telnet access 
    * USD $595 or IRP #400 Per Year 

There's no catch. It's a great deal with great backup.

More info: http://www.dcd.net/web/


------------------------------

Date: Sun, 10 May 1998 07:15:22 -0400
From: Yevgeniy Leshchinskiy <yevlesh@hempseed.com>
Subject: Re: Web Hosting
Message-Id: <35558C49.497ACF77@hempseed.com>

5mb of space for 600 dollars a year is a great deal? You have to be
joking! I doubt that you will get any clients with this pricetag.

DCD wrote:

> Our Standard Package for virtual servers includes free domain
> name registration and free DNS mapping, and features...
>
>     * 5Mb server space
>     * Full HTTP and FTP
>     * Unlimited mail aliasing
>     * Full support for CGIs (Perl5 and C++)
>     * Full Telnet access
>     * USD $595 or IRP #400 Per Year
>
> There's no catch. It's a great deal with great backup.
>
> More info: http://www.dcd.net/web/





------------------------------

Date: Sun, 10 May 1998 08:11:06 -0400
From: "Tina" <proweb@gte.net>
Subject: Re: Web Hosting
Message-Id: <6j45ik$2rn$1@gte2.gte.net>

HAHAHAHAHAHAHAHAHAHAHAHAHHA!!!!!!!!!!

*sigh*

Try SuiteNet  setup $49 and $95 for a whole year...AND you get more that
what you have listed.

www.suite.net



DCD wrote in message ...
>Our Standard Package for virtual servers includes free domain
>name registration and free DNS mapping, and features...
>
>    * 5Mb server space
>    * Full HTTP and FTP
>    * Unlimited mail aliasing
>    * Full support for CGIs (Perl5 and C++)
>    * Full Telnet access
>    * USD $595 or IRP #400 Per Year
>
>There's no catch. It's a great deal with great backup.
>
>More info: http://www.dcd.net/web/




------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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 2549
**************************************

home help back first fref pref prev next nref lref last post