[13025] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 435 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 9 20:07:22 1999

Date: Mon, 9 Aug 1999 17:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 9 Aug 1999     Volume: 9 Number: 435

Today's topics:
    Re: Anyone know how to use perl to parse data and gener <carvdawg@patriot.net>
    Re: CGI beginner (Marcel Grunauer)
    Re: CGI newbie <rootbeer@redcat.com>
        CGI.pm: very simple error (Jflowers44)
    Re: CGI.pm: very simple error <mike@crusaders.no>
    Re: CGI.pm: very simple error (Jflowers44)
    Re: FAQ 1.3: Which version of Perl should I use? (Bill Moseley)
    Re: Help me ..; databases ... thielf@my-deja.com
        help with dataconn methods <i_tel@my-deja.com>
        How to form a URL from the path of another Simon.Fisher@rsd.co.uk
    Re: How to form a URL from the path of another (Martien Verbruggen)
    Re: I Installed Active Perl, but how can I run my CGI-S (Bill Moseley)
    Re: kill pid scripts <dutch@mindspring.com>
        memcpy problem (Helena Jeeves)
    Re: memcpy problem (Martien Verbruggen)
        MIME::Lite newbie question mr_potato_head@my-deja.com
    Re: NT Perl script archives <carvdawg@patriot.net>
    Re: Pattern Matching + (Matthew Bafford)
        Perl Question jsmith19991@my-deja.com
    Re: POST via Imagemap - How? (Larry Rosler)
        print to file using here document (Jflowers44)
    Re: print to file using here document (Graham Ashton)
    Re: Problem reading forms with perl <mike@crusaders.no>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 09 Aug 1999 18:13:42 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: Anyone know how to use perl to parse data and generate excel reports    automatically?
Message-Id: <37AF5296.A10C8AF3@patriot.net>

>
> >     I want to know if it is possible to write a perl script that will parse
> > throught data from a file and port extracted data into MS Excel spreadsheet.
>

Since you specifically asked for Excel, you will need to use the Win32::OLE
package.  Dave Roth has an excellent book available and the examples are
in a .zip file at his web site...http://www.roth.net

The example in question is one that gathers EventLog entries from across the
enterprise and imports the data into an Excel spreadsheet...

Carv




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

Date: Tue, 10 Aug 1999 00:09:25 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: CGI beginner
Message-Id: <37b66c65.17400370@enews.newsguy.com>

On Mon, 09 Aug 1999 21:47:55 GMT, mirak@vnet.net wrote:

>OK,
>I've read the Dummies book, Have now been able to successfully
>implement Win32 extentions and I now consider myself just above a
>novice perl programmer.  The trouble is, I know how to program HTML,
>but I can't figure how to implement perl into it.   I can't even
>figure out how to make "Hello World" display correctly as shown in the
>Perl for Win32 systems.
>
>Can someone please give me the steps to generate a beginners CGI
>script using perl?

"Dummies" doesn't sound like the best book to start; look at "Learning
Perl".

Anyway, I assume you can figure out the Perl part of your question:

#!/usr/bin/perl -w

use CGI qw/:standard/;

print header, start_html, h1("Hello World"), end_html;


but you also need to configure your web server to recognize .pl
extensions and to run Perl in that case. On Windows, when you install
ActiveState Perl, the installer configures IIS.

You can also test it from the command line, like so:

C:> perl helloworld.pl



Marcel
-- 
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'


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

Date: Mon, 9 Aug 1999 15:17:34 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: CGI newbie
Message-Id: <Pine.GSO.4.10.9908091516240.7774-100000@user2.teleport.com>

On Mon, 9 Aug 1999 mirak@vnet.net wrote:

> If you are using IIS, do you have to jump
> through hoops to get scripts to run from a web page?

I can't say, but I'm sure it helps to check the docs, FAQs, and newsgroups
about your webserver and webservers in general. If you (or anyone else
reading this) don't know what those things are and how to search for them,
please let me know. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 09 Aug 1999 22:08:01 GMT
From: jflowers44@aol.com (Jflowers44)
Subject: CGI.pm: very simple error
Message-Id: <19990809180801.13067.00008591@ng-ck1.aol.com>

