[12664] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 73 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 8 01:17:21 1999

Date: Wed, 7 Jul 1999 22:05:07 -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           Wed, 7 Jul 1999     Volume: 9 Number: 73

Today's topics:
    Re: Accessing POP mail? (Cameron Laird)
    Re: data structure to emulate pointers (Abigail)
        errors with #!/usr/bin/env perl -w (Ronald J Kimball)
    Re: Fork & Exec proc & get return values? (Anno Siegel)
    Re: Fork & Exec proc & get return values? (David Efflandt)
    Re: fork() in Win32 (Abigail)
    Re: Help -- Weird Increments (MacPerl) (Abigail)
    Re: How to format date and year string? (elephant)
    Re: HTTP Proxy programming <bakins@mediaone.net>
    Re: Is PERL the way to create a pop-up window ? (David Efflandt)
    Re: Is PERL the way to create a pop-up window ? (Abigail)
    Re: My last hope (Abigail)
    Re: need module to parse html file (Abigail)
    Re: Perl/CGI Combined file upload & e-mail (David Efflandt)
    Re: PERLFUNC: shift - remove the first element of an ar (Philip 'Yes, that's my address' Newton)
    Re: Receiving binaries (David Efflandt)
    Re: s/// Bug/bad syntax?? (WAS:$scalars in s/// not wor <uri@sysarch.com>
    Re: Webpages and Perl-Couple of Questions <uri@sysarch.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 7 Jul 1999 23:02:01 -0500
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Accessing POP mail?
Message-Id: <7m17rp$rnn$1@Starbase.NeoSoft.COM>

In article <7lt2fa$191$1@sunb.ocs.mq.edu.au>,
Brendan Reville <breville@mpce.mq.edu.au> wrote:
>hi
>
>I want to write a Perl script on my web server which pulls incoming mail out
>of a local POP account.  This incoming mail is stored in a mail spool file
>on a mail server, so I can't access the file directly.  Is there any other
>way to pull the mail out of this POP server?
			.
			.
			.
Go immediately to Mail::POP3Client from CPAN.
-- 

Cameron Laird           http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com      +1 281 996 8546 FAX


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

Date: 7 Jul 1999 22:34:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: data structure to emulate pointers
Message-Id: <slrn7o8728.ued.abigail@alexandra.delanet.com>

* Tong * (sun_tong_nospam@zdnetmail.com) wrote on MMCXXXVI September
MCMXCIII in <URL:news:3783CD4E.36A1D1A@zdnetmail.com>:
@@ 
@@ I searched in CPAN for codes in perl for tree handling. there are
@@ something there, but none of them provide the abstract tree function
@@ (not for special purpose like directory or C codes).
@@ 
@@ So I think I should write it myself. Before I move on, I'd like to ask
@@ your advise on how to set the data structure for nodes. Perl doesn't
@@ have pointers as C does, so what if I really need the pointer. 

Why would you need a pointer? Are you planning to do arithmetic on it?

@@ Is this a question that is too difficult so that no one ever write
@@ abstract tree module?

I've written tree modules. I think there are tree modules on CPAN.


But you are too locked in one way of thinking. "Perl doesn't have
pointer, so I cannot make a tree, cause any tree I've ever made
needed pointers". But just because you've always done C or Pascal
doesn't mean you always need pointers.


Here's a simple way, it didn't take more than 10 minutes of coding:

#!/opt/perl/bin/perl -w

use strict;

sub new_node {
    my %node;
    @node {qw /key left right/} = @_;

    sub {
        my ($field, $value) = @_;
        $node {$field} = $value if defined $value;
        $node {$field}
    }
}

sub insert;
sub insert {
    my ($tree, $key) = @_;
    unless (defined $tree) {
        return new_node $key;
    }
    return $tree if $key == $tree -> ('key');
    if ($key < $tree -> ('key')) {
        $tree -> ('left', insert ($tree -> ('left'), $key));
    }
    else {
        $tree -> ('right', insert ($tree -> ('right'), $key));
    }
    $tree;
}


sub dump_tree;
sub dump_tree {
    my ($tree, $indent) = @_;
    return unless defined $tree;
    $indent ||= "";
    dump_tree $tree -> ('left'),  "    " . $indent;
    print $indent, $tree -> ('key'), "\n";
    dump_tree $tree -> ('right'), "    " . $indent;
}


my $tree;

my @keys = map {int rand 100} 1 .. 30;

foreach my $key (@keys) {
    $tree = insert ($tree, $key);
}

dump_tree $tree;

__END__


It doesn't use pointers. It uses references though, in this case to
closures. It doesn't use any of those new fangled objects either.
The closures give us ADTs with strong binding with ease; objects just
give weak binding (or many hoops). Although objects give some syntactical
sugar.

Of course, one can program around using references as well. But let's
leave that for a next time.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 8 Jul 1999 00:34:05 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: errors with #!/usr/bin/env perl -w
Message-Id: <1dulkun.87jrvd1dvz916N@p86.block2.tc1.state.ma.tiac.com>

Following a recent reorgization of a local file system, I've decided to
replace all occurences of

#!/usr/local/bin/perl

with

#!/usr/bin/env perl

which is a form I've seen other posters recommend.


This works fine for the simple case, but when the perl command is
followed by any command switches, execution fails, as in:

#!/usr/bin/env perl -w

env: perl -w: Permission denied


I've determined that this is caused by how exec interprets the shebang
line: 'perl -w' is all one argument to env.  But I haven't figured out a
solution, and perlrun doesn't even mention using env.

So, what is the proper way to specify command line options when using
env in the shebang line of a Perl script?


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 8 Jul 1999 03:16:16 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Fork & Exec proc & get return values?
Message-Id: <7m1560$58t$1@lublin.zrz.tu-berlin.de>

 <ccort@my-deja.com> wrote in comp.lang.perl.misc:
>Hello,
>
>I am writing a simple link checker in Perl.  I have a demon process
>that uses fork() and exec() to spawn multiple instances of another
>script which checks a link.  Currently, the only thing I can get back
>is the 8-bit exit code from the spawned child(ren).  I don't require
>any complex IPC.  I just want to be able to get back, say, 3 integers.

Well, to get back three integers you'll need some kind of IPC, complex
or otherwise.  You may try to open( FH, 'otherscript |') and have
otherscript print those integers to STDOUT just before it exits.
You'll have to make those FH filehandles non-blocking and repeatedly
try to read them to see which of the children is done (or use the
4-argument select).  Also, don't forget to close the filehandles and
check the return code to see if they ended properly.

[snippage]

Anno


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

Date: 8 Jul 1999 03:40:54 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Fork & Exec proc & get return values?
Message-Id: <slrn7o8799.hu.efflandt@efflandt.xnet.com>

On Thu, 08 Jul 1999 01:49:10 GMT, ccort@my-deja.com <ccort@my-deja.com> wrote:
>Hello,
>
>I am writing a simple link checker in Perl.  I have a demon process
>that uses fork() and exec() to spawn multiple instances of another
>script which checks a link.  Currently, the only thing I can get back
>is the 8-bit exit code from the spawned child(ren).  I don't require
>any complex IPC.  I just want to be able to get back, say, 3 integers.

You might want to see 'man perlipc' anyway.  Perhaps you are confused
about exec() and should be using something else [system() or backticks].
Because exec() is a one-way street and does not return anything unless it
fails.

One idea might be to set up a fifo and redirect output from the multiple
spawned processes to the fifo (named pipe which is like a file).  But
opening a fifo blocks until there is something to read, so you probably
need to fork a child_to_read to open and get info from the fifo to pass
to the main script.

I have set up as many as 4 pipes between 2 shell programs:
1. Fork fifo to feed program1
2. read STDERR from program1 (progress status)
3. Fork fifo for STDOUT from program1 (data)
4. Filter and pipe status (#2) to program2 (dialog guage to screen)
Note: That was when I didn't have open3().

>Can someone please point me in the right direction?  I've been combing
>everything I can find on Threads on the web.  I did not have success
>with Thread.pm.  The fork() and exec() work fine except for this issue
>with the return values.  I am working on Solaris, although ultimately
>this will be on AIX.
>
>
>Thanks!
>Chris
>Chris.Cortese@xxxNOSPAMxxxschwab.com
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.


-- 
David Efflandt   efflandt@xnet.com   http://www.xnet.com/~efflandt/
http://www.de-srv.com/   http://cgi-help.virtualave.net/


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

Date: 7 Jul 1999 22:57:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: fork() in Win32
Message-Id: <slrn7o88c8.ued.abigail@alexandra.delanet.com>

iqa (iqa@xippix.com) wrote on MMCXXXVI September MCMXCIII in
<URL:news:3783E834.DD8A9274@xippix.com>:
\\ Is there any way I can do like:
\\ 	exec @command_list if (!fork());
\\ 
\\ under Win32 environment where fork() is not suppported.

One of:
  1) Install a real OS.
  2) Wait till the next release.

