[19042] in Perl-Users-Digest
Perl-Users Digest, Issue: 1237 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 3 14:10:38 2001
Date: Tue, 3 Jul 2001 11:10:15 -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: <994183815-v10-i1237@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 3 Jul 2001 Volume: 10 Number: 1237
Today's topics:
mailto module? (Leora Wenger)
Re: mailto module? <yanoff@yahoo.com>
Re: mailto module? <leorawenger@yahoo.com>
Re: mailto module? <flavell@mail.cern.ch>
Re: mailto module? <tony_curtis32@yahoo.com>
map/hash question, functional style (Zeljko Vrba)
Re: map/hash question, functional style (Anno Siegel)
Re: map/hash question, functional style (Tad McClellan)
Re: map/hash question, functional style <tony_curtis32@yahoo.com>
Re: map/hash question, functional style <godzilla@stomp.stomp.tokyo>
Re: map/hash question, functional style <ren@tivoli.com>
Re: map/hash question, functional style nobull@mail.com
Module to read binary pgm files <andrew@mvt.ie>
Newbie - how to automatically retrieve job postings fro <dgriffis@home.com>
Re: Newbie - how to automatically retrieve job postings (Brian Pontz)
Re: Newbie - how to automatically retrieve job postings (Tad McClellan)
Odd scalar equality problem (Vassilis Rigas)
Re: Odd scalar equality problem <tom.melly@ccl.com>
Re: Odd scalar equality problem (Tad McClellan)
Re: Odd scalar equality problem <ren@tivoli.com>
Perl Script to Remove Email Attachment <adsouza@globix.com>
Time function needed for cgi script <hunterda@nortelnetworks.com>
Re: Time function needed for cgi script <ab496@chebucto.ns.ca>
Re: Time function needed for cgi script nobull@mail.com
To Mac OS hackers! <Ann_Nancroft@excite.com>
Re: web fetching (Jay Tilton)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Jul 2001 07:47:37 -0700
From: info@leoraw.com (Leora Wenger)
Subject: mailto module?
Message-Id: <5300fab7.0107030647.1c1baea8@posting.google.com>
I would like to have the user's mailer come up, as it does with the
HTML <A HREF="mailto:soandso@domain.com"> and insert a text file in
the body of the message. I don't want it to actually send the mail,
as it does with sendmail. That way the user can edit the body or add
addresses as they desire. Is there a module for doing this?
Thanks,
Leora
------------------------------
Date: Tue, 03 Jul 2001 09:56:43 -0500
From: Scott Yanoff <yanoff@yahoo.com>
To: Leora Wenger <info@leoraw.com>
Subject: Re: mailto module?
Message-Id: <3B41DD2B.AC9B8475@yahoo.com>
Leora Wenger wrote:
>
> I would like to have the user's mailer come up, as it does with the
> HTML <A HREF="mailto:soandso@domain.com"> and insert a text file in
> the body of the message. I don't want it to actually send the mail,
> as it does with sendmail. That way the user can edit the body or add
> addresses as they desire. Is there a module for doing this?
This will not work in all web browsers but it might be worth trying:
mailto:info@leoraw?body=This is a test
Whatever appears after the "body" tag will appear in the email message.
I've tested this in Netscape 4.7.
Good luck,
--
-Scott
yanoff@yahoo.com | http://www.yanoff.org | AOL IM: SAY KJY
------------------------------
Date: Tue, 03 Jul 2001 15:33:47 GMT
From: "Leora Wenger" <leorawenger@yahoo.com>
Subject: Re: mailto module?
Message-Id: <vBl07.21168$C81.1686124@bgtnsc04-news.ops.worldnet.att.net>
Scott Yanoff <yanoff@yahoo.com> wrote in message
news:3B41DD2B.AC9B8475@yahoo.com...
>
> This will not work in all web browsers but it might be worth trying:
>
> mailto:info@leoraw?body=This is a test
I haven't tried this yet because I've read it doesn't work in all browsers
(and most of the people using this will be using IE).
- Leora
------------------------------
Date: Tue, 3 Jul 2001 17:24:43 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: mailto module?
Message-Id: <Pine.LNX.4.30.0107031712510.12757-100000@lxplus003.cern.ch>
On Jul 3, Scott Yanoff delicately chiselled into the ether:
> This will not work in all web browsers but it might be worth trying:
>
> mailto:info@leoraw?body=This is a test
Don't you know that this is a Perl language group? We don't have to
put ourselves at risk of something that "will not work in all web
browsers".
> Whatever appears after the "body" tag will appear in the email message.
(Or maybe prevent the link from working at all)
> I've tested this in Netscape 4.7.
Bully for you, but I bet you didn't try all possible configuration
settings for defining an external mail client.
> Good luck,
You'd need it. Or rather, your users would. And that's the key. If
you put the machinery under your own control (e.g in a Perl script
invoked via CGI or similar mechanisms), you can test it, and be sure
it's working: if you send the machinery out to your users, you can
never be quite sure if it's going to work for all of them. And that
one, in spite of it appearing in a standards-track RFC, is known to
fail in various ways in quite a number of situations.
------------------------------
Date: 03 Jul 2001 11:52:02 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: mailto module?
Message-Id: <87n16mc5vx.fsf@limey.hpcc.uh.edu>
>> On Tue, 03 Jul 2001 15:33:47 GMT,
>> "Leora Wenger" <leorawenger@yahoo.com> said:
> Scott Yanoff <yanoff@yahoo.com> wrote in message
> news:3B41DD2B.AC9B8475@yahoo.com...
>> This will not work in all web browsers but it might be
>> worth trying:
>>
>> mailto:info@leoraw?body=This is a test
> I haven't tried this yet because I've read it doesn't
> work in all browsers (and most of the people using this
> will be using IE).
And has nothing to do with perl anyway...
t
--
Somebody light this monkey. AAAAGGGHHHH!! Bad monkey!
------------------------------
Date: 3 Jul 2001 15:22:27 GMT
From: mordor@fly.srk.fer.hr (Zeljko Vrba)
Subject: map/hash question, functional style
Message-Id: <slrn9k3opj.dks.mordor@fly.srk.fer.hr>
I have a list of hash keys in a variable like this:
@keys = qw(key1 key2 key3);
and a list of values:
@vals = (1, 2, 3);
Now, what is the most elegant way to make a hash from this? I'd prefer using
map and not foreach if at all possible. This is my current code:
$i = 0;
%hash = map { $keys[$i++] => $_ } @vals;
Is there a way to avoid global counter?
Also, except map and grep, what other functional programming constructs are
present in perl? Can map and grep be generalized to iterate over more than
one array?
------------------------------
Date: 3 Jul 2001 16:31:03 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: map/hash question, functional style
Message-Id: <9hss07$2c6$1@mamenchi.zrz.TU-Berlin.DE>
According to Zeljko Vrba <mordor@fly.srk.fer.hr>:
> I have a list of hash keys in a variable like this:
> @keys = qw(key1 key2 key3);
>
> and a list of values:
> @vals = (1, 2, 3);
>
> Now, what is the most elegant way to make a hash from this?
The standard method in this situation is
@hash{ @keys} = @vals;
This uses a hash slice as an lvalue to assign all the values in one
statement.
> map and not foreach if at all possible. This is my current code:
>
> $i = 0;
> %hash = map { $keys[$i++] => $_ } @vals;
>
> Is there a way to avoid global counter?
Sure,
%hash = map { shift @keys => $_ } @vals;
but the simple assignment above would still be preferable.
> Also, except map and grep, what other functional programming constructs are
> present in perl?
Well, what *is* a functional programming construct? sort() is another
function that takes code for an argument. So does (block-) eval(), but
is it functional programming?
Note that you can write functions of this type yourself. With prototyping
you can (sometimes) give them cool syntax.
> Can map and grep be generalized to iterate over more than
> one array?
Well it can be generalized, as other languages show, but perl doesn't
have these constructs. It is often possible to weave another array
into the code of a one-list map so that the arrays are worked in
parallel. See above for an example.
If you want, you can write something like map2 yourself, basically
wrapping the map example into a sub:
sub map2 (&\@\@) {
my ( $func, $list1, $list2) = @_;
map $func->( shift @$list1, $_), @$list2;
}
The hash-constructing map could then be written
%hash = map2 { @_} @keys, @vals;
In a context where it is used often and more variously, map2 could
even be useful.
Anno
------------------------------
Date: Tue, 3 Jul 2001 12:14:33 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: map/hash question, functional style
Message-Id: <slrn9k3rr9.an5.tadmc@tadmc26.august.net>
Zeljko Vrba <mordor@fly.srk.fer.hr> wrote:
[snip "wants a hash slice"]
>Can map and grep be generalized to iterate over more than
>one array?
map and grep do not iterate over even a single array.
They iterate over lists. The list may be composed entirely of
elements taken from an array (as in your examples), or an
array can merely contribute some of the elements in the list:
grep {...} 'SpecialFlag', @flags, split( ' ', $GLOBALFLAGS);
Often the distinction between "array" and "list" does not matter
as Perl DWIMs for you. But sometimes (like here) it _does_ make
a difference. Perl FAQ, part 4:
"What is the difference between a list and an array?"
So one answer to your question is:
Yes, it can be generalized to have more than a single array
in the list:
grep {...} @array1, @array2;
but maybe that isn't what you want. Another answer might be:
Yes, it can be generalized to use a list of references to arrays:
grep {...} \@array1, \@array2;
which may be more like what you need, though what you need is
not entirely clear (because of the very "array vs. list" thing).
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 03 Jul 2001 12:14:23 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: map/hash question, functional style
Message-Id: <87ithac4uo.fsf@limey.hpcc.uh.edu>
>> On 3 Jul 2001 15:22:27 GMT,
>> mordor@fly.srk.fer.hr (Zeljko Vrba) said:
> I have a list of hash keys in a variable like this:
> @keys = qw(key1 key2 key3);
> and a list of values:
> @vals = (1, 2, 3);
> Now, what is the most elegant way to make a hash from
> this?
@keys = qw(key1 key2 key3);
@vals = (1, 2, 3);
@hash{@keys} = @vals;
use Data::Dumper;
print Dumper(\%hash);
$VAR1 = {
'key1' => 1,
'key2' => 2,
'key3' => 3
};
> Also, except map and grep, what other functional
> programming constructs are present in perl? Can map and
> grep be generalized to iterate over more than one array?
There's an overview of perl's lineage here, which might
have some pointers (pointers in an FP language, ho ho):
http://history.perl.org/PerlTimeline.html
hth
t
--
Somebody light this monkey. AAAAGGGHHHH!! Bad monkey!
------------------------------
Date: Tue, 03 Jul 2001 10:17:23 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: map/hash question, functional style
Message-Id: <3B41FE23.228E16CE@stomp.stomp.tokyo>
Zeljko Vrba wrote:
> I have a list of hash keys in a variable like this:
> @keys = qw(key1 key2 key3);
> and a list of values:
> @vals = (1, 2, 3);
> Now, what is the most elegant way to make a hash from this? I'd prefer using
> map and not foreach if at all possible. This is my current code:
(snipped code)
You will discover use of a simple while loop to be
quite quick and efficient compared to your current
map method and, most likely, all map methods.
A presumption is made array @keys and array @vals contain
an equal number of elements or, array @keys contains less
elements than array @vals. This is a destructive method
so caution is to be exercised to protect the original
arrays if this is needed.
Godzilla!
--
TEST SCRIPT:
____________
#!perl
@keys = qw(key1 key2 key3);
@vals = (1, 2, 3);
while (@keys)
{ $new{shift (@keys)} = shift (@vals); }
print "@{[ %new ]}";
exit;
PRINTED RESULTS:
________________
key1 1 key2 2 key3 3
BENCHMARK RESULTS:
__________________
#!perl
print "Content-type: text/plain\n\n";
use Benchmark;
print "Run One:\n\n";
&Time;
print "\n\nRun Two:\n\n";
&Time;
print "\n\nRun Three:\n\n";
&Time;
sub Time
{
timethese (100000,
{
'name1' =>
'@keys = qw(key1 key2 key3);
@vals = (1, 2, 3);
$i = 0;
%hash = map { $keys[$i++] => $_ } @vals;',
'name2' =>
'@keys = qw(key1 key2 key3);
@vals = (1, 2, 3);
while (@keys)
{ $new{shift (@keys)} = shift (@vals); }',
} );
}
exit;
PRINTED RESULTS:
_________________
Benchmark: timing 100000 iterations of name1, name2...
name1: 2 wallclock secs ( 3.73 usr + 0.00 sys = 3.73 CPU) @ 26809.65/s
name2: 2 wallclock secs ( 1.92 usr + 0.00 sys = 1.92 CPU) @ 52083.33/s
Run Two:
Benchmark: timing 100000 iterations of name1, name2...
name1: 3 wallclock secs ( 3.52 usr + 0.00 sys = 3.52 CPU) @ 28409.09/s
name2: 2 wallclock secs ( 1.92 usr + 0.00 sys = 1.92 CPU) @ 52083.33/s
Run Three:
Benchmark: timing 100000 iterations of name1, name2...
name1: 2 wallclock secs ( 3.57 usr + 0.00 sys = 3.57 CPU) @ 28011.20/s
name2: 2 wallclock secs ( 1.87 usr + 0.00 sys = 1.87 CPU) @ 53475.94/s
------------------------------
Date: 03 Jul 2001 10:48:08 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: map/hash question, functional style
Message-Id: <m37kxqnhdz.fsf@dhcp9-173.support.tivoli.com>
On 3 Jul 2001, mordor@fly.srk.fer.hr wrote:
> I have a list of hash keys in a variable like this:
> @keys = qw(key1 key2 key3);
>
> and a list of values:
> @vals = (1, 2, 3);
>
> Now, what is the most elegant way to make a hash from this? I'd
> prefer using map and not foreach if at all possible. This is my
> current code:
@hash{@keys} = @vals;
> $i = 0;
> %hash = map { $keys[$i++] => $_ } @vals;
>
> Is there a way to avoid global counter?
Well, if you really wanted to loop, you *could* loop over the indices:
$hash{$keys[$_]} = $vals[$_] for 0..$#keys;
(You could use map the same way, but there's really no point.)
> Also, except map and grep, what other functional programming
> constructs are present in perl? Can map and grep be generalized to
> iterate over more than one array?
Both map and grep work on lists, not arrays. In list context, an
array produces a list of its elements. There is no reason that
multiple arrays cannot be used in that way:
map { $_ *= 2 }, @ary1, @ary2, @ary3;
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 03 Jul 2001 18:24:40 +0100
From: nobull@mail.com
Subject: Re: map/hash question, functional style
Message-Id: <u98zi6sz6v.fsf@wcl-l.bham.ac.uk>
mordor@fly.srk.fer.hr (Zeljko Vrba) writes:
> I have a list of hash keys in a variable like this:
> @keys = qw(key1 key2 key3);
>
> and a list of values:
> @vals = (1, 2, 3);
>
> Now, what is the most elegant way to make a hash from this? I'd prefer using
> map and not foreach if at all possible. This is my current code:
>
> $i = 0;
> %hash = map { $keys[$i++] => $_ } @vals;
>
> Is there a way to avoid global counter?
Slice:
@hash=();
@hash{@keys}=@vals;
> Also, except map and grep, what other functional programming constructs are
> present in perl?
None built-in - you can of course add more.
> Can map and grep be generalized to iterate over more than
> one array?
Not the built-in ones - you can of course add more.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 3 Jul 2001 16:13:56 +0100
From: "Andrew" <andrew@mvt.ie>
Subject: Module to read binary pgm files
Message-Id: <9hsng4$9gn$1@kermit.esat.net>
Sorry for re-posting this question - I posted it a week or so ago, but got
sent away to somewhere with no news access and missed any replies that there
may have been.
Basically I'm looking for a way to read a binary pgm file so that I can do
some processing on it. I have checked CPAN and found references to
Image::Magick and Image::Imlib2. I was unable to access any of the files or
documentation for Image::Magick, and Image::Imlib2 seems like it's intended
for Unix (I'm using WinNT).
I'd be grateful for any pointers on how to do what I'm looking to do.
Thanks,
Andrew
------------------------------
Date: Tue, 03 Jul 2001 17:26:25 GMT
From: "David Griffis" <dgriffis@home.com>
Subject: Newbie - how to automatically retrieve job postings from web
Message-Id: <5fn07.148698$%i7.100424911@news1.rdc1.sfba.home.com>
RE: Newbie - how to automatically retrieve job postings from web
I want to be able to automatically call a web-page, fill out a search form,
and retrieve and data from that web-page.
That way I can store job postings in a database and eventually find a job.
THanks, -david
------------------------------
Date: Tue, 03 Jul 2001 17:48:54 GMT
From: pontz@NO_SPAMchannel1.com (Brian Pontz)
Subject: Re: Newbie - how to automatically retrieve job postings from web
Message-Id: <3b420518.215153930@news.ne.mediaone.net>
>I want to be able to automatically call a web-page, fill out a search form,
>and retrieve and data from that web-page.
Sounds like a job for LWP and HTML::Parser
Brian
------------------------------
Date: Tue, 3 Jul 2001 13:08:18 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbie - how to automatically retrieve job postings from web
Message-Id: <slrn9k3v02.aqs.tadmc@tadmc26.august.net>
David Griffis <dgriffis@home.com> wrote:
>
>I want to be able to automatically call a web-page, fill out a search form,
>and retrieve and data from that web-page.
use LWP::UserAgent;
the LWP module is part of the libwww bundle on CPAN:
http://search.cpan.org/search?mode=dist&query=libwww
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 3 Jul 2001 06:53:44 -0700
From: vrigas@hotmail.com (Vassilis Rigas)
Subject: Odd scalar equality problem
Message-Id: <70623463.0107030553.6b00e5c0@posting.google.com>
Ok thats the problem:
I read a file and I have to compare every line with a string posted
from a html form.
I get the forms value in an index (@value).
the $value[0] scalar is the name of file I 'd like to check and
edit...
the $value[1] scalar is the line I need to match...
That is the code:
open (READFILE,">$value[0]");
@lines=<READFILE>;
close READFILE;
open (EDITFILE,">$value[0]");
foreach $line (@lines){
if ($line eq $value[1]) #### well it won't match :(
{
do stuf...
}
print EDITFILE $line ;
}
close EDITFILE ;
I wonder if I m doing something wrong.
When I print the value[1] in the result page, it comes with the write
value.
If I change the:
if ($line eq $value[1])
with
if ($line eq "a real line")
everything works fine.
if I put a line like this:
$value[1]="a real line";
it also works fine
I m out of ideas... any clue?
TIA
------------------------------
Date: Tue, 3 Jul 2001 15:31:00 +0100
From: "Tom Melly" <tom.melly@ccl.com>
Subject: Re: Odd scalar equality problem
Message-Id: <3b41d724$0$3764$ed9e5944@reading.news.pipex.net>
"Vassilis Rigas" <vrigas@hotmail.com> wrote in message
news:70623463.0107030553.6b00e5c0@posting.google.com...
<snip>
Hmm, I'd try chomping @lines and $value[1]....
------------------------------
Date: Tue, 3 Jul 2001 09:50:34 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Odd scalar equality problem
Message-Id: <slrn9k3jda.abh.tadmc@tadmc26.august.net>
Vassilis Rigas <vrigas@hotmail.com> wrote:
>
>I read a file and I have to compare every line with a string posted
>from a html form.
>
>I get the forms value in an index (@value).
>the $value[0] scalar is the name of file I 'd like to check and
>edit...
>the $value[1] scalar is the line I need to match...
>
>That is the code:
>
>open (READFILE,">$value[0]");
^^^^ ^
You have opened the READFILE for *writing*!
You should always, yes *always*, check the return value from open():
open (READFILE, $value[0]) or die "could not open '$value[0]' $!";
>@lines=<READFILE>;
chomp @lines; # this should fix your problem
>close READFILE;
>
>open (EDITFILE,">$value[0]");
open (EDITFILE,">$value[0]") or die "could not open '$value[0]' $!";
>foreach $line (@lines){
foreach my $line (@lines){
You really really should pay attention to limiting the scope
of variables...
>if ($line eq $value[1]) #### well it won't match :(
Does $value[1] end with a newline character?
Have you tried printing out the 2 values to see if the _look_
like they are in fact equal?
warn "line '$line'\n";
warn "value[1] '$value[1]'\n";
>I wonder if I m doing something wrong.
I hope you are not wondering any longer :-)
>When I print the value[1] in the result page, it comes with the write
>value.
>
>If I change the:
>if ($line eq $value[1])
>with
>if ($line eq "a real line")
^^^^^^^^^^^
That is not a "line".
"lines" end with a newline character (or some line-ending sequence of
chars anyway), that is pretty much the definition of a line.
>I m out of ideas... any clue?
perldoc -f chomp
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 03 Jul 2001 09:11:35 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Odd scalar equality problem
Message-Id: <m3g0cenluw.fsf@dhcp9-173.support.tivoli.com>
On 3 Jul 2001, vrigas@hotmail.com wrote:
> Ok thats the problem:
>
> I read a file and I have to compare every line with a string posted
> from a html form.
>
> I get the forms value in an index (@value).
> the $value[0] scalar is the name of file I 'd like to check and
> edit...
> the $value[1] scalar is the line I need to match...
>
> That is the code:
>
> open (READFILE,">$value[0]");
I assume that ">" is a typo, but you really, really should always
check the success of open:
open READFILE, "<", $value[0] or die "Could not read $value[0], $!\n";
> @lines=<READFILE>;
> close READFILE;
>
> open (EDITFILE,">$value[0]");
open EDITFILE, ">", $value[0] or die "Could not create $value[0], $!\n";
> foreach $line (@lines){
> if ($line eq $value[1]) #### well it won't match :(
Well, $line has a line ending on it. One of "\n", "\r", "\r\n",
depending on how and where the file was generated. The normal
solution is to use chomp(), unless the file is from a foreign system.
> {
> do stuf...
> }
> print EDITFILE $line ;
> }
> close EDITFILE ;
>
> I wonder if I m doing something wrong. When I print the value[1] in
> the result page, it comes with the write value.
>
> If I change the:
> if ($line eq $value[1])
> with
> if ($line eq "a real line")
> everything works fine.
Really? Well that implies that you are removing the line ending from
$line, either with chomp() or some other mechanism. Otherwise, it
wouldn't match "a real line". So how is $value[1] being initialized?
Perhaps it has a line ending.
> if I put a line like this:
> $value[1]="a real line";
> it also works fine
Yeah, that pretty much clenches it. $value[1] almost certainly has a
line ending, or possibly some other special character.
> I m out of ideas... any clue?
Well, you could check the value of $value[1] with something like:
printf "%3d [$_]\n", ord for $value[1] =~ /./gs;
If $value[1] has a "\r\n" at the end, you'll get:
97 [a]
32 [ ]
114 [r]
101 [e]
97 [a]
108 [l]
32 [ ]
108 [l]
105 [i]
110 [n]
101 [e]
]13 [
10 [
]
HTH...
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Tue, 3 Jul 2001 13:16:05 -0400
From: "Anthony" <adsouza@globix.com>
Subject: Perl Script to Remove Email Attachment
Message-Id: <c0n07.7$pc3.8560@news.nyc.globix.net>
Hello,
I am writing a perl script, that will need to remove an attachement if it
meets certain criteria (amongst a lot of other things). The script is
finished except for the part to remove an attachement.
I want to script to, if the email contains an attachment called WINMAIL.DAT
to delete that attachment from the email, however, if they are any other
attachments to keep them.
I have tried using MIME-tools but have run into a truck load of problems and
can;t seem to figure it out.
I am passing the email into my script via
my @MESSAGE = <STDIN>;
Does anybody know how to do this? anybody have an example script? Please
Help! Thanks!
Anthony
------------------------------
Date: Tue, 3 Jul 2001 12:46:16 -0400
From: "dh" <hunterda@nortelnetworks.com>
Subject: Time function needed for cgi script
Message-Id: <9hst84$jhn$1@bcarh8ab.ca.nortel.com>
I have a page online where users generate a report from a Perl script based
on submitted information. The report takes upwards of 15 minutes to complete
from the command line in Unix. Because of this, the online version times out
after
about 4 minutes because of the parents' page inactivity.
What I need is a Perl/CGI/Java/JavaScript function to open another webpage
that says
something like "Please wait" so that the web page is receiving activity.
This is display well on the www.expedia.ca site when you search for flight
information. You make all your flight criteria, then hit search and a page
comes up and says "Please wait" and the web page will not time out because
there is client server activity.
Can anyone point me in the right direction here ? I took a look at the
source code on expedia.ca and they use a JavaScript function, but it's so
cryptic they have made it difficult to read.
TIA,
dave
------------------------------
Date: Tue, 3 Jul 2001 14:21:15 -0300
From: "Daniel A. Johnson" <ab496@chebucto.ns.ca>
To: dh <hunterda@nortelnetworks.com>
Subject: Re: Time function needed for cgi script
Message-Id: <Pine.GSO.3.95.iB1.0.1010703141850.8514A-100000@halifax.chebucto.ns.ca>
Hi Dave,
I think npf files (non-parsed header files) may be what you are after.
Such a cgi will display output 'on the fly' not waiting for the process to
terminate. You should be able to have the script print "Please wait" and
then go on to do the long processing.
- Dan
----------------------------------------------------------------------------
email : booner@tkc.bilby.com
Home Page : http://tkc.bilby.com/~booner/
-----------------------------------------------------------------------------
On Tue, 3 Jul 2001, dh wrote:
> I have a page online where users generate a report from a Perl script based
> on submitted information. The report takes upwards of 15 minutes to complete
> from the command line in Unix. Because of this, the online version times out
> after
> about 4 minutes because of the parents' page inactivity.
>
> What I need is a Perl/CGI/Java/JavaScript function to open another webpage
> that says
> something like "Please wait" so that the web page is receiving activity.
> This is display well on the www.expedia.ca site when you search for flight
> information. You make all your flight criteria, then hit search and a page
> comes up and says "Please wait" and the web page will not time out because
> there is client server activity.
>
> Can anyone point me in the right direction here ? I took a look at the
> source code on expedia.ca and they use a JavaScript function, but it's so
> cryptic they have made it difficult to read.
>
> TIA,
>
> dave
>
>
>
>
------------------------------
Date: 03 Jul 2001 18:31:04 +0100
From: nobull@mail.com
Subject: Re: Time function needed for cgi script
Message-Id: <u966d9udgn.fsf@wcl-l.bham.ac.uk>
"dh" <hunterda@nortelnetworks.com> writes:
> I have a page online where users generate a report from a Perl script based
> on submitted information. The report takes upwards of 15 minutes to complete
> from the command line in Unix. Because of this, the online version times out
> after
> about 4 minutes because of the parents' page inactivity.
Simply give the user a URL that they can check periodically to see if
the report is ready. You can put an automatic refresh on if you like.
This has nothing to do with Perl.
> What I need is a Perl/CGI/Java/JavaScript function to open another webpage
> that says
> something like "Please wait" so that the web page is receiving
> activity.
This has been discussed a few times recentlu. Please look for recent
articles countaining the keywards "Please wait". Look particularly in
newsgroups what deal with web programming in general as this has
little to do with the choice of language.
> This is display well on the www.expedia.ca site when you search for flight
> information. You make all your flight criteria, then hit search and a page
> comes up and says "Please wait" and the web page will not time out because
> there is client server activity.
> Can anyone point me in the right direction here ? I took a look at the
> source code on expedia.ca and they use a JavaScript function, but it's so
> cryptic they have made it difficult to read.
This is a Perl newsgroup.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 3 Jul 2001 16:40:49 +0200
From: "Ann Bancroft" <Ann_Nancroft@excite.com>
Subject: To Mac OS hackers!
Message-Id: <9hsl81$m9q$1@flis.man.torun.pl>
Hi!
I have to call some perl scripts from an application written in C
[CodeWarrior] under Mac OS.
How to handle this?
Please, help me!
Ann
------------------------------
Date: Tue, 03 Jul 2001 17:58:05 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: web fetching
Message-Id: <3b42077a.35729717@news.erols.com>
On 3 Jul 2001 02:06:16 -0700, njcops2@hotmail.com (Mark) wrote:
>Hi,
>
>Does anyone know of any other web fetching CGI script other than
>PageRipper
>http://pageripper.cjb.net
>
>If not, can you tell me if it's worth the 10 bucks or not?
A less scrupulous person could just take it. The download URL is neither
well obscured nor well secured.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1237
***************************************