In Lincoln Stein(the author of CGI.pm)'s book about CGI.pm he gives several
examples to try, which can also be found at his
http://www.wiley.com/compbooks/stein/source.html.
He uses two different methods to include CGI.pm.  One of them is this:
use CGI ':standard';
The other is this
use CGI qw/:standard/;
Can anybody explain the difference between these 2 to me?
The main reason I ask is to correct the following script:

#!usr/local/bin/perl
#Script: plaintext.pl
use CGI ':standard';
print header('text/plain'),"Nothing to it!";

when I try to view it from Netscape Communicator, it doesn't work correctly
(permissions are set correctly, and I uploaded in ASCII mode).  However, when I
telnet into my server, it runs fine with the perl compiler.  The strange part
is that if I replace "use CGI':standard';" with "use CGI qw/:standard/;" it
works fine.  I have gotten the "use CGI':standard" to work with another script.
 Can anyone help?  Thanks.


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

Date: Tue, 10 Aug 1999 00:32:06 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: CGI.pm: very simple error
Message-Id: <REIr3.698$aT1.7043@news1.online.no>

If you want to ask your question in several groups at the same time you
should crosspost instead of posting it twice. Duplicate postings are
concidered to be quite rude (as is excessive crossposting of course)

Jflowers44 <jflowers44@aol.com> wrote in message
news:19990809180801.13067.00008591@ng-ck1.aol.com...
> He uses two different methods to include CGI.pm.  One of them is this:
> use CGI ':standard';
> The other is this
> use CGI qw/:standard/;
> Can anybody explain the difference between these 2 to me?

style.

> when I try to view it from Netscape Communicator, it doesn't work
correctly

This error is positively not caused by "use CGI ':standard';".
Have you doublechecked that your hashbang-line is correct and that it
doesn't end in ^M ?

> (permissions are set correctly, and I uploaded in ASCII mode).  However,
when I

Are you _really_, _really_ sure?

> telnet into my server, it runs fine with the perl compiler.  The strange
part

How did you run it?
 ./scriptname.pl
or
perl scriptname.pl

If the latter work, but former doesn't then your hashbang is faulty.
I both works there's nothing wrong with the script, so it must be a
cgi-problem.

--
Trond Michelsen





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

Date: 09 Aug 1999 23:04:48 GMT
From: jflowers44@aol.com (Jflowers44)
Subject: Re: CGI.pm: very simple error
Message-Id: <19990809190448.25863.00006119@ng-cm1.aol.com>

I tried to run it using 
 ./sciptname.pl 
and it says "No such file or directory".  I ran it using 
perl ./scriptname.pl ""
and it worked, as well as
perl scriptname.pl"" 
How do I know if the hashbang line ends in ^M?  


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

Date: Mon, 9 Aug 1999 15:32:13 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: FAQ 1.3: Which version of Perl should I use?
Message-Id: <MPG.1218f6cbdb86508e989698@nntp1.ba.best.com>

David Cassell (cassell@mail.cor.epa.gov) seems to say...
> > "All releases prior to 5.004 were subject to buffer overruns, a grave
> > security issue."
> > 
> > I want to suggest they get rid of this version, but they might like to
> > see more information about the problem than just the FAQ reference.
> 
> Check out the CERT advisories.  There are a few on 5.002/3 that should
> convince your clients to $#!%can that version, except for regression 
> testing.

I just looked through CERT and only found:
   CA-97.17 Buffer overflow in suidperl

I don't know anything about suidperl.  But it doesn't sound like it 
applies.  I wonder if Tom was thinking of that when FAQ 1.3 was 
updated??

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Mon, 09 Aug 1999 22:37:08 GMT
From: thielf@my-deja.com
Subject: Re: Help me ..; databases ...
Message-Id: <7onl6j$65h$1@nnrp1.deja.com>