Option 1) is the fastest, and gives you a lot more benefits.


Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 7 Jul 1999 23:06:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help -- Weird Increments (MacPerl)
Message-Id: <slrn7o88t0.ued.abigail@alexandra.delanet.com>

johnny99 (john@your.abc.net.au) wrote on MMCXXXVI September MCMXCIII in
<URL:news:931390249.12510@www.remarq.com>:
`` I'm using someone else's script, which uses an external data
`` file to record an incremented number.
`` 
`` The incremented number is incrementing very strangely.
`` 
`` Here's a script I put together to reproduce the effect:
`` 
`` 		open (NUMBER,"+<data.txt");
`` 		$num = <NUMBER>;
`` 		print "I got $num from the data.txt file ";
`` 		$num++;
`` 		print "and I incremented it to $num.\n";
`` 		print NUMBER $num;
`` 		close (NUMBER);
`` 
`` which produces these effects, (starting with a zero as the
`` contents of data.txt):
`` 
`` I got 0 from the data.txt file and I incremented it to 1.
`` I got 01 from the data.txt file and I incremented it to 02.
`` I got 0102 from the data.txt file and I incremented it to
`` 0103.
`` I got 01020103 from the data.txt file and I incremented it
`` to 01020104.
`` I got 0102010301020104 from the data.txt file and I
`` incremented it to 0102010301020105.
`` 
`` Can anyone help me?
`` 
`` This script works just fine on UNIX, by the way, and you end
`` up with a file consisting of just


