[16934] in Perl-Users-Digest
Perl-Users Digest, Issue: 4346 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 17 03:10:24 2000
Date: Sun, 17 Sep 2000 00:10:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969174613-v9-i4346@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 17 Sep 2000 Volume: 9 Number: 4346
Today's topics:
Re: Req.: The perfect Perl Editor? <randy_734@my-deja.com>
Re: Req.: The perfect Perl Editor? (Craig Berry)
Re: Req.: The perfect Perl Editor? <godzilla@stomp.stomp.tokyo>
Re: syslog in perl (Dave Sherohman)
Re: Tweaking Cookies <christopher_j@uswest.net>
Re: Tweaking Cookies (Abigail)
Re: Tweaking Cookies <d@i.am>
Two questions: 1)Erasing temporary files 2)post method <art_s@pacbell.net>
Re: Two questions: 1)Erasing temporary files 2)post met (Abigail)
Re: Two questions: 1)Erasing temporary files 2)post met <art_s@pacbell.net>
Re: Two questions: 1)Erasing temporary files 2)post met (Eric Bohlman)
Re: Two questions: 1)Erasing temporary files 2)post met (Martien Verbruggen)
Re: Web Client multipart-data POST <billhess2000@home.com>
Re: which the best scripting language? (brian d foy)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 17 Sep 2000 01:35:42 GMT
From: Randy <randy_734@my-deja.com>
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <39c41bbe.1261265@207.126.101.100>
I'm rather surprised that no one has mentioned PFE, the Programmer's
File Editor. It is completely free for personal use. Incredibly
configurable, has user configurable context sensitive help, MRU list,
macro recording and macro library mgmgt, auto indentation, custom key
mappings (in case you want to make it work like vi, hehe), multiple
windows, multiple files, language awarenes with automatic brace
matching,automatically detecs Unix format files, lots more features.
Randy Harris
"Andreas Leiberger" <andreas@gispi-sport.de> wrote:
>Hi !!!
>
>Is there a software for creating perl scripts that includes an excellent
>help documentation. I'm a fan of the mark+F1 technique. I kind of miss that
>in Notepad. :-)
>Can you recommend any programm in this context.
>
>Thanks ANDREAS
>
>ps.: I know my english sucks. Neverzheless I hope you know what I mean.
>
>
>
------------------------------
Date: Sun, 17 Sep 2000 05:19:02 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <ss8l267kh3t37@corp.supernews.com>
Randy (randy_734@my-deja.com) wrote:
: I'm rather surprised that no one has mentioned PFE, the Programmer's
: File Editor. It is completely free for personal use. Incredibly
: configurable, has user configurable context sensitive help, MRU list,
: macro recording and macro library mgmgt, auto indentation, custom key
: mappings (in case you want to make it work like vi, hehe), multiple
: windows, multiple files, language awarenes with automatic brace
: matching,automatically detecs Unix format files, lots more features.
I like this one too; unfortunately, it's no longer supported by its
author: http://www.lancs.ac.uk/people/cpaap/pfe/
Of course, it's still perfectly useable; just means that new features and
bug fixes won't be happening, and eventually OS-change-induced bit rot
will do it in. Quite a shame.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Every force evolves a form."
| - Shriekback
------------------------------
Date: Sat, 16 Sep 2000 23:27:00 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <39C46434.A68D14C6@stomp.stomp.tokyo>
Craig Berry wrote:
> Randy (randy_734@my-deja.com) wrote:
> : I'm rather surprised that no one has mentioned PFE, the Programmer's
> : File Editor. It is completely free for personal use. Incredibly
> : configurable, has user configurable context sensitive help, MRU list,
> : macro recording and macro library mgmgt, auto indentation, custom key
> : mappings (in case you want to make it work like vi, hehe), multiple
> : windows, multiple files, language awarenes with automatic brace
> : matching,automatically detecs Unix format files, lots more features.
> I like this one too; unfortunately, it's no longer supported by its
> author: http://www.lancs.ac.uk/people/cpaap/pfe/
> Of course, it's still perfectly useable; just means that new features and
> bug fixes won't be happening, and eventually OS-change-induced bit rot
> will do it in. Quite a shame.
This bit rot will take a long time. I've been using PFE since
its early days and, continue to use PFE. Currently I am using
PFE under Win 98x with zero problems. Stunning piece of software,
free and beats all other program editors I have tested.
* recalls being yelled at by Perl Professionals for using PFE *
So, who is going to ridicule and critique me this time for using PFE?
Which of you will refer to me as an "idiot" as so many of you did
a few months back when I mentioned I use PFE for an editor?
* growls a contemptuous growl *
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: Sun, 17 Sep 2000 03:06:04 GMT
From: esper@news.visi.com (Dave Sherohman)
Subject: Re: syslog in perl
Message-Id: <slrn8s8d8s.3rl.esper@pchan.dojo>
On 16 Sep 2000 12:56:28 GMT, Robert Jan Schaper <r.schaper@chello.nl> wrote:
> Try to set the to unix instead of the default inet:
>
> Sys::Syslog::setlogsock('unix');
Yep, that did it - thanks!
Now the inevitable followup questions:
1) If the machine is using a remote log host, will this still work? I would
assume so, since the perl script would (presumably) use a unix socket to
connect to the local syslogd, which would then use an inet socket to connect
to the log host's syslogd, but I'm not certain that it works that way.
2) Why would I not be able to log using an inet socket, particularly when
the script is running as root?
3) If inet is more likely to have problems, why is it the default? Is it
just because unix domain sockets don't exist under Win32 or is there some
other reason?
--
"Two words: Windows survives." - Craig Mundie, Microsoft senior strategist
"So does syphillis. Good thing we have penicillin." - Matthew Alton
Geek Code 3.1: GCS d- s+: a- C++ UL++$ P+>+++ L+++>++++ E- W--(++) N+ o+
!K w---$ O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv b+ DI++++ D G e* h+ r++ y+
------------------------------
Date: Sat, 16 Sep 2000 18:18:15 -0700
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Re: Tweaking Cookies
Message-Id: <nZUw5.595$yX3.272586@news.uswest.net>
"Michael Satkevich" <mike@sas-inc.com> wrote:
> I sent a cookie to my PC using the cookie method of a CGI object.
>
> When I checked my hard drive the cookie file was named "mike@cgi-bin".
>
> How do I make the file name refer to the site from whence it originated?
>
> I see other cookies named "mike@lycos", etc.
That is a completely Internet Explorer thing. It decides how to
name it's cookie files and there's not much you can do about it.
If you use IE's internal temp files / cookie file listings it'll
show you all the domain name info (which you won't normally see
when viewing the cookie file listings in Explorer).
------------------------------
Date: 17 Sep 2000 01:59:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Tweaking Cookies
Message-Id: <slrn8s89a9.h8o.abigail@alexandra.foad.org>
Michael Satkevich (mike@sas-inc.com) wrote on MMDLXXIII September
MCMXCIII in <URL:news:8q0gal$v6o$1@murdoch.harvard.net>:
`' I sent a cookie to my PC using the cookie method of a CGI object.
`'
`' When I checked my hard drive the cookie file was named "mike@cgi-bin".
`'
`' How do I make the file name refer to the site from whence it originated?
`'
`' I see other cookies named "mike@lycos", etc.
Well, I presume you use a browser to deal with the cookies. Also, since
you ask the question here, I presume the browser is written in Perl.
Since you don't show any relevant code, all we can do is point you in
the general direction: 'perldoc -f open'.
HTH. HAND.
Abigail
--
@;=split//=>"Joel, Preach sartre knuth\n";$;=chr 65;%;=map{$;++=>$_}
0,22,13,16,5,14,21,1,23,11,2,7,12,6,8,15,3,19,24,14,10,20,18,17,4,25
;print@;[@;{A..Z}];
------------------------------
Date: Sun, 17 Sep 2000 09:38:23 +0700
From: "Dimitri" <d@i.am>
Subject: Re: Tweaking Cookies
Message-Id: <8q1b5l$14q$1@news.asiaaccess.net.th>
"Michael Satkevich" <mike@sas-inc.com> wrote in message
news:8q0gal$v6o$1@murdoch.harvard.net...
> I sent a cookie to my PC using the cookie method of a CGI object.
>
> When I checked my hard drive the cookie file was named "mike@cgi-bin".
>
> How do I make the file name refer to the site from whence it originated?
>
> I see other cookies named "mike@lycos", etc.
>
> Just curious,
>
> mike
>
I put in the "cookies domain" variable the exact url of my site. example:
dimitri.mysite.com and it is working well.
Dimitri.
------------------------------
Date: Sat, 16 Sep 2000 19:11:10 -0700
From: as <art_s@pacbell.net>
Subject: Two questions: 1)Erasing temporary files 2)post method
Message-Id: <39C4283D.50195FE@pacbell.net>
I have two questions involving processsing CGI.
1) I write temporary files like gifs in a cgi script. I would like to
erase them when the script is done and the pic is displayed to the user.
Unfortunately, the methods i have tried seem to erase the temporary
graphic before the server sends it to the user.
2)Can i pass variables using the POST method to a script that is started
by another script. that is, the first script gets the cgi variables and
runs another perl script. The cgi variables seem to pass fine using get
but not with post. is there anything special that needs to be done when
using post?
I appreciate your assistance.
A
------------------------------
Date: 17 Sep 2000 02:22:28 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Two questions: 1)Erasing temporary files 2)post method
Message-Id: <slrn8s8al0.h8o.abigail@alexandra.foad.org>
as (art_s@pacbell.net) wrote on MMDLXXIV September MCMXCIII in
<URL:news:39C4283D.50195FE@pacbell.net>:
:) I have two questions involving processsing CGI.
This group's topic is not CGI.
:) 1) I write temporary files like gifs in a cgi script. I would like to
:) erase them when the script is done and the pic is displayed to the user.
:) Unfortunately, the methods i have tried seem to erase the temporary
:) graphic before the server sends it to the user.
The solution to this is utterly straightforward, but it has nothing to
do with Perl. You'd do the same thing if you programmed in any other
language. About the only Perl thing that's relevant is 'unlink'.
:) 2)Can i pass variables using the POST method to a script that is started
:) by another script. that is, the first script gets the cgi variables and
:) runs another perl script. The cgi variables seem to pass fine using get
:) but not with post. is there anything special that needs to be done when
:) using post?
Again, that has nothing to do with Perl. How CGI variables are passed
are completely independent of the language the called program is written
in. You might want to look up the CGI specification, or, alternatively,
ask in comp.lang.cobol. But people there might direct you to yet another
group.
Abigail
--
$; # A lone dollar?
=$"; # Pod?
$; # The return of the lone dollar?
{Just=>another=>Perl=>Hacker=>} # Bare block?
=$/; # More pod?
print%; # No right operand for %?
------------------------------
Date: Sat, 16 Sep 2000 20:15:51 -0700
From: as <art_s@pacbell.net>
Subject: Re: Two questions: 1)Erasing temporary files 2)post method
Message-Id: <39C43766.C67733A9@pacbell.net>
'unlink' is precisely what does not work. if you do not wish to help, then just
simply say so and redirect me to another group. you do not need to ramble on
with off the cuff suggestions. why waste your time writing if all you wanted
was for me to post to another group?
Abigail wrote:
> as (art_s@pacbell.net) wrote on MMDLXXIV September MCMXCIII in
> <URL:news:39C4283D.50195FE@pacbell.net>:
> :) I have two questions involving processsing CGI.
>
> This group's topic is not CGI.
>
> :) 1) I write temporary files like gifs in a cgi script. I would like to
> :) erase them when the script is done and the pic is displayed to the user.
> :) Unfortunately, the methods i have tried seem to erase the temporary
> :) graphic before the server sends it to the user.
>
> The solution to this is utterly straightforward, but it has nothing to
> do with Perl. You'd do the same thing if you programmed in any other
> language. About the only Perl thing that's relevant is 'unlink'.
>
> :) 2)Can i pass variables using the POST method to a script that is started
> :) by another script. that is, the first script gets the cgi variables and
> :) runs another perl script. The cgi variables seem to pass fine using get
> :) but not with post. is there anything special that needs to be done when
> :) using post?
>
> Again, that has nothing to do with Perl. How CGI variables are passed
> are completely independent of the language the called program is written
> in. You might want to look up the CGI specification, or, alternatively,
> ask in comp.lang.cobol. But people there might direct you to yet another
> group.
>
> Abigail
> --
> $; # A lone dollar?
> =$"; # Pod?
> $; # The return of the lone dollar?
> {Just=>another=>Perl=>Hacker=>} # Bare block?
> =$/; # More pod?
> print%; # No right operand for %?
------------------------------
Date: 17 Sep 2000 04:20:53 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Two questions: 1)Erasing temporary files 2)post method
Message-Id: <8q1gr5$4t9$5@nntp9.atl.mindspring.net>
[quoting rearranged to follow the normal order of human conversation]
as (art_s@pacbell.net) wrote:
: Abigail wrote:
:
: > This group's topic is not CGI.
[snip]
: > Again, that has nothing to do with Perl. How CGI variables are passed
: > are completely independent of the language the called program is written
: > in. You might want to look up the CGI specification, or, alternatively,
: > ask in comp.lang.cobol. But people there might direct you to yet another
: > group.
:
: 'unlink' is precisely what does not work. if you do not wish to help, then just
: simply say so and redirect me to another group. you do not need to ramble on
: with off the cuff suggestions. why waste your time writing if all you wanted
: was for me to post to another group?
Oh but she did redirect you to another group (and no, it wasn't
comp.lang.cobol).
------------------------------
Date: Sun, 17 Sep 2000 15:53:26 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Two questions: 1)Erasing temporary files 2)post method
Message-Id: <slrn8s8ji6.ntr.mgjv@martien.heliotrope.home>
[Please, in the future, post your response _after_ the suitably trimmed
text you reply to]
On Sat, 16 Sep 2000 20:15:51 -0700,
as <art_s@pacbell.net> wrote:
> 'unlink' is precisely what does not work. if you do not wish to help, then just
> simply say so and redirect me to another group. you do not need to ramble on
> with off the cuff suggestions. why waste your time writing if all you wanted
> was for me to post to another group?
unlink is the right answer, and it works perfectly. Your program just
doesn't do what you want it to do, because you don't understand the
mechanism with which these things happen over HTTP. To find out, you go
to one of the groups in the comp.infosystems.www.* hierarchy, and ask
there.
CGI and stuff like that isn't discussed here. Thank you.
[Removed overlong jeopardy quote]
[Note f'ups]
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia |
------------------------------
Date: Sun, 17 Sep 2000 05:11:47 GMT
From: "Bill Hess" <billhess2000@home.com>
Subject: Re: Web Client multipart-data POST
Message-Id: <noYw5.49842$QW4.580146@news1.rdc1.mi.home.com>
Thanks for the script - I am trying to reverse engineer the upload script -
I have a working CGI script which I call from a web browser (see below) -
the script works, so I just have to write something that emulates it -
right?
I used your listening script to see what the HTTP the browser sent to the
client and then tried to write a program to duplicate this, but I cannot
seem to get the to work - I keep getting bad header error (500)
I am using \015\012 after every line for example:
print $fh "POST /cgi-bin/upload.pl HTTP/1.1\015\012";
Do you know if this is the right thing to do?
Please let me know if you come up with a working client upload script -
thanks...
#!/perl/5.00503/bin/MSWin32-x86/perl
use CGI;
$q = new CGI;
$file = $q->param("file");
print $q->header();
if(! $file) {
print
$q->start_multipart_form(),
$q->h3("Enter a filename to upload:"),
$q->br(),
$q->filefield(-name=>'file',
-size=>50,
-maxlength=>80),
$q->br(),
$q->submit(-name => "done"),
$q->end_form();
}
else {
print $q->h3("The filename is: '$file'");
$info = $q->uploadInfo($file);
foreach $k (keys %$info) {
print $q->h5("$k = $info->{$k}");
}
open FR, $file;
binmode(FR);
while(read(FR, $buf, 1024)) {
print $buf;
}
close FR;
}
--
Bill Hess
<tebrusca@my-deja.com> wrote in message news:8ptnou$alh$1@nnrp1.deja.com...
> In article <9shw5.47046$QW4.546759@news1.rdc1.mi.home.com>,
> "Bill Hess" <billhess2000@home.com> wrote:
> > I am trying to write a web client to upload files to a web server (in
> Perl)-
> > I know the CGI side on the server works, because I can upload
> successfully
> > using a web browser. But I cannot seem to get the headers correct.
> Here is
> > what I think the headers should look like - Am I missing
> something??? I am
> > trying to reverse engineer what IE is doing...
>
> Bill,
>
> I modified a script to listen on port 80 and print what it hears.
> I then set up my upload script on a remote browser.
> I shut down my real server and started my little script.
> This is what it printed (slightly modified, took IPs out):
>
> POST /cgi-bin/upload.cgi HTTP/1.0
> Referer: http://hostname/cgi-bin/upload.cgi
> Connection: Keep-Alive
> User-Agent: Mozilla/4.7C-SGI [en] (X11; I; IRIX64 6.5 IP27)
> Host: xxx.xxx.xxx.xxx
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png,
> */*
> Accept-Encoding: gzip
> Accept-Language: en
> Accept-Charset: iso-8859-1,*,utf-8
> Content-type: multipart/form-data; boundary=---------------------------
> 251372556626966
> Content-Length: 409
>
> -----------------------------251372556626966
> Content-Disposition: form-data; name="sent_to"
>
> tebrusca
> -----------------------------251372556626966
> Content-Disposition: form-data; name="subject"
>
>
> -----------------------------251372556626966
> Content-Disposition: form-data; name="upload"; filename="hello.txt"
> Content-Type: text/plain
>
> Hello world
>
> -----------------------------251372556626966--
>
> I then cat'ed this to a telnet hostname 80 on a remote system
> and whamo it worked. Now I can use this as a template for
> uploading files to my web server with a perl script.
>
>
> Here's what's left of the phttpd.pl script I pimped off CPAN:
> I severely hacked stuff out of it.
>
> #!/usr/local/bin/perl -w
>
> use strict;
> use Socket;
>
> my $port = 80;
> $|=1;
>
> my $tcp = getprotobyname('tcp');
> socket(Server, PF_INET, SOCK_STREAM, $tcp) || die "socket: $!";
> setsockopt(Server, SOL_SOCKET, SO_REUSEADDR,pack("l", 1))
> ||die "setsockopt: $!";
> bind(Server, sockaddr_in($port, INADDR_ANY))|| die "bind: $!";
> listen(Server,SOMAXCONN)|| die "listen: $!";
> my $addr;
> for ( ; $addr = accept(Client,Server); close Client)
> {
> *STDIN = *Client;
> *STDOUT = *Client;
> while ( <STDIN> )
> {
> print STDERR $_;
> }
> }
>
> I'll post the upload perl script when I write it, unless
> somebody else posts it first, I've worked on this enough
> today.
>
> I want upload on cmd line myself, because I want to
> backup files I'm working on remotely to my webserver.
>
> backup.pl file ( uploads to my web server )
> get.pl file ( downloads a file from server perl directory )
>
> Here's my get.pl script "it's crude but effective":
>
> #!/usr/sbin/perl
>
> my $query = "/PERL/$ARGV[0]";
> my @data = `echo "GET $query HTTP/1.0 \n" |
> telnet hostname 80 2> /dev/null`;
> until ( $data[0] =~ /^#!/ ) { shift @data; }
> print @data;
>
> Hope this helps, hope even more that others have done something
> like this so I can use it.
>
> PS
>
> I don't have the HTTP, LWP, MIME, ... modules available
> on my remote systems so I need to do this without them.
>
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sat, 16 Sep 2000 22:02:57 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: which the best scripting language?
Message-Id: <brian-ya02408000R1609002202570001@news.panix.com>
In article <m3snqz3k8r.fsf@solo.david-steuber.com>, David Steuber <nospam@david-steuber.com> posted:
> "Lucisferre" <lucisferre@email.com> writes:
>
> ' You think which is the best scripting language? Perl or TCL? What is your
> ' best scripting language?
> I can do more with Perl than I can with TCL and Python. However, that
> is because I know Perl better and CPAN is very comprehensive indeed.
well, it depends on the task. i try not to decide the best way to
solve a problem before i know what it is ;)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4346
**************************************