[24445] in Perl-Users-Digest
Perl-Users Digest, Issue: 6628 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 30 14:05:51 2004
Date: Sun, 30 May 2004 11:05:06 -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 Sun, 30 May 2004 Volume: 10 Number: 6628
Today's topics:
Re: Array in a hash question? <tadmc@augustmail.com>
Re: Effective perl function to remove one element from <uri@stemsystems.com>
Re: how to make the page not available in perl when cli <ebohlman@omsdev.com>
Re: how to make the page not available in perl when cli (Walter Roberson)
Re: how to make the page not available in perl when cli <spamtrap@dot-app.org>
Re: how to make the page not available in perl when cli <darick_ang@yahoo.com.sg>
Re: how to make the page not available in perl when cli (Walter Roberson)
Re: Hybrid Module Question <tassilo.parseval@rwth-aachen.de>
Re: Login to MS Exchange to send e-mail <ywwong_hk@hotmail.com>
Re: Newbie question: PERL proxies... <Juha.Laiho@iki.fi>
Re: On "for (@foo)" <dha@panix2.panix.com>
Re: Print a formatted array (Anno Siegel)
Problems with keep-alive connections <reply@newsgroup.invalid>
Sendmail Options? <gary@tgpmakers.com>
Re: Sendmail Options? (Walter Roberson)
Re: Sendmail Options? <noreply@gunnar.cc>
Re: Sendmail Options? <me@privacy.net>
Re: Sendmail Options? <gary@tgpmakers.com>
Re: Sendmail Options? <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Sendmail Options? <Juha.Laiho@iki.fi>
Re: strange behavior <perl@my-header.org>
Re: strange behavior <wherrera@lynxview.com>
Re: Two quick questions about Perl6 <bik.mido@tiscalinet.it>
Re: Two quick questions about Perl6 <uri@stemsystems.com>
Re: Why is this upload script not working <usenet@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 30 May 2004 07:35:13 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Array in a hash question?
Message-Id: <slrncbjl81.8hq.tadmc@magna.augustmail.com>
Jamie Smyth <jamiesmyth_uni@yahoo.ca> wrote:
> I have a hash defined as,
>
> my %data = (
> 'wn_l' => $wn_l, 'wn_u' => $wn_u, 'wn_d' => $wn_d,
> 'npts' => $#spc+1, 'spc' => [@spc], 'label' => $label,
> );
>
> and I would like to extract the data in the @spc array.
Apply "Use Rule 1" from:
perldoc perlreftut
1) pretend is is a plain array
my @spc = @data;
2) replace the _name_ with a block ...
my @spc = @{ };
3) ... that returns a reference to an array
my @spc = @{ $data{spc} };
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 30 May 2004 07:23:30 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Effective perl function to remove one element from array?
Message-Id: <x7k6yu9y4u.fsf@mail.sysarch.com>
>>>>> "JB" == John Bokma <postmaster@castleamber.com> writes:
JB> Uri Guttman wrote:
>> and perl will grow the hash as needed to keep it efficient. one of the
>> nice little behind the scenes things. true it is not exactly O(1) but
JB> The fun part behind the big O notation is that O(k) for k << n, is
JB> still O(1). So "not exactly O(1)" does not exists.
well, it does in a way. extending hashes and handling dense ones will
cause the behaviour to be mostly O(1) with a touch of O(N) in it. you
have to factor in the cost of extending the hash. so it is some other
O() function thing which is between 1 and N. i am not about to calculate
it. it is not constant as the size of the hash does affect things. but
the effect is not just linear with N. but saying it is close to O(1) is
fine for practical uses.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 30 May 2004 11:06:49 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: how to make the page not available in perl when click Back button
Message-Id: <Xns94F93EDF985E1ebohlmanomsdevcom@130.133.1.4>
Darick <darick_ang@yahoo.com.sg> wrote in
news:aosib0tpd8vqp9dna3fni33pasqbrd5gat@4ax.com:
> when i try to click back button in some website, the website will show
> the message in the following :-
>
> ---- start
> Warning: Page has Expired The page you requested was created using
> information you submitted in a form. This page is no longer available.
> As a security precaution, Internet Explorer does not automatically
> resubmit your information for you.
>
> To resubmit your information and view this Web page, click the Refresh
> button.
> ---- end
>
> may i know how to do this effect in perl ?
You don't. It's all client-side. Most browsers will complain if you try
to reload a page that was returned as the result of a form submission using
the POST method. That's because the relevant recommendations assert that
POST requests are not to be regarded as idempotent, which is to say that
the result of submitting multiple POST requests is, in general, quite
different from the result of submitting a single request.
The reference to "Internet Explorer" in the message you saw should really
clue you in that it came from the browser itself, not the server on the
other end.
------------------------------
Date: 30 May 2004 14:19:56 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: how to make the page not available in perl when click Back button
Message-Id: <c9cqic$dja$1@canopus.cc.umanitoba.ca>
In article <Xns94F93EDF985E1ebohlmanomsdevcom@130.133.1.4>,
Eric Bohlman <ebohlman@omsdev.com> wrote:
:Darick <darick_ang@yahoo.com.sg> wrote in
:news:aosib0tpd8vqp9dna3fni33pasqbrd5gat@4ax.com:
:> when i try to click back button in some website, the website will show
:> the message in the following :-
:> Warning: Page has Expired The page you requested was created using
:> may i know how to do this effect in perl ?
:You don't. It's all client-side. Most browsers will complain if you try
:to reload a page that was returned as the result of a form submission using
:the POST method.
True, but it is also possible to cause this effect for non-form
pages, by sending an appropriate 'expires' header.
--
When your posts are all alone / and a user's on the phone/
there's one place to check -- / Upstream!
When you're in a hurry / and propagation is a worry/
there's a place you can post -- / Upstream!
------------------------------
Date: Sun, 30 May 2004 10:40:58 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: how to make the page not available in perl when click Back button
Message-Id: <vZWdnToHeKDhbyTdRVn-tA@adelphia.com>
Darick wrote:
> the message in the following :-
>
> ---- start
> Warning: Page has Expired
> may i know how to do this effect in perl ?
An expiration date can be included in the HTTP response. LWP gives you
access to all the HTTP headers in the response it receives, so all you need
to do is look for an expiration date, and if one is included compare it
against the current date.
You didn't say what GUI toolkit you're using to write your browser, so I'm
afraid I can't help you display the warning dialog. Sorry!
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Mon, 31 May 2004 01:00:28 +0800
From: Darick <darick_ang@yahoo.com.sg>
Subject: Re: how to make the page not available in perl when click Back button
Message-Id: <fo4kb094l0oe7p8074m0c6nkhruhpje8v6@4ax.com>
On 30 May 2004 14:19:56 GMT, roberson@ibd.nrc-cnrc.gc.ca (Walter
Roberson) wrote:
>In article <Xns94F93EDF985E1ebohlmanomsdevcom@130.133.1.4>,
>Eric Bohlman <ebohlman@omsdev.com> wrote:
>:Darick <darick_ang@yahoo.com.sg> wrote in
>:news:aosib0tpd8vqp9dna3fni33pasqbrd5gat@4ax.com:
>
>:> when i try to click back button in some website, the website will show
>:> the message in the following :-
>
>
>:> Warning: Page has Expired The page you requested was created using
>
>:> may i know how to do this effect in perl ?
>
>:You don't. It's all client-side. Most browsers will complain if you try
>:to reload a page that was returned as the result of a form submission using
>:the POST method.
>
>True, but it is also possible to cause this effect for non-form
>pages, by sending an appropriate 'expires' header.
may i know how to send an 'expires' header ? could u show me ?
------------------------------
Date: 30 May 2004 17:18:30 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: how to make the page not available in perl when click Back button
Message-Id: <c9d516$rjv$1@canopus.cc.umanitoba.ca>
In article <fo4kb094l0oe7p8074m0c6nkhruhpje8v6@4ax.com>,
Darick <darick_ang@yahoo.com.sg> wrote:
:may i know how to send an 'expires' header ? could u show me ?
http://vancouver-webpages.com/proxy.html
"RFC1945 (the HTTP1.0 spec.) says that if the Expires date is equal
to or earlier than the value of the Date header, the recipient must
not cache the document. A value of zero (0) or an invalid date
format should be considered equivalent to an "expires immediately."
http://www.oreilly.com/openbook/webclient/ch05.html
$r->header($field [=> $val],...)
When called with just an HTTP header as a parameter, this
method returns the current value for the header. For
example, $myobject->('content-type') would return the value
for the object's Content-type header. To define a new
header value, invoke header( ) with an associative array of
header => value pairs, where value is a scalar or reference
to an array. For example, to define the Content-type
header, one would do this:
$r->header('content-type' => 'text/plain')
--
The image data is transmitted back to Earth at the speed of light
and usually at 12 bits per pixel.
------------------------------
Date: Sun, 30 May 2004 09:07:52 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Hybrid Module Question
Message-Id: <2htfiaFh2nr4U1@uni-berlin.de>
Also sprach Malcolm Dew-Jones:
> Mark Shelor (mshelor@comcast.removeme.net) wrote:
>: I'm the author of a CPAN module that contains XSUBs written in C. In
>: other words, users are required to have a C compiler to build the module.
>
>: In the future, I'd like to also include pure Perl versions of these
>: subroutines so that the module can still be used even if a C compiler
>: isn't present. I assumed there was a more-or-less standard way to go
>: about writing a hybrid module, but I've yet to find specific guidelines
>: in the Perl documentation I've looked at.
>
>: Basically, I want to set things up such that the C-language XSUBs are
>: automatically used if the build platform has a C compiler. Otherwise,
>: the pure Perl versions of the routines would be installed.
>
>: Could anyone point me to relevant examples or how-to documentation?
>
> MIME::Base64 does this.
The 2.x releases at least do it. It's quite a clutch, though. It works
by having the user delete Base64.xs before building it. Not something
that I would call very elegant.
I think it should be possible with three distinct Makefile.PLs. The
top-level one checks for the existance of a C compiler. If one is found,
it calls, for example, xs/Makefile.PL. Otherwise it will call
perl/Makefile.PL. The pure Perl version and the XS version would then
have to live in separate sub directories.
It has to be ensured that the correct Makefile is called in the correct
directory. So another approach would be to have the top-level
Makefile.PL create the correct Makefile. When doing 'make', things will then
descend into one of the two directories and trigger the standard
procedure 'perl Makefile.PL; make; make test; make install'.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Mon, 31 May 2004 00:10:36 +0800
From: "Y W Wong" <ywwong_hk@hotmail.com>
Subject: Re: Login to MS Exchange to send e-mail
Message-Id: <c9d2bd$8be$1@news.hgc.com.hk>
How about POP3 cannot be enabled by some reason ?
I think we have to send to a smarthost by SMTP, is it ?
My requirement is not to using POP3 nor SMTP to send mail through MS
Exchange.
Hope u really understand what I am asking for.
Yan
"Petri" <Petri_member@newsguy.com> ¦b¶l¥ó news:c9b1pt0rav@drn.newsguy.com ¤¤
¼¶¼g...
> In article <c9adch$1sjv$1@news.hgc.com.hk>, Y W Wong says...
> >>>> Ask your exchange admin to start the SMTP-, and IMAP- or
> >>>> POP3-connectors on the Exchange Server. Then use the usual
> >>>> mail-modules available from CPAN.
>
> >>> I just want to act as a simple script type MS Outlook to
> >>> send text mail. Anyone know how ?
>
> >> Yes. You've just been told how. What part of the answer
> >> didn't you understand?
>
> > I understood the SMTP and POP3 description.
> > But it doesn't answer my question.
> > I am asking how to login like MS Outlook, not by POP3 or SMTP.
> > Hope that someone know what I am asking for.
>
> Do you know, yourself?
> Use POP3 or IMAP to login to your exchange mailbox, just like Outlook
does.
> What's the problem?
>
> Actually, you probably don't even have to login at all, since you claim
you only
> want to send email, and SMTP authentication is not on by default in
Exchange
> Server.
> use Net::SMTP; # Or anyone of the numerous free email modules on CPAN.
>
>
> Petri
>
------------------------------
Date: Sun, 30 May 2004 17:37:03 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: Newbie question: PERL proxies...
Message-Id: <c9d635$3so$1@ichaos.ichaos-int>
mike@enovative-solutions.net (mrmike) said:
>I am in the design stages of developing a website that will allow a
>user to log into my site, the site internally would log into a third
>party site [...]
>The problem is that I want to more or less spoof the user's IP address
>and send it along to the third party server rather than use my own.
For the first, you can't hide your own IP -- because anyway it'll be
your IP that will be connecting to the third site, and you need to
have the return packets routed through your site.
Also, there's a reason that the IP primarily is retrieved from the
connection data (which you cannot alter if you wish to see the
return packets).
If you can agree with the third-party site(s) in question, you can
of course build some scheme of your own to transmit the end-user
IP addresses (but this of course requires that the admins of the
third-party site(s) trust you). One such scheme would be to agree
upon a specific X-... header that your site inserts to the requests
and the backend sites inspect and honor _if_ the request is coming
from your IP. Without the collaboration of admins of the third-party
sites this is not doable.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
------------------------------
Date: Sun, 30 May 2004 07:07:04 +0000 (UTC)
From: "David H. Adler" <dha@panix2.panix.com>
Subject: Re: On "for (@foo)"
Message-Id: <slrncbj20o.76r.dha@panix2.panix.com>
On 2004-05-29, Paul Lalli <ittyspam@yahoo.com> wrote:
> On Sat, 29 May 2004, David H. Adler wrote:
>> On 2004-05-28, Paul Lalli <ittyspam@yahoo.com> wrote:
>> > On Fri, 28 May 2004, David H. Adler wrote:
>> >
>> >> How about:
>> >>
>> >> for ($i = 20; $i > 0; $i--) {
>> >> do_stuff_with($i);
>> >> }
>> >>
>> >
>> > for my $i (reverse (1..20)){
>> > do_stuff_with($i);
>> > }
>> >
>>
>> Ok, here you got me. I should have stuck with my original thought
>> of using $i - 3 instad of $i-- ...
>
> for my $i (grep { ($_ + 1) % 3 == 0 } reverse (1..20) ) {
> do_stuff_with($i);
> }
>
>>
>> Really, my disagreement was with the, IMO, extreme "never". I'd be
>> happy with "extremely rarely". :-)
>
> At this point, I'm mostly joking. I would never actually write code like
> the above.
Oh thank $deity! :-)
> I'm just not convinced there's any variation of a C-style for loop
> that cannot be emulated with a Perl-style foreach loop.
I'm sure you're right, but I'm not convinced it's always a good idea.
Thinking about it further, I think in some cases using the c-style may
be good in the sense that it isolates the loop logic from what's going
on inside the loop - which might work with one's brain better. I. e.
sort of the way that templating systems separate content from code
(probably only sort of). But, this being perl, YMMVExtrordinarily.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
With its concern for ethics and its snooty disdain for digging up
corpses, killing test subjects, and resurrecting the dead, the medical
establishment has lost ground to mad scientists in such important fields
as zombie creation. - The Onion, Volume 38 Issue 36
------------------------------
Date: 30 May 2004 07:31:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Print a formatted array
Message-Id: <c9c2k3$f27$1@mamenchi.zrz.TU-Berlin.DE>
Jamie Smyth <jamiesmyth_uni@yahoo.ca> wrote in comp.lang.perl.misc:
> I'm having some trouble printing an array in Perl. The array is very
> long and must be read in by some archaic FORTRAN code so the spacing
> needs to be exact. For those that speak FORTRAN, the format is
> basically '(5(F16.10))'.
>
> In perl I have:
>
> 105 my $i;
> 106 for ($i=0; $i<(scalar(@data)); $i++) {
> 107 my $s = int($i*6);
^
should be 5, no?
> 108 #print "$s $e \n";
> 109 $fh->printf("%10.6f %10.6f %10.6f %10.6f %10.6f\n",
> 110 $data[$s], $data[$s+1], $data[$s+2], $data[$s+3],
> $data[$s+4]);
> 111 }
>
> In addition to being rather awful looking and slow, the above code
> pads a partially full, last line with zero values if the number of
> elements in the array is not divisible by 5.
If you can afford to destroy the original array:
$_ = sprintf( '%10.6f', $_) for @array;
print( join( ' ', splice @array, 0, 5), "\n") while @array;
Anno
------------------------------
Date: Sun, 30 May 2004 16:37:49 +0200
From: Vincent van Scherpenseel <reply@newsgroup.invalid>
Subject: Problems with keep-alive connections
Message-Id: <c9crjt$27kb$1@beast.euro.net>
Hello group,
I'm writing a simple script which should connect to a HTTP proxy server,
then send a GET request and display the output of the GET request. After
that it should continue with other tasks.
It's all going well, until I use HTTP/1.1. Most HTTP/1.1 requests are
Keep-Alive connections and thus perl keeps the connection (IO::Socket)
alive.
Here's a (much) simplified version of my code:
> while (<$remote>) {
> print $client $_;
> }
> close $remote;
Now my problem is that because of the Keep-Alive connection, my script
'hangs' within the while-loop, and thus doesn't continue its operations. Is
there a way to support Keep-Alive connections but still let my script
continue like it should?
Please help me how to work around this.
Yours Sincerely
Vincent van Scherpenseel
------------------------------
Date: Sun, 30 May 2004 09:22:43 +0000 (UTC)
From: Gary Mayor <gary@tgpmakers.com>
Subject: Sendmail Options?
Message-Id: <c9c953$99v$1@sparta.btinternet.com>
Hi,
I'm having a problem with sendmail not always sending emails. When
someone registers I want sendmail to send a registration email to the
user but this only works 50% of the time. So the only thing I can think
of is my sendmail options. Here's the line I use to send emails,
my $sendmail = "/usr/sbin/sendmail -oi -t";
Is there anything wrong with that line. What other options can I use on
there to hopefully improve the reliability of email sending.
Thanks
Gary
------------------------------
Date: 30 May 2004 09:43:40 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: Sendmail Options?
Message-Id: <c9cacc$lun$1@canopus.cc.umanitoba.ca>
In article <c9c953$99v$1@sparta.btinternet.com>,
Gary Mayor <gary@tgpmakers.com> wrote:
:I'm having a problem with sendmail not always sending emails. When
:someone registers I want sendmail to send a registration email to the
:user but this only works 50% of the time. So the only thing I can think
:of is my sendmail options. Here's the line I use to send emails,
:my $sendmail = "/usr/sbin/sendmail -oi -t";
:Is there anything wrong with that line. What other options can I use on
:there to hopefully improve the reliability of email sending.
This isn't a sendmail newsgroup.
sendmail -oi -t is pretty traditional for sending out email when
the destination is to be read from the message itself. The -oi option
tells it to ignore input lines that contain a single period ('dot'),
which would otherwise indicate end-of-file.
You haven't given us any information about what happens the other 50%
of the time when you try to send out email. Does it just disappear?
Does it get stuck in the queue? Does it go to the wrong recipient?
I think we can get a clue from the one line of code that you included.
You used double-quotes for the string even though no variables were
being interpolated and no escape sequences were being used. You could
instead have used:
my $sendmail = '/usr/sbin/sendmail -oi -t';
This gives us the hint that you probably aren't being careful about
interpolation, and gives us the hint that you probably don't have
taint checking turned on. You might not even be using strictures --
do you have use strict; and use warnings; turned on?
--
I've been working on a kernel
All the livelong night.
I've been working on a kernel
And it still won't work quite right. -- J. Benson & J. Doll
------------------------------
Date: Sun, 30 May 2004 11:55:40 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Sendmail Options?
Message-Id: <2htplkFh4jf9U1@uni-berlin.de>
Gary Mayor wrote:
> I'm having a problem with sendmail not always sending emails. When
> someone registers I want sendmail to send a registration email to
> the user but this only works 50% of the time.
I believe that the behaviour is caused by the sendmail configuration
rather than your Perl program. Study the documentation about the mail
server configuration or ask the server administrator for help.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 30 May 2004 22:26:57 +1200
From: "Tintin" <me@privacy.net>
Subject: Re: Sendmail Options?
Message-Id: <2htr6fFgkoniU1@uni-berlin.de>
"Gary Mayor" <gary@tgpmakers.com> wrote in message
news:c9c953$99v$1@sparta.btinternet.com...
> Hi,
> I'm having a problem with sendmail not always sending emails. When
> someone registers I want sendmail to send a registration email to the
> user but this only works 50% of the time. So the only thing I can think
> of is my sendmail options. Here's the line I use to send emails,
>
> my $sendmail = "/usr/sbin/sendmail -oi -t";
>
> Is there anything wrong with that line. What other options can I use on
> there to hopefully improve the reliability of email sending.
comp.mail.sendmail is thataway.........->
------------------------------
Date: Sun, 30 May 2004 11:13:18 +0000 (UTC)
From: Gary Mayor <gary@tgpmakers.com>
Subject: Re: Sendmail Options?
Message-Id: <c9cfkd$mo0$1@sparta.btinternet.com>
Walter Roberson wrote:
> In article <c9c953$99v$1@sparta.btinternet.com>,
> Gary Mayor <gary@tgpmakers.com> wrote:
> :I'm having a problem with sendmail not always sending emails. When
> :someone registers I want sendmail to send a registration email to the
> :user but this only works 50% of the time. So the only thing I can think
> :of is my sendmail options. Here's the line I use to send emails,
>
> :my $sendmail = "/usr/sbin/sendmail -oi -t";
>
> :Is there anything wrong with that line. What other options can I use on
> :there to hopefully improve the reliability of email sending.
>
> This isn't a sendmail newsgroup.
>
> sendmail -oi -t is pretty traditional for sending out email when
> the destination is to be read from the message itself. The -oi option
> tells it to ignore input lines that contain a single period ('dot'),
> which would otherwise indicate end-of-file.
>
> You haven't given us any information about what happens the other 50%
> of the time when you try to send out email. Does it just disappear?
> Does it get stuck in the queue? Does it go to the wrong recipient?
>
>
> I think we can get a clue from the one line of code that you included.
> You used double-quotes for the string even though no variables were
> being interpolated and no escape sequences were being used. You could
> instead have used:
>
> my $sendmail = '/usr/sbin/sendmail -oi -t';
>
> This gives us the hint that you probably aren't being careful about
> interpolation, and gives us the hint that you probably don't have
> taint checking turned on. You might not even be using strictures --
> do you have use strict; and use warnings; turned on?
>
Hi,
The emails just disappear looked in the logs and there's nothing giving
a clue, just says sent.
Nope no tainting, strict or warnings turned on will do so now.
Thanks
------------------------------
Date: Sun, 30 May 2004 10:42:58 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Sendmail Options?
Message-Id: <2f6d9c.ed7.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
On 2004-05-30, Gary Mayor <gary@tgpmakers.com> wrote:
> my $sendmail = "/usr/sbin/sendmail -oi -t";
>
> Is there anything wrong with that line. What other options can I use on
> there to hopefully improve the reliability of email sending.
The Net::SMTP module is more Perlish and more portable.
- --keith
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFAuh0ghVcNCxZ5ID8RAmLnAJ4wcLh2+pGESiTlNehhmC4rfY9lHQCffYxf
2mgCUl4rrHthvVNv+t63F0o=
=Y+VJ
-----END PGP SIGNATURE-----
------------------------------
Date: Sun, 30 May 2004 17:52:03 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: Sendmail Options?
Message-Id: <c9d6s6$3so$2@ichaos.ichaos-int>
Gary Mayor <gary@tgpmakers.com> said:
>Walter Roberson wrote:
>> In article <c9c953$99v$1@sparta.btinternet.com>,
>> Gary Mayor <gary@tgpmakers.com> wrote:
>> :I'm having a problem with sendmail not always sending emails.
...
>> :Here's the line I use to send emails,
>>
>> :my $sendmail = "/usr/sbin/sendmail -oi -t";
...
Well, the line you quoted does not send mail; it declares a variable
called '$sendmail' and initialises it to the given value. Apparently
later in the code you give that variable to "system" or some other
all that will actually execute sendmail.
>The emails just disappear looked in the logs and there's nothing giving
>a clue, just says sent.
Says "sent" where? In the logs? If the log says "sent", then look for
detail saying "relay=some.host.name". So, for example here's a log entry
of a message I sent to myself:
sendmail[4467]: i4UHhbF9004465: to=<juha.laiho@iki.fi>, delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30318, relay=mta.inet.fi. [192.89.123.210], dsn=2.0.0, stat=Sent (Message received: 20040530174337.BGKH8747.fep14.inet.fi@ichaos.ichaos-int)
So, says that it has been delivered using mailer 'relay', and has been
accepted for delivery by mta.inet.fi. In addition, mta.inet.fi admins
could find out more info about this message with the id listed at the
end of the line (2004...).
If there is a line like this in your maillog, then the message is delivered
out of your machine, but may of course have been filtered by some other
machine on the way - antispam and virus scanning software are rather
commonplace nowadays.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
------------------------------
Date: Sun, 30 May 2004 11:00:39 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: strange behavior
Message-Id: <te8jb095bnl4gr4d2ur2ked4mo63o3222d@4ax.com>
X-Ftn-To: Bill
Bill <wherrera@lynxview.com> wrote:
>> my $tmp = join ' ', map { $_ += 5*$row } 0 .. 4;
<snip>
>Yeah, the 0 .. 4 array is getting clobbered in the map function. (Don't
>do that? :) )
Hm, but 0..4 isn't an array; it is a _list_ which gets cached and AFAIK it
shouldn't behave like that?
--
Matija
------------------------------
Date: Sun, 30 May 2004 08:15:40 -0600
From: Bill <wherrera@lynxview.com>
Subject: Re: strange behavior
Message-Id: <T6GdncyWHI8mcSTdRVn-jA@adelphia.com>
Matija Papec wrote:
> X-Ftn-To: Bill
>
> Bill <wherrera@lynxview.com> wrote:
>
>>> my $tmp = join ' ', map { $_ += 5*$row } 0 .. 4;
>
> <snip>
>
>>Yeah, the 0 .. 4 array is getting clobbered in the map function. (Don't
>>do that? :) )
>
>
> Hm, but 0..4 isn't an array; it is a _list_ which gets cached and AFAIK it
> shouldn't behave like that?
>
>
>
This is perl5-porters stuff. It's beyond me. I'd comment that IMO 0 .. 4
should be constant, and assigning to it should be a run time error. But
that's _my_ perl implementation, which exists only in my head (just as
well too :) ).
------------------------------
Date: Sun, 30 May 2004 14:33:09 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Two quick questions about Perl6
Message-Id: <hskjb0l8uate01ugah3gjbrq2f0ii02ku1@4ax.com>
On Fri, 28 May 2004 22:43:09 GMT, Uri Guttman <uri@stemsystems.com>
wrote:
>>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:
>
> MD> (1) Don't you think that whereas the new language will indeed be more
> MD> consistent and robust, it will also be *slightly* less magic?
>
>not really. it is still perl in many ways. read the apocalypses,
I didn't want to contend that. I also share the *feeling* that it is
still perl in many ways.
BTW: this is the reason why I wrote "*slightly*"!
>exegesis and synopses on dev.perl.org. that book was out of date the
>moment the trees were felled. :) the running joke on the perl6 lists is
I'm well aware about this and IIRC it's clearly stated in the book
itself. May this be a good reason why I read it *at* the bookshop? :-)
>what changes/flip-flops did larry make this week!
>
> MD> (2) Perl is known for being inspired from a mixture of many other
> MD> languages/programs. It seems evident that the new OO features of
> MD> Perl6 resemble a lot those of some widely used OO languages, but
> MD> are there any other languages that specifically influenced some
> MD> choices about its syntax and semantic?
>
>if you read those docs and some of the mail threads and if you dare to
>read the rfc's, you will get a partial answer to that question. perl6 is
Huh! I don't think I'll dare... I was just curious...
>blatantly stealing/borrowing from anyone who has an interesting idea
>that can be worked into a perlish way. in fact the concept of roles in
>OO is better than any of the popular OO langs as it can support many of
Hmmm, maybe just because I read the book at the bookshop (but ?
haven't finished it yet) I can't remember any discussion about
"roles": is it a Perl-specific technical term or a generic OO one? I'm
admittedly no expert in either, but I can't remember having ever read
that term...
>their needs in a more elegant and integrated way.
>
>perl6 will be one of the most publicly designed systems in history IMO.
Well, after all, if only I had a *truly* interesting idea I'd like to
contribute it... which are the recommended resources (e.g. MLs, NGs)
especially intended for a not-too thechnically versed audience? (i.e.
more oriented at informal discussions.)
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Sun, 30 May 2004 16:17:14 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Two quick questions about Perl6
Message-Id: <x7aczpanzq.fsf@mail.sysarch.com>
>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:
MD> On Fri, 28 May 2004 22:43:09 GMT, Uri Guttman <uri@stemsystems.com>
MD> wrote:
MD> Well, after all, if only I had a *truly* interesting idea I'd like to
MD> contribute it... which are the recommended resources (e.g. MLs, NGs)
MD> especially intended for a not-too thechnically versed audience? (i.e.
MD> more oriented at informal discussions.)
well, that was probably in the rfc phase of 3 years ago. since then it
has become a viable meritocracy with a small cabal of language designers
and a larger mass of helpers. the language list is the only place where
there is any activity and many lurk there i am sure. it is a friendly
list and if you ask intelligent questions or offer suggestions you will
likely get answers. but things are very far along and not many new ideas
are forthcoming in general. p6 is not complete but the greater picture
is very developed. the best sources for p6 are the A/E/S docs as i have
said. A12 is the latest and is on objects and a mindblower. roles are
covered there and it is the first time i ever properly grokked the
concept after months of reading about it and related stuff on the
list. there is a 'traits paper' referred to often and it covers all the
OO stuff from an academic view. much of p6's higher level OO stuff is
influenced by that paper.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sun, 30 May 2004 08:21:22 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Why is this upload script not working
Message-Id: <c9c5i2$154$1@wisteria.csv.warwick.ac.uk>
Quoth constants@mix-net.net (Mark Constant):
> Well I think I am getting close. A file by the name of $path ends up
> in the quickbooks directory now. The file contains nothing though
> which I don't understand. Please bear with me on this because I am
> trying to take everybodies suggestions. Below is what outputs.
> Upload Results
>
> Filename: XF86Config.new
> Destination: /var/www/htdocs/quickbooks/XF86Config.new
> Original CWD was: /var/www/htdocs
> New CWD after chdir is: /var/www/htdocs/quickbooks
> MIME Type: text/plain
> File saved
>
> Here is my code
> #!/usr/bin/perl -T
> use CGI;
> use CGI::Carp qw/fatalsToBrowser/;
> use File::Spec::Functions qw/catfile splitdir/;
> use strict;
> use warnings;
> use Cwd;
>
> my $q = CGI->new();
> my $file = $q->param('upfile');
> $file =~ /^([\w.-]+)$/ or die "Unaccetable file name: $file";
> my $filename = $1;
> my $cdir = cwd;
> chdir('quickbooks');
No. Use a full path: you can't be sure what the cwd will be.
chdir '/var/www/htdocs/quickbooks'
or die 'can't cd to quickbooks dir: $!";
> my $dir = cwd;
> my $path = catfile splitdir($dir), $filename;
As you are now in the right place you can just use relative paths; or
use Cwd::abs_path:
my $path = abs_path $filename;
> print $q->header, $q->start_html('Uploading File');
> print $q->h1('Upload Results');
>
> if(!$filename){
> print "Nothing Uploaded\n";
> } else {
> print "Filename: $filename<br />\n";
> print "Destination: $path<br />\n";
> print 'Original CWD was: ',$cdir,"<br />\n";
> print 'New CWD after chdir is: ', $dir,"<br />\n";
> my $ctype = $q->uploadInfo($file)->{'Content-Type'};
> print "MIME Type: $ctype<br />\n";
> open(OUTFILE, '>$path') or die("Didn't work because of $! \n");
> binmode(OUTFILE);
> while (my $bytesread = read($filename, my $buffer, 1024)) {
> print OUTFILE $buffer;
> }
$filename is just the name. $file is the magic CGI handle.
my ($read, $buffer);
print OUTFILE $buffer
while $read = read $file, $buffer, 1024;
defined $read or die "read failed: $!";
> close(OUTFILE);
close OUTFILE or die "close of uploaded file failed: $!";
close $file or die "close of socket failed: $!";
> print "File saved\n";
> }
>
> $q->end_html;
Ben
--
Every twenty-four hours about 34k children die from the effects of poverty.
Meanwhile, the latest estimate is that 2800 people died on 9/11, so it's like
that image, that ghastly, grey-billowing, double-barrelled fall, repeated
twelve times every day. Full of children. [Iain Banks] ben@morrow.me.uk
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 6628
***************************************