Well, that's certainly odd. I would expect something else to happen.
In fact, when I run it on Unix, I do get something else. It will print:
I got 0
 from the data.txt file and incremented it to 1
no matter how often I run the program.

Notice the newline? Why doesn't the program above have that newline?
You don't chomp.... And a simple -l leads to different, simular problems.

But there's another thing you don't do. You read in a number, then write
a number. It is *not* going to overwrite it. In fact, it will put 1
*ON THE SECOND LINE OF THE FILE*. So, next time you run this, 0 will
still be the first number, and hence 1 gets written on the second line
again, and again, and again.

You want to seek().



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 8 Jul 1999 13:50:51 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: How to format date and year string?
Message-Id: <MPG.11eecb275e9e1690989b1a@news-server>

Martien Verbruggen writes ..
>PS. You have a bug in your code., which will be visible from the year
>2000 onwards.

don't think he does (from his post)

#--snip
$year += "1900";
$REAL_DATE="$year$sep$month$sep$day";
#--pins

he's just asking perl to do a bit more work to do the string conversion 
from "1900" to 1900 before submitting the value to the += operator

that having been said .. Joey .. always get suspicious if you start 
setting up arrays like your days and months arrays .. basically if 
something is common amongst all people (like the names of days and 
months .. or as another example - the names of numbers) then there is 
going to be a prewritten module

-- 
 jason - remove all hyphens for email reply -


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

Date: Wed, 07 Jul 1999 21:52:52 -0400
From: "M. Brian Akins" <bakins@mediaone.net>
Subject: Re: HTTP Proxy programming
Message-Id: <37840474.E1DF7B6B@mediaone.net>



>
> !!
> !! I have a problem though.  When connecting to apche servers which use
> !! name based virtual hosting, since I am only connecting via IP, I get the
>                                                               ^^
> Really? Just IP? No TCP?
>

Yes, I'm doing it all over TCP.

> !! now all I can  see is the generice HTTP request: "GET /  HTTP 1.0".
>
> The HTTP Host header isn't supported by HTTP/1.0.
>