I'm trying to open a database, and select tables
like the example below says.

  #open connection with DB
 $DSN ="your_domain_name";
 if (!($db = new Win32::ODBC
("DSN=your_domain_name;"))) {
  print STDOUT "Error connecting to $DSN\n";
  print STDOUT "Error: " . Win32::ODBC::Error() .
"\n";
  exit;
 }

 $SqlStatement = "SELECT table_name.field_name
       FROM table_name;";

 if ($db->Sql($SqlStatement)) {
  print "SQL failed- Cannot execute\n";
     print "Error: ". $db->Error(). "\n";
     $db->Close();
     exit;
 }
 $db->Close();


But I get this error "fatal error C1021: invalid
preprocessor command 'open'"

Anybody can help me.
Thanks
thiel@telcom.net





In article <379770C9.9CD309F6@bigfoot.com>,
  matt <mlopresti@bigfoot.com> wrote:
> Here is an example of a connection and select
statement:
>
>  #open connection with DB
> $DSN ="your_domain_name";
> if (!($db = new Win32::ODBC
("DSN=your_domain_name;"))) {
>  print STDOUT "Error connecting to $DSN\n";
>  print STDOUT "Error: " . Win32::ODBC::Error()
 . "\n";
>  exit;
> }
>
> $SqlStatement = "SELECT table_name.field_name
>       FROM table_name;";
>
> if ($db->Sql($SqlStatement)) {
>  print "SQL failed- Cannot execute\n";
>     print "Error: ". $db->Error(). "\n";
>     $db->Close();
>     exit;
> }
> $db->Close();
>
> There are other ways of doing this, this is
just how I like doing it :-)
> -Matt
>
> danny wrote:
>
> > Thanks to all for the answers..
> > 1)
> >
> > I'm trying to get a understanding for ODBC
 ... (i know oracle ..) but it seems
> > that i'm making the same mistakes over and
over again...
> >
> > Is there a BASIC statement for the ODBC
> >
> > like
> >
> > create a table
> > assign data to it
> > and read it ...
> >
> > i tried to search.. but all the examples
seems buggy ... (i run apache
> > locally...)
> >
> > this example
> > 1. use Win32::ODBC;
> > 2. $db=new WIN32::ODBC('simple');
> > 3. $varname="CGI Programming with Perl";
> > 4. $db->Sql("select aname,price from  mytable
where
> >                    book='$varname' ");
> > 5. $db->FetchRow();
> > 6. ($Author,$cost)=$db->Data("aname","price");
> > 7. print  "The Book titled $varname is
written by $Author
> >    and costs  $cost";
> >
> > found at  http://members.tripod.com/~anzer...
> > isn't working for me ... thats why i need a
comprehensive example source code
> >
> > 2)
> >
> > Whats wrong with :
> > $db->sql("select * from [table1]");
> > it won't perform the sql statement...
> >
> > and
> > $db->sql("select field1 from [table1]");
> > is even a bigger dissaster..
> >
> > is there a good url where i can find
comprehensive and CLEAR transparent
> > information about ODBC ?
> >
> > Many thanks,
> >
> > danny
> >
> > Jeff Thies wrote:
> >
> > > > Windows NT Server
> > >
>
       Database and CGI
> > > >
> > > > ColdFusion 4 Enterprise
> > > >
> > > > Chili!ASP
> > >
>
                PhP3
> > >
>
                 Perl 5,
> > > > Visual Basic & C++ CGI
> > >
>
                 ODBC
> > > > Support
> > > >
> > > > whats the best way to use a database in
perl ?
> > >
> > > DBI::DBD and DBD::ODBC
> > >
> > > Check the DBI man page... You might just
want to run CF instead, easy
> > > but not as flexible.
> > >
> > > Jeff
>
>



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 09 Aug 1999 23:09:32 GMT
From: hojo <i_tel@my-deja.com>
Subject: help with dataconn methods
Message-Id: <7onn36$7ko$1@nnrp1.deja.com>

To All,

Net::FTP objects have the retr method that returns a reference to a
dataconn object.  However, I am having a hard time figuring out how to
use the dataconn reference.  Where is this beast documented (its methods
and examples)?