I'm sorry -- yes that is supposed to be HTTP 1.1

>
> Why isn't the proxy copying the appropriate headers from the client?
>

Hmmm.. That was my question.  I've figure that out and would like for some one to
stare at my code and offer some performance pointers...

Thanks...




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

Date: 8 Jul 1999 03:54:25 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Is PERL the way to create a pop-up window ?
Message-Id: <slrn7o882s.hu.efflandt@efflandt.xnet.com>

On Thu, 08 Jul 1999 00:45:29 GMT, James Tolley <jtolley@bellatlantic.net> wrote:
>
>cd156 <cd156@att.net> wrote in message
>news:7m0mse$27o$1@bgtnsc03.worldnet.att.net...
>> I'm wondering if there is a way to have a perl script open a small window
>.
>> I've tried a couple of methods, but not getting positive results.
>
>If your customer base is using IE 3 and 4 exclusively on Win32, I suppose it
>could be done, but you'd have to jump through some hoops. There's got to be
>a better way.

There is a way to do it with frames, but that is MSIE only at this time
(at least a demo told me I couldn't do it and when I clicked on a link to
the floating window demo, Linux Netscape 4.61 itself told me it couldn't
do it).  I can't tell you where to find that demo, but it was the result
of web search for 'frames'.

>> A few webhosting servers produce pop-ups, how the heck are they doing it ?
>
>By this, I think you mean username and password dialogs. If so, this is most
>likely a server authentication issue. HTTP Basic Authentication is what's
>being used. The browser pops up the window, not a script.

No, the original poster was talking about things like popup banner ads on
free websites.  That is JavaScript and any of these subjects should be
referred to a different newsgroup.

-- 
David Efflandt   efflandt@xnet.com   http://www.xnet.com/~efflandt/
http://www.de-srv.com/   http://cgi-help.virtualave.net/


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

Date: 7 Jul 1999 23:18:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Is PERL the way to create a pop-up window ?
Message-Id: <slrn7o89jc.ued.abigail@alexandra.delanet.com>

cd156 (cd156@att.net) wrote on MMCXXXVI September MCMXCIII in
<URL:news:7m0mse$27o$1@bgtnsc03.worldnet.att.net>:
;; I know that most of us are annoyed by pop-up windows, but I have a situation
;; where a pop-up window would be an advantage.

No you don't. You only think you do.

;;                                               Javascript is not the answer

Indeed. Javascript is a problem. All Javascript should be collected
together and send to the red spot on Jupiter, where it belongs.

;; ..
;; 
;; I'm wondering if there is a way to have a perl script open a small window .

Sure there is.

     exec "xterm", "-geometry", "20x5" unless fork;  # ;-)


;; I've tried a couple of methods, but not getting positive results.

What exactly did you try? I'm curious. How would one start trying out
getting small popup windows using Perl? I really want to know.

;; A few webhosting servers produce pop-ups, how the heck are they doing it ?

Did you ask them? Did you look what they send to you?

;; Any ideas, thoughts are appreciated.......

Join the good guys. Don't fuck with the web.



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 7 Jul 1999 23:56:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: My last hope
Message-Id: <slrn7o8brp.ued.abigail@alexandra.delanet.com>

Greg Andrews (gerg@shell.ncal.verio.com) wrote on MMCXXXVI September
MCMXCIII in <URL:news:7m0ipo$77h$1@shell1.ncal.verio.com>:
&& 
&& My guess is that the script asks the browser to create a cookie,
&& and then retrieves the cookie.


Yes, it uses the HTTP header

     Send-Recipe: <value>


where <value> can be "chocolate chip", "classy Europian", "Bakhlava",
"short bread", "ginger", or "oreo". <values> starting with 'x-' are
reserved for private use, and the HTTP specification will never use
a value starting with 'x-'. <values> are case insensitive.