Thank You

--
=-=-=-=-=-=-=-=-=-=
David Hajoglou
Sys. Admin., Abbreviator
=-=-=-=-=-=-=-=-=-=


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 09 Aug 1999 22:38:49 GMT
From: Simon.Fisher@rsd.co.uk
Subject: How to form a URL from the path of another
Message-Id: <7onl9o$6db$1@nnrp1.deja.com>

I have a perl CGI script to do form processing.  When called I get
the "referer" so I know from which URL the CGI script was called.

Now I want to combine parts of the referer URL with another (part) URL
to give a new URL.  For example, suppose that my referer is

    http://www.abc.com/products/enquiry.html

and my new part is

    thanks.html

I want the result to be

    /products/thanks.html

I can do it myself using the URI module, by splitting the referer up
and then concatenating the needed bits back together.  But, is there an
existing solution out there that might be more elegant?


Thanks

Simon


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 09 Aug 1999 23:45:57 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How to form a URL from the path of another
Message-Id: <VKJr3.4710$rR.4775@nsw.nnrp.telstra.net>

In article <7onl9o$6db$1@nnrp1.deja.com>,
	Simon.Fisher@rsd.co.uk writes:
> I have a perl CGI script to do form processing.  When called I get
> the "referer" so I know from which URL the CGI script was called.

You think you do. You hope you do.

> Now I want to combine parts of the referer URL with another (part) URL
> to give a new URL.  For example, suppose that my referer is
> 
>     http://www.abc.com/products/enquiry.html
> 
> and my new part is
> 
>     thanks.html
> 
> I want the result to be
> 
>     /products/thanks.html

use URI::URL;

> I can do it myself using the URI module, by splitting the referer up
> and then concatenating the needed bits back together.  But, is there an
> existing solution out there that might be more elegant?

More elegant than with URI::URL? I wouldn't think so. URI::URL will
check all kinds of things for you, and it's easy wnough to use the
path_components (2 times) and rel methods to extract what you want (in
that order). Of course, you could do something with a regexp, but I'd
hardly call that more elegant. It's certainly much more error-prone,
unless you use the full one that has been posted here a few times. But
then your code really becomes less elegant. A dim-witted approach
could be:

s!http://[^/]+(/.+?/).+!$1thanks.html!;

But this will only work for a very limited set of URLs.

Again: Don't try to outsmart URI::URL. And don't expect too much from
that CGI env variable.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Freudian slip: when you say one thing
Commercial Dynamics Pty. Ltd.       | but mean your mother.
NSW, Australia                      | 


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

Date: Mon, 9 Aug 1999 15:53:24 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: I Installed Active Perl, but how can I run my CGI-Scripts activated by webside on my computer?
Message-Id: <MPG.1218fbbff8486c05989699@nntp1.ba.best.com>

Henni (noah@cs.tu-berlin.de) seems to say...
> I Installed Active Perl, but how can I run my CGI-Scripts activated by
> webside on my computer?
> 
> Please help.

Don't you know pit bulls live here?

Please read the FAQs that come with Active State Perl.  perlwin32faq6 is 
a good place to look.




-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Mon, 09 Aug 1999 19:08:00 -0400
From: "Dutch McElvy" <dutch@mindspring.com>
Subject: Re: kill pid scripts
Message-Id: <7onmmc$v52$1@nntp9.atl.mindspring.net>

Thanks for the response.
Actually I found the problem with the script below to be the -e after awk. I
removed it and the script ran fine from the command line.

Dutch