The client must use the Cookie delivery protocol. The first line of
the server response indicates the status:

    100  Continue            //  Send more recipies. Cookie jar isn't full.
    101  Switching Protocols //  I am going to deliver Danish instead.
    200  OK                  //  A cookie jar follows.
    201  Created             //  A cookie jar has been created.
                             //  URI follows in the location header.
    202  Accepted            //  The recipe has been accepted. Cookies will
                             //  be baked later.
    203  Non-Authoritative Information
                             //  We went to the store instead, and we're not
                             //  sure what we got there.
    204  No Content          //  There were still cookies left in the jar.
    205  Reset Content       //  There were still cookies left, and we ate some.
    206  Partial Content     //  You only get some of the cookies.
    300  Multiple Choices    //  We went out of our way and baked a whole lot.
                             //  Tell us what you want.
    301  Moved Permanently   //  We don't bake anymore, and we never will.
                             //  But here's the address of a friend.
    302  Moved Temporarily   //  We're redecorating. Please use the backdoor.
    303  See Other           //  We also make these delicious cookies.
    304  Not Modified        //  We don't bake on Sundays!
    305  Use Proxy           //  We don't deliver to individuals.
    400  Bad Request         //  We couldn't read your handwriting.
    401  Unauthorized        //  Sorry, 18 years and older only.
    402  Payment required    //  We accept credit cards.
    403  Forbidden           //  Yeah, we know what you mean, but not on this
                             //  side of the state line!
    404  Not Found           //  We've never heard of such a recipe.
    405  Method Not Allowed  //  We can't use alcohol.
    406  Not Acceptable      //  Chocolate Chip cookies with fake chocolate?
                             //  Get out of here!
    407  Proxy Authentication Failed
                             //  We've never heard of that vendor.
    408  Request Timeout     //  I'm sorry you have to leave while the cookies
                             //  are still in the oven.
    409  Conflict            //  The recipe says 250F but the oven is on 375F.
    410  Gone                //  We're out of business, and so is everyone else.
    411  Length Required     //  You didn't tell us how many cookies.
    412  Precondition Failed //  You are lying!
    413  Request Entity Too Large
                             //  You talk to much!
    414  Request-URI Too Long//  uri talks too much!
    415  Unsupported Media Type
                             //  We can't read recipies in Word format.
    500  Internal Server Error
                             //  The Perl programmer didn't read the FAQ
    501  Not Implemented     //  We cannot make ginger cookies.
    502  Bad Gateway         //  Our supplier delivered shit.
    503  Service Unavailable //  We're too busy. Come back later.
    504  Gateway Timeout     //  We're awaiting shipment.
    505  Cookie Version Not Supported
                             //  We can't make that grade of quality.



HTH. HANDAHCS!


Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 8 Jul 1999 00:01:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: need module to parse html file
Message-Id: <slrn7o8c3s.ued.abigail@alexandra.delanet.com>

Martien Verbruggen (mgjv@comdyn.com.au) wrote on MMCXXXVI September
MCMXCIII in <URL:news:rbRg3.50$RX3.2848@nsw.nnrp.telstra.net>:
|| In article <7m0en4$oa3$1@nnrp1.deja.com>,
|| 	lmoloch@my-deja.com writes:
|| > does anyone know of a module/function which parses an html file and
|| > stores the results as an array of ordinary words and html tags?
|| 
|| HTML::Parser
|| 
|| It's not the best thing though. Its name is slightly misleading,
|| because this module doesn't really parse HTML, but SGML.


It doesn't really parse either. It makes a vague attempt to tokenize
something that's a subset of HTML, or for that matter, any language
that uses simple <> delimited tags. It does however a better job than
most of the browsers out there.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 8 Jul 1999 04:19:37 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Perl/CGI Combined file upload & e-mail
Message-Id: <slrn7o89i5.hu.efflandt@efflandt.xnet.com>

On Wed, 07 Jul 1999 10:26:50 GMT, ameldridge@gecapital.com
<ameldridge@gecapital.com> wrote:
>Hello to all,
>
>I need to be able to have a HTML form/Perl/CGI script that will enable
>customers to upload a file from their PC & then will automatically send
>me an e-mail inform me of this action (complete with the file details,
>size, name etc..).
>
>I have been able to perform both these tasks separately but I need
>desperately to combine these scripts.
>
>I’m using cgi-lib (kinda hacked around by myself) for the File Upload &
>a mailform script (again hacked about) from Bignosebird.com

Try using CGI.pm.  It is quite easy to pass the file handle to MIME::Lite
as an attachment, although, you may need to install MIME::Lite yourself.
For a script example see http://www.xnet.com/~efflandt/pub/ul_email.pl

>Thanks in advance
>
>Aaron
>
>ameldridge@mado.co.uk
>ameldridge@gecapital.com

-- 
David Efflandt   efflandt@xnet.com   http://www.xnet.com/~efflandt/
http://www.de-srv.com/   http://cgi-help.virtualave.net/


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

Date: Thu, 08 Jul 1999 03:05:22 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: PERLFUNC: shift - remove the first element of an array, and return it
Message-Id: <37838f92.303105377@news.nikoma.de>

On 7 Jul 1999 07:24:53 -0700, Tom Christiansen
<perlfaq-suggestions@perl.com> wrote:

>    `Shift()' and `unshift' do the same thing to the left end of an
>    array that `pop' and `push' do to the right end.

I'd make that shift(). Yes, it's at the beginning of a sentence, but
there's no such function as Shift() in the Perl core, which as what
this looks like to me. In case-sensitive languages such as C and Perl,
keywords for me have a built-in case that can't be overridden, even at
the beginning of a sentence. I'd probably even lowercase it in an
otherwise-uppercase title, as in "HOW TO USE THE shift() FUNCTION" or
similar.

Alternatively, you may want to re-word the sentence so that shift() is
no longer at the beginning.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.net>


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

Date: 8 Jul 1999 04:28:38 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Receiving binaries
Message-Id: <slrn7o8a33.hu.efflandt@efflandt.xnet.com>

On Tue, 6 Jul 1999 23:58:52 +1000, Brendan Reville
<breville@mpce.mq.edu.au> wrote:
>hi all,
>
>this is a little CGI-related but their moderated newsgroup has carked it..

Anybody figure out what happened to *.authoring.cgi? (vacation I guess)

>so hopefully it's still relevant here:
>
>Can I post a reasonable amount of binary data (say a several kilobyte
>graphical image) through a form via CGI to a Perl script?  Or is this too
>much data?

CGI.pm uses a tmp files for uploaded files, so you are only limited by
disk space or quota.

-- 
David Efflandt   efflandt@xnet.com   http://www.xnet.com/~efflandt/
http://www.de-srv.com/   http://cgi-help.virtualave.net/


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

Date: 07 Jul 1999 23:56:23 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: s/// Bug/bad syntax?? (WAS:$scalars in s/// not working - anyone have any ideas?)
Message-Id: <x7k8sbu74o.fsf@home.sysarch.com>

>>>>> "JS" == Jonathan Stowe <gellyfish@gellyfish.com> writes:

  JS> On 06 Jul 1999 23:19:28 -0400 Uri Guttman wrote:

  >> no need for that brace since there should be no if block.

  JS> I think that judgement might be a little harsh as there are may be many
  JS> reasons why simply die()ing might not be the best thing to do - he might
  JS> want to print a more informative message, cleanup, try to fix the reason
  JS> the open failed if possible or simply switch to plan B: the important
  JS> thing is not carrying on regardless when the open() fails.  Of course
  JS> one could implement a __DIE__ handler but that does throw you out of
  JS> the usual flow of control.

given the code shown, it makes sense. the poster emailed his thanx to
me. in any case i find extra levels of indent annoying and i strive to
remove them. i usually make the open failure the primary branch of
unless if i don't just die. then the code maybe creates the file or does
something useful like return. then the code can flow without the extra
indents.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 07 Jul 1999 23:58:41 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Webpages and Perl-Couple of Questions
Message-Id: <x7hfnfu70t.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> Uri Guttman (uri@sysarch.com) wrote on MMCXXXVI September MCMXCIII in
  A> <URL:news:x7pv24tklc.fsf@home.sysarch.com>:
  A> '' >>>>> "A" == Abigail  <abigail@delanet.com> writes:
  A> '' 
  A> ''   A> BTDTDNGTTS.
  A> '' 
  A> '' ok, i give up. what does that mean? i think it starts with "but that
  A> '' doesn't". 


  A> Been There, Done That, Did Not Get The T-Shirt.

well, i don't think i have ever seen that exact full phrase before so
the abbrev. was totally out of the blue. is it a common term like
TIMTOWTDI?

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

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


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