----------
In article <7omt3s$j5c$2@brokaw.wa.com>, jeromeo@atrieva.com (Jerome O'Neil)
wrote:


> In article <slrn7qs86i.9fk.abigail@alexandra.delanet.com>,
>  abigail@delanet.com (Abigail) writes:
>> Dutch McElvy (dutch@mindspring.com) wrote on MMCLXVIII September MCMXCIII
>> in <URL:news:7ol1k0$is0$1@nntp6.atl.mindspring.net>:
>> ``
>> `` kill -9 `ps -ef | grep foo | awk -e '{print $2}'`
>>
>> That doesn't compile.
>
> ksh finds it quite agreeable.
>
>> You need a , after the -9. Are your sure you want
>> to kill process groups? With a SIGKILL? Shouldn't you first try a more
>> friendly SIGTERM?
>
> I certainly would, but this is apparently not what the original poster
> has in mind.
>
> --
> Jerome O'Neil, Operations and Information Services
> Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
> jeromeo@atrieva.com - Voice:206/749-2947
> The Atrieva Service: Safe and Easy Online Backup  http://www.i-filezone.com


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

Date: 9 Aug 1999 22:18:51 GMT
From: hjeeves@us.ibm.com (Helena Jeeves)
Subject: memcpy problem
Message-Id: <7onk4b$uta$1@poknews.pok.ibm.com>

Hello:

I have a problem with memcpy in Perl to C extensions.  The code reads:

memcpy(stringa, stringb, strlen(stringb) );

and it insists on putting more than just strlen(stringb) into stringa!

There does not appear to be anything consistent about what is put
on the end of the string or the length of the additional characters.

Has anyone else seen this?

I am running Perl 5.005_02.

Helena J.



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

Date: Mon, 09 Aug 1999 23:49:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: memcpy problem
Message-Id: <iOJr3.4765$rR.4775@nsw.nnrp.telstra.net>

In article <7onk4b$uta$1@poknews.pok.ibm.com>,
	hjeeves@us.ibm.com (Helena Jeeves) writes:
> Hello:
> 
> I have a problem with memcpy in Perl to C extensions.  The code reads:
> 
> memcpy(stringa, stringb, strlen(stringb) );
> 
> and it insists on putting more than just strlen(stringb) into stringa!

<OFFTOPIC>

Not a perl problem. It's a C problem. To copy strings, you should be
using the str* functions, that's what they're for. strcpy comes to
mind. 

If you insist on using memcpy, make sure that you take that
terminating '\0' as well. The strlen won't be long enough. Oh.. If you
use a malloc before this one, also make sure that you leave room for
that '\0'.

</OFFTOPIC>

Martien
-- 
Martien Verbruggen                  | My friend has a baby. I'm writing down
Interactive Media Division          | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd.       | I can ask him what he meant - Steven
NSW, Australia                      | Wright


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

Date: Mon, 09 Aug 1999 23:09:23 GMT
From: mr_potato_head@my-deja.com
Subject: MIME::Lite newbie question
Message-Id: <7onn2t$7km$1@nnrp1.deja.com>

Hi,
  Can anyone show me how to do multiple attachments using MIME::Lite?
I'm able to do single attachments but I don't know how to do multiples.
 I also have a problem with sending text attachments.  Everytime I send
a text attachment it is loaded into the body of the message.  Why?  And
finally, can anyone show me how to insert a variable in the file
attachment section?  I have mulitple files that I would like to attach,
and I would like to pass these files into a variable to send so I can
use this same script somewhere else.  Thanks in advance...

PS - thanks for all those who turned me on to MIME:Lite.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 09 Aug 1999 18:17:30 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: NT Perl script archives
Message-Id: <37AF537A.E1C3FB@patriot.net>

> cany you tell me where I can find the win32 perl FAQ.
> Do you know of any decent freeware/shareware archives of win32 perl scripts?
>
> Yoss

Are you looking for anything specific?  I have some scripts available at

http://www.patriot.net/users/carvdawg/perl.html

Nothing special and quite small, but I intend to add more as I go along.  I have
links there
to other sites, as well.

Try Dave Roth's site:

http://www.roth.net

the examples from his book are available online.

If I may ask...what types of scripts are you looking for?  System admin?  User
mgmnt?

Carv






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

Date: Mon, 09 Aug 1999 22:09:32 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Pattern Matching +
Message-Id: <slrn7quic4.4t7.*@dragons.duesouth.net>

Mon, 09 Aug 1999 20:44:56 GMT, a great smashing of the head occured
against inlandpac@my-deja.com's keyboard, causing comp.lang.perl.misc to
receive this: 
: I am having a hard time trying to find a way to only display 5 words
: prior to and 5 words after the $keyword (with the $keyword included).
: 
: As an example, the output would be as such:
: 
: Tom went to the flea $keyword and bought some nice products.

How about:

$ perl -wne '/(((?:\S+\s+){0,5})\S*shop\S*((?:\s+\S+){0,5}))/ or print
>           "Failed\n" and next; print "All   : $1\nBefore: $2\nAfter :$3\n\n"'
Once upon a time, Tom went to a flea shop, and bought some pretty blue fleas.
All   : Tom went to a flea shop, and bought some pretty blue
Before: Tom went to a flea
After : and bought some pretty blue

Tom went to shop and Tom left.
All   : Tom went to shop and Tom left.
Before: Tom went to
After : and Tom left.

Foo, Bar, Baz.
Failed
>

Warning:

1) It accepts qw(shop shops porkshops shops,).
2) A word is defined as:
        a) any nonspace characters followed by any number of space
           characters
        b) any number of space characters followed by any number of
           nonspace characters
   This keeps punctuation from ruining the match, but it may not be what
   you desire.
3) It matches anywhere from 1 to 11 `words' (as in 2).

: Thank You all for the help.

HTH,
 
: CLH

--Matthew


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

Date: Mon, 09 Aug 1999 22:36:47 GMT
From: jsmith19991@my-deja.com
Subject: Perl Question
Message-Id: <7onl5v$65b$1@nnrp1.deja.com>

I'm having a problem with a Perl script that we
wrote. The answer is probably a simple one and
I would appreciate any helpful input. The problem
we are having is with the E-mailing of information
to a client. To make it simple, we have a script
that sends an Email to someone when they enter
their address. The script includes the following
lines for sending the mail:

 ...

open(MAIL,"|$mailprog -t");

print MAIL "To: Mary Smith\n";
print MAIL "From: John\n\n");
print MAIL "Subject: Information\n\n";

 ...

When the Email is received by the person however,
the "From" field reads not "John" like we intend
it to, but "John@whsun428.webhosting.com"

How do we get rid of the extra server info
following the name? We've tried a few things and
it always reads the same.

Jason


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 9 Aug 1999 15:01:57 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: POST via Imagemap - How?
Message-Id: <MPG.1218efae421960e0989e12@nntp.hpl.hp.com>

In article <37AF4472.71D55A1C@mail.cor.epa.gov> on Mon, 09 Aug 1999 
14:13:22 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
> Bart Lateur wrote:
> > 
> > Abigail wrote:
> > 
> > >Oddly enough, someone asked the same question recently in this
> > >newsgroup, with a slightly different subject line.
> > >
> > >Perhaps you want to contact the poster, maybe he got an answer,
> > >or figured it out himself. His email address is: cmeilahn@nauiww.org
> > 
> > What a strange sense of humour. It *is* the same poster. Should he
> > contact himself? Is this an advanced case of schisophrenia?
> > 
> >         "Hi, me. I have the same problem as me. Do I know the answer?"
> 
> Well *I* thought Abigail's intention was imminently clear.  But then,
> I'm the sort of person who uses the word 'imminently' in conversation.

When you should be using the word 'eminently'.  Ow!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 09 Aug 1999 23:45:46 GMT
From: jflowers44@aol.com (Jflowers44)
Subject: print to file using here document
Message-Id: <19990809194546.13367.00007603@ng-bd1.aol.com>

I am trying to print to a file using the here document notation.  I know that
the script works fine otherwise, but when I telnet into my web server (it's a
cgi-script that writes to html files) and try to compile it with perl, it says
that it doesn't find the terminator (the thing that it's supposed to print to
untill it reads).  The terminator has no spaces.  can anyone help?  Thanks.


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

Date: 9 Aug 1999 23:49:24 GMT
From: billynospam@mirror.bt.co.uk (Graham Ashton)
Subject: Re: print to file using here document
Message-Id: <slrn7quq85.2a9.billynospam@wing.mirror.bt.co.uk>

In article <19990809194546.13367.00007603@ng-bd1.aol.com>, Jflowers44 wrote:

>I am trying to print to a file using the here document notation.
>[snip]
>compile it with perl, it says that it doesn't find the terminator (the
>thing that it's supposed to print to untill it reads).  The terminator
>has no spaces.

sounds like a silly question, but what about whitespace between the end
of your terminator and the end of the line (there shouldn't be any)?

failing that, post the relevant part of your code.

-- 
Graham

P.S. <billynospam@mirror.bt.co.uk> is a fully working address...


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

Date: Tue, 10 Aug 1999 00:08:16 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Problem reading forms with perl
Message-Id: <viIr3.680$aT1.6993@news1.online.no>


<genelong@my-deja.com> wrote in message news:7oned1$16n$1@nnrp1.deja.com...
> I went to activestate.com, and there are a lot of things to download.
> Which one(s) do I need?

I agree that it's not immediately obvious where the Perl installation is
located, but in the menu there is a link to "ActivePerl" (ActiveState likes
to add "Active" to their software) which is what you need.

http://www.activestate.com/ActivePerl/download.htm#complete

> Is the "standard distribution" basically a perl compiler?  Why would I
> want to compile my perl when the server interprets the source?  Or is
> it just for documentation purposes?

You're confusing perl with cgi. The webserver does not interpret perl at
all. When you access a .cgi-file (well, this depends on your
server-configuration of course) the server will basically execute that
program as a shell program and direct it's output back to the browser that
sent the request. If that program is a Perl-script it's compiled by the
perl-compiler.

Also beware that if you want to run your scripts from a web-browser, you
need to install a web-server as well. I would recommend a visit to
http://www.apache.org/ to get that.

> There seems to be a huge communication gap between unix and windows
> programmers.  Where do people enter commands such as perldoc (or
> whatever it was) in Windows?  Windows consists of icons and screens,
> not command lines.  The only way I know of entering commands is opening
> a DOS window, and I would think DOS has nothing to do with perl.

That's probably an easy mistake to make, but after a normal installation of
ActivePerl you will find that perldoc will work from DOS as well.
Of course. ActivePerl will also install the documentation in HTML-format, so
the easiest way to access the docs in windows is ofcourse to click your way
through the start-menu.
However - you should never underestimate the power of a command-line
utility.

> I am glad to get a hold of all these resources to enhance my knowledge
> of perl, but I also feel I am buying a car when all I want to do is go
> to the house next door.  Is all this really necessary to read angle
> brackets from a form?  I see forms all the time that let users enter

In short: Yes.

If you want to parse the data from a form you need a program.
If you want that program to be a perl-program you need a perl interpreter
and compiler
If you don't want to reinvent a lot of smooth wheels you need a good set of
modules.

In addition you also need the webserver of course.

All this is needed so that you can run scripts locally on your own machine.
If you have a webpage at an ISP, your ISP already has a webserver. If you
want to parse forms on that webpage you need to contact your ISP to find out
if they offer that possibility at all etc.

> addresses such as "joe <joe@domain.com>".  How do those forms get the
> input into some place where it can be manipulated?  I will be glad to
> learn all these things, but if someone could hand me a line of code
> that would do the trick, I would be greatly appreciative.  It just
> can't be that hard.

When it comes to form handling you should use CGI.pm. This module includes
everything you could possibly need to create web-pages with fill-out forms
and to manipulate the data returned from the form. But don't forget that if
you stumble onto problems that are related to getting the script to work
from the webserver and getting the script to accept data from the form you
should ask you questions to a group that specializes in CGI-programming
(e.g. comp.infosystems.www.authoring.cgi)

BTW: The particular email-address you entered is 100% valid (I haven't
bothered to check if domain.com exists tjough), so there is no need for any
scripts to manipulate it. So even though the address itself is just
"joe@domain.com" you can write it in many different formats. You'd be
surprised how many different formats of valid email-addresses that exists.

--
Trond Michelsen





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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 435
*************************************


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