[30519] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1762 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 4 17:49:14 2008

Date: Fri, 1 Aug 2008 21:09:10 -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           Fri, 1 Aug 2008     Volume: 11 Number: 1762

Today's topics:
        Edit top line of perldoc <usenet@larseighner.com>
    Re: Edit top line of perldoc <ben@morrow.me.uk>
    Re: EPIC and "my" variables <rupert@web-ideas.com.au>
    Re: extracting double from a string <hjp-usenet2@hjp.at>
        Fail to upgrade all the packages of perl in Linux envir <kwan.jingx@gmail.com>
    Re: FAQ 4.2 Why is int() broken? <hjp-usenet2@hjp.at>
    Re: FAQ 4.2 Why is int() broken? <szrRE@szromanMO.comVE>
    Re: FAQ 4.2 Why is int() broken? <daves@orpheusmail.co.uk>
    Re: FAQ 4.36 How can I expand variables in text strings <brian.d.foy@gmail.com>
    Re: FAQ 4.36 How can I expand variables in text strings <whynot@pozharski.name>
    Re: FAQ 8.7 How do I clear the screen? <brian.d.foy@gmail.com>
    Re: Help with Button Placements using TK <grahamjfeeley@optusnet.com.au>
    Re: How do I tell sendmail where to send bounced mail? <whynot@pozharski.name>
    Re: How do I tell sendmail where to send bounced mail? <noreply@gunnar.cc>
    Re: Perl - Gnuplot Topics <edgrsprj@ix.netcom.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 2 Aug 2008 01:57:19 +0000 (UTC)
From: Lars Eighner <usenet@larseighner.com>
Subject: Edit top line of perldoc
Message-Id: <slrng97fe8.11ui.usenet@debranded.larseighner.com>

Is it possible within POD to edit the top line of the perldoc display (the
one with 'User Contributed Perl Documentation' in it)?

-- 
Lars Eighner <http://larseighner.com/> usenet@larseighner.com
        War on Terrorism:  Okay, Unleash OUR Extreme Fundamentalists
"... all of them who have tried to secularize America, I point the finger in
       their face and say, 'You helped this happen.'"  --Jerry Falwell


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

Date: Sat, 2 Aug 2008 03:35:08 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Edit top line of perldoc
Message-Id: <sntcm5-nqr.ln1@osiris.mauzo.dyndns.org>


Quoth Lars Eighner <usenet@larseighner.com>:
> Is it possible within POD to edit the top line of the perldoc display (the
> one with 'User Contributed Perl Documentation' in it)?

Not from within the POD itself. You can change it by supplying the
'center' option to Pod::Man, or by calling perldoc like

    perldoc -w center:"Foo Bar Baz" perldoc

Of course, this only applies if you're using Pod::Man to format your
pod; but that's what perldoc uses by default under Unix.

Ben

-- 
  The cosmos, at best, is like a rubbish heap scattered at random.
                                                           Heraclitus
  ben@morrow.me.uk


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

Date: Fri, 1 Aug 2008 16:43:15 -0700 (PDT)
From: rupert <rupert@web-ideas.com.au>
Subject: Re: EPIC and "my" variables
Message-Id: <3515cf2b-9959-4bd7-93a4-448088c0388a@j1g2000prb.googlegroups.com>

Well it's what I had to do to get eclipse 3.2 and variable debugging
to work in windows. I'm just documenting it. It kept failing until I
did that. :( perhaps EPIC hasn't kept up with the developments in CPAN
- could that be a bug report needed?

Still trying to get it done in Linux if anybody has tips - otherwise
it looks like i'll be developming in windows, i'm tired of VIM...


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

Date: Fri, 1 Aug 2008 22:29:23 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: extracting double from a string
Message-Id: <slrng96sh3.98m.hjp-usenet2@hrunkner.hjp.at>

On 2008-08-01 11:01, perlcoder <a@a.com> wrote:
> In article <6fg63uFb9hs8U1@mid.uni-berlin.de>, Jens Thoms Toerring says...
>>perlcoder <a@a.com> wrote:
>>> We store an array of 32 doubles as a string in a database. When the data
>>> is fetched from the database it is first read to a char[257] and then
>>> converted to an array of 32 double, by using C union.
>>
>>What mean "using a C union"? Are you storing binary values of the
>>doubles in the database?
>
> Yes we store the binary value of 32 doubles in a char field of the
> database of length 256. When we fetch it from the database, we read it
> to a struct which contains char[256] union an array of 32 doubles.
> [ we are a single platform shop - all Solaris where doubles are 8 bytes ]

Note that Solaris on SPARC and Solaris on Intel are different platforms
in this regard.

	hp

PS: This question seems oddly familiar. Did you already ask it a few
months ago?


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

Date: Fri, 1 Aug 2008 16:59:06 -0700 (PDT)
From: kwan <kwan.jingx@gmail.com>
Subject: Fail to upgrade all the packages of perl in Linux environment
Message-Id: <4affce0c-ca01-409b-9834-5269e5e3dcd8@y38g2000hsy.googlegroups.com>

Hello all,

I want to upgrade all the packages in perl, but fail. Any sugguest?

Thank you


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

Date: Fri, 1 Aug 2008 22:27:00 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 4.2 Why is int() broken?
Message-Id: <slrng96sck.98m.hjp-usenet2@hrunkner.hjp.at>

On 2008-07-31 17:04, szr <szrRE@szromanMO.comVE> wrote:
> Peter J. Holzer wrote:
>> On 2008-07-29 15:57, szr <szrRE@szromanMO.comVE> wrote:
>>> Peter J. Holzer wrote:
>>>> On 2008-07-28 17:56, szr <szrRE@szromanMO.comVE> wrote:
>>>>> Granted, it's a calculator, but I have often wondered why it
>>>>> seems to be able to handle such calculations better than a CPU
>>>>> that's over 400 times faster.
>>>>
>>>> Different target. Calculators can be slow - they do only primitive
>>>> computations, and if they finish them in a short but noticable time
>>>> its still "fast enough". A modern CPU is supposed to be able to do
>>>> hundreds of millions such computations per second. Calculators are
>>>> also rarely used for computations where accuracy is much of an issue
>>>> - 8 or 12 digits are enough. But they are used by people who expect
>>>> 0.1 * 10 to be 1.0 but aren't overly surprised if 1/3*3 is
>>>> 0.9999999.
>>>
>>> Testing on a TI-89 (which does have a hefty amount of precision)
>>> entering "1/3*3.0" yields "1." and so does "0.1*10", and Perl seems
>>> to give the same results. On what hardware, language, or such, do
>>> you end up getting 0.99999.. from 1/3*3.0 ?
>>
>> For example on my HP-48 calculator. It uses 12 decimal places, so 1/3
>> is
>> 0.333333333333. 0.333333333333 * 3 is clearly 0.999999999999.
>
> A TI-86 also uses 12 decimal places. But it depens how you enter things:
>
>    1/3
>            .333333333333
>    .333333333333 * 3
>            .999999999999
>
> But:
>
>    123456789012345678901
>    1/3
>            .333333333333
>    Ans*3
>                        1
>
> The 2nd example uses the build in "Ans" variable which always contains 
> the result of the last computation, which can be more accurate than 
> simply re-typing what was displayed.
>
> what happens if you enter "(1/3) * 3" instead of "0.333333333333 * 3" on 
> your HP-48 ?

I didn't enter 0.333333333333 * 3. I entered "1 ENTER 3 / 3 *". The
HP-48 uses Reverse Polish Notation. It also displays all digits (unless
told to display a rounded result), so that wouldn't make a difference
anyway.


>> I don't have my old TI-57 at hand (it's about 600 km away), but IIRC
>> it used 11 decimal digits and displayed only 8. So 1/3 would be
>> 0.33333333333 (displayed as 0.3333333), multiplication with 3 would
>> then yield 0.99999999999 (displayed as 1). So, you see "1", but the
>> error is still there. If you subtract 1.0, you will get 1E-11.
>
> Just like with mine, theres a difference between what is known 
> internally and what is displayed.
>
>> (deja vu: I had almost exactly this discussion with my room mate 22
>> years ago: He claimed that his TI was more accurate than my HP because
>> 1/3*3 *displayed* 1 instead of 0.999999999999. Changing the
>> calculation into 1/3*3-1 showed otherwise: He got 1E-11, I got 1E-12,
>> which is clearly the smaller error.)
>
> On a TI-86, "1/3*3-1" gives me -1E14, but on a TI-89 it's 0. I have no 
> idea why the result is negative on the 86,

Because 0.99999999999999 - 1  is obviously less than 0? My mistake - I
omitted the sign. From the result it is rather clear that the TI-86 uses
14 digits internally.

> unless the sign bit is 
> somehow being clobbered.

Nope. I clobbered the sign bit while typing. The result must obviously
be negative.


> Mathetically, the TI-89 seems to get it more right, as (1/3)*3 = 1 is 
> mathematically correct, as the 3 in the demoninator in of the first 
> number and 3 in the numinator of the 2nd number (3/1) cancel each other 
> out,

Since the TI-89 can do symbolic algebra it may actually notice this
never compute 1/3.

> leaving 1/1 which is better writen as just plain ol' 1. Then 1-1 
> is, of course, 0.
>
> I'm not sure why the TI-86 has such a strange result when "-1" is thrown 
> in,

I have been trying to explain it to you in just about every posting in
this thread. I give up.

	hp



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

Date: Fri, 1 Aug 2008 14:00:51 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: FAQ 4.2 Why is int() broken?
Message-Id: <g6vti402f39@news4.newsguy.com>

Peter J. Holzer wrote:
> On 2008-07-31 17:04, szr <szrRE@szromanMO.comVE> wrote:
>> Peter J. Holzer wrote:
>>> On 2008-07-29 15:57, szr <szrRE@szromanMO.comVE> wrote:
>>>> Peter J. Holzer wrote:
>>>>> On 2008-07-28 17:56, szr <szrRE@szromanMO.comVE> wrote:
>>>>>> Granted, it's a calculator, but I have often wondered why it
>>>>>> seems to be able to handle such calculations better than a CPU
>>>>>> that's over 400 times faster.
>>>>>
>>>>> Different target. Calculators can be slow - they do only primitive
>>>>> computations, and if they finish them in a short but noticable
>>>>> time its still "fast enough". A modern CPU is supposed to be able
>>>>> to do hundreds of millions such computations per second.
>>>>> Calculators are also rarely used for computations where accuracy
>>>>> is much of an issue - 8 or 12 digits are enough. But they are
>>>>> used by people who expect
>>>>> 0.1 * 10 to be 1.0 but aren't overly surprised if 1/3*3 is
>>>>> 0.9999999.
>>>>
>>>> Testing on a TI-89 (which does have a hefty amount of precision)
>>>> entering "1/3*3.0" yields "1." and so does "0.1*10", and Perl seems
>>>> to give the same results. On what hardware, language, or such, do
>>>> you end up getting 0.99999.. from 1/3*3.0 ?
>>>
>>> For example on my HP-48 calculator. It uses 12 decimal places, so
>>> 1/3 is
>>> 0.333333333333. 0.333333333333 * 3 is clearly 0.999999999999.
>>
>> A TI-86 also uses 12 decimal places. But it depens how you enter
>> things:
>>
>>    1/3
>>            .333333333333
>>    .333333333333 * 3
>>            .999999999999
>>
>> But:
>>
>>    123456789012345678901
>>    1/3
>>            .333333333333
>>    Ans*3
>>                        1
>>
>> The 2nd example uses the build in "Ans" variable which always
>> contains the result of the last computation, which can be more
>> accurate than simply re-typing what was displayed.
>>
>> what happens if you enter "(1/3) * 3" instead of "0.333333333333 *
>> 3" on your HP-48 ?
>
> I didn't enter 0.333333333333 * 3. I entered "1 ENTER 3 / 3 *". The
> HP-48 uses Reverse Polish Notation. It also displays all digits
> (unless told to display a rounded result), so that wouldn't make a
> difference anyway.

I hated those type of calculators. I think the difference is calculators 
like the TI 86/89 seems to have a threshold for determining if a number 
repeats ad infinitum. On the 86, if I type 0.333... with 12 decimal 
digits (12 "3"'s after the ".") and multiply by 3, it's ".999999999999", 
but if I add a 13th "3" and multiple by 3 it comes out as "1". It seems 
calculators like yours do not do this. The TI-89 seems to be far better 
with this, though.

>>> I don't have my old TI-57 at hand (it's about 600 km away), but IIRC
>>> it used 11 decimal digits and displayed only 8. So 1/3 would be
>>> 0.33333333333 (displayed as 0.3333333), multiplication with 3 would
>>> then yield 0.99999999999 (displayed as 1). So, you see "1", but the
>>> error is still there. If you subtract 1.0, you will get 1E-11.
>>
>> Just like with mine, theres a difference between what is known
>> internally and what is displayed.
>>
>>> (deja vu: I had almost exactly this discussion with my room mate 22
>>> years ago: He claimed that his TI was more accurate than my HP
>>> because 1/3*3 *displayed* 1 instead of 0.999999999999. Changing the
>>> calculation into 1/3*3-1 showed otherwise: He got 1E-11, I got
>>> 1E-12, which is clearly the smaller error.)
>>
>> On a TI-86, "1/3*3-1" gives me -1E14, but on a TI-89 it's 0. I have
>> no idea why the result is negative on the 86,
>
> Because 0.99999999999999 - 1  is obviously less than 0? My mistake - I
> omitted the sign. From the result it is rather clear that the TI-86
> uses 14 digits internally.

Yeah, if it's storing the value internally as 0.99999999... than 
subtracting 1 would yield a negative value. It's still a result one 
might find surprising at first, and again, this doesn't seem to be a 
problem on the TI-89.

>> unless the sign bit is
>> somehow being clobbered.
>
> Nope. I clobbered the sign bit while typing. The result must obviously
> be negative.


Ah, ok.

>> Mathetically, the TI-89 seems to get it more right, as (1/3)*3 = 1 is
>> mathematically correct, as the 3 in the demoninator in of the first
>> number and 3 in the numinator of the 2nd number (3/1) cancel each
>> other out,
>
> Since the TI-89 can do symbolic algebra it may actually notice this
> never compute 1/3.

Either that or it uses a threshold algorithm like I described (either 
way the 89 seems to handle this far better than the 86.)

>> leaving 1/1 which is better writen as just plain ol' 1. Then 1-1
>> is, of course, 0.
>>
>> I'm not sure why the TI-86 has such a strange result when "-1" is
>> thrown in,
>
> I have been trying to explain it to you in just about every posting in
> this thread. I give up.

This was from only one reply up, so how could it have been from every 
posting? It just didn't occur to me that the 86 was internally had a 
value like 0.99999... which is smaller than zero. That's what tripped me 
up.

-- 
szr 




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

Date: Sat, 02 Aug 2008 00:23:36 +0100
From: Dave Stratford <daves@orpheusmail.co.uk>
Subject: Re: FAQ 4.2 Why is int() broken?
Message-Id: <4fc841f2ecdaves@orpheusmail.co.uk>

In article <slrng8rg3a.pia.hjp-usenet2@hrunkner.hjp.at>,
   Peter J. Holzer <hjp-usenet2@hjp.at> wrote:

> Actually, I didn't write what "a typical computer" uses, just what
> happens when a binary system is used (which is what perl uses on most
> (all?) platforms - COBOL uses normally uses decimal).

Obviously written by someone who doesn't know cobol at all well. Cobol has
been able to use binary since at least 1974. That 'normally' is completely
wrong, by default cobol wants to use binary. (at least since 1974 it has!)

Dave

-- 
Dave Stratford    ZFCA
http://daves.orpheusweb.co.uk/
Hexagon Systems Limited - Experts in VME systems development



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

Date: Fri, 01 Aug 2008 15:27:52 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 4.36 How can I expand variables in text strings?
Message-Id: <010820081527525474%brian.d.foy@gmail.com>

In article <g6vb67$49j$1@aioe.org>, npc <npc@zomg.tk> wrote:

> On Fri, 01 Aug 2008 06:03:03 -0700, PerlFAQ Server wrote:
> 
> > 4.36: How can I expand variables in text strings?
> 
>   I don't understand this faq entry. I'm probably misunderstanding it. 
> 
>   There is no mention of using "" at all. If its bad to use, it should    
> still be mentioned as being bad to use, and why. 

The question is talking about strings that look like they have
varaibles in them, such as the literal string 'Hello $neighbor'. From
that literal string, you want to expand the literal '$neighbor' to the
value of the variable $neighbor.


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

Date: Fri, 01 Aug 2008 23:30:39 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: FAQ 4.36 How can I expand variables in text strings?
Message-Id: <fc8cm5xnc2.ln2@carpet.zombinet>

npc <npc@zomg.tk> wrote:
> On Fri, 01 Aug 2008 06:03:03 -0700, PerlFAQ Server wrote:

>> 4.36: How can I expand variables in text strings?

>  I don't understand this faq entry. I'm probably misunderstanding it. 

Never mind.  It's a ping-pong FAQ.

>  There is no mention of using "" at all. If its bad to use, it should    
> still be mentioned as being bad to use, and why. 

There's.  Look below.

>>             my $string = sprintf 'Say hello to %s and %s', $foo, $bar;

>  I'm guessing that using "" is viewed as a bad idea, can someone 
> enlighten me as to why? How is it worse than using sprintf? 

I<$foo> and I<$bar> are just placeholders.  They can be replaced with
function calls, blocks, filehandle reads etc.  Surely you can achieve
the same (as in the example) effect with C<.> concatenation operator.
However C<perldoc -f sprintf> has more.

*SKIP*

[To FAQ maintainers]

>>             $string = 'Say hello to $foo and $bar';

Did I miss something?

  s/'/"/g;

*CUT*
-- 
Torvalds' goal for Linux is very simple: World Domination


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

Date: Fri, 01 Aug 2008 15:28:24 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 8.7 How do I clear the screen?
Message-Id: <010820081528247353%brian.d.foy@gmail.com>

In article <87sktp61n5.fsf@Don-John.Messina>, Mark L Pappin
<mlp@acm.org> wrote:

> PerlFAQ Server <brian@stonehenge.com> writes:
> 
> >     If you only have do so infrequently, use "system":
> >
> >             system("clear");
> 
> Which of course only works on those systems with a 'clear' command
> that does what you want.
> 
> This answer should be noted as being system-specific, 

Anything that uses system() is system specific :)


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

Date: Sat, 2 Aug 2008 11:20:35 +1000
From: "Graham Feeley" <grahamjfeeley@optusnet.com.au>
Subject: Re: Help with Button Placements using TK
Message-Id: <4893b666$0$11886$afc38c87@news.optusnet.com.au>

Thanx for the replies guys.
Whenever I get help like this I praise the internet forumsand you guys whom 
are just great.
I am working on these forms
Regards
Graham

"Graham Feeley" <grahamjfeeley@optusnet.com.au> wrote in message 
news:48924a2d$0$2271$afc38c87@news.optusnet.com.au...
> Hi I am a Newbie and trying to get a menu to work.
> I have place 3 buttons so far on a form, however I would like to know how 
> to place them where I want them.
> EG: on this form I would like the buttons to be on the bottom of the form 
> and in one row????
> Any help would be appreciative!!
> ------------------
> #!/usr/bin/perl -w
>        # Display Hello World program
>        use diagnostics;
>        use Tk;
>        use strict;
>        use warnings;
>  my $font1 = "arial 10 bold";
>  my $font2 = "courier 12 bold";
>
>        my $mw = MainWindow->new;
>        $mw->geometry("1024x512");
>        $mw->title("GUI Test");
>
> my $frame1 = $mw->Frame(-width=>1024,
>                       -height=>128,
>        -relief=>"raised")->grid();
>
> my $btn1 = $mw->Button(-text=>"Exit",
>                    -font=>$font2,
>                 -width=>9,               # width of the button in screen 
> units
>                -height=>3,               # height of the button in screen 
> units
>                  -relief=>"raised",      # raised solid ridge sunken flat 
> groove
>                   -state=>"normal",    # normal active or disabled
>       -command =>sub{exit})
>                ->grid( -pady=>10);
>
> my $btn2 = $mw->Button(-text=>"Btn2",
>                    -font=>$font2,
>                 -width=>9,           # width of the button in screen units
>                -height=>3,           # height of the button in screen 
> units
>                  -relief=>"raised", # raised solid ridge sunken flat 
> groove
>                   -state=>"normal",    # normal active or disabled
>    -command =>sub{exit})
>    ->grid( -pady=>10);
> my $btn3 = $mw->Button(-text=>"Btn3",
>                    -font=>$font2,
>                 -width=>9,           # width of the button in screen units
>                -height=>3,           # height of the button in screen 
> units
>                  -relief=>"raised", # raised solid ridge sunken flat 
> groove
>                   -state=>"normal",    # normal active or disabled
>    -command =>sub{exit})
>    ->grid( -pady=>10);
>
>  MainLoop;
>
> 




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

Date: Fri, 01 Aug 2008 23:13:33 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: How do I tell sendmail where to send bounced mail?
Message-Id: <dc7cm5xu87.ln2@carpet.zombinet>

John <John.Smith@invalid.com> wrote:

> I am using the following code to send email from a Perl script:

  use strict;
  use warnings;

> open(MAIL,"|/usr/sbin/sendmail -t") || return 0;

Use 3-arg B<open>, B<die> (or B<croak>) if B<open> fails, include I<$!>
in bye-bye message.

> select (MAIL);
> print "To: mycustomer\@home.com\n";
> print "From: me\@mybiz.biz\n";
> print "Return-Path: me\@mybiz.biz\n";
> print "Subject: Hello world\n";
> print "\n";
> print "It works!\n";
> close(MAIL);

Since you write in I<MAIL>, you are supposed to B<die> if B<close>
fails (it can fail).

> select (STDOUT);

Since you write in pipe, you are supposed to check I<$?>, and if it's
not C<0> you are supposed to B<die>.

> The code works just fine provided the From address is OK.  If the
> address is invalid (but lexically OK) I want to get a "bounced email
> receiver is no longer" etc. note but I get nothing.  The Return path
> does not seem to help.  What should I do to get info what email
> bounced or were invalid?

OK, funny part over.  I believe you don't understand the ways mail goes.
If you absolutely insist on using F</usr/sbin/sendmail> (what exactly
hides behind it is important, and no-one, except you, is supposed to
know your setup), then the only way you can go is increasing verbosity,
enabling debug, and parsing its output (note, by-directional pipes are
tricky).  And that won't give you much.

I believe, that you are somewhat infamiliar with your setup.  Hence a
bit of explanation.  What F</usr/sbin/sendmail> does (I think, in most
cases) is putting its input in queue and trigerring queue-runner.
That's all.  That's the queue-runner what talks to servers.

If you want server responces, you must talk to server yourself.
B<Net::SMTP> is the closest talker.  There are alternatives (CPAN is
your friend,  package manager of your distribution is your friend too).

And now funny part is really over.  I believe that in most cases (in
case the server will talk to you at all) you will receive C<251> (mail
will be forwarded) or C<252> (mail will be forwarded anyway) codes
(C<RFC2821> is your friend).

So, you'll better say what's your real goal is.

-- 
Torvalds' goal for Linux is very simple: World Domination


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

Date: Sat, 02 Aug 2008 06:00:10 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How do I tell sendmail where to send bounced mail?
Message-Id: <6fi4ejFbnrs5U1@mid.individual.net>

John wrote:
> I am using the following code to send email from a Perl script:
> 
> open(MAIL,"|/usr/sbin/sendmail -t") || return 0;
> select (MAIL);
> print "To: mycustomer\@home.com\n";
> print "From: me\@mybiz.biz\n";
> print "Return-Path: me\@mybiz.biz\n";
> print "Subject: Hello world\n";
> print "\n";
> print "It works!\n";
> close(MAIL);
> select (STDOUT);
> 
> The code works just fine provided the From address is OK.
> If the address is invalid (but lexically OK) I want to get a "bounced email
> receiver is no longer" etc. note but I get nothing.
> 
> The Return path does not seem to help.

Use the -f option:

     open (MAIL, "|/usr/sbin/sendmail -t -fme\@mybiz.biz") ...

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Fri, 1 Aug 2008 20:11:51 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Perl - Gnuplot Topics
Message-Id: <U6SdnRZ1lfXKKQ7VnZ2dnUVZ_s3inZ2d@earthlink.com>

<merritt@chauvet.bmsc.washington.edu> wrote in message 
news:g6vo0a$t0r$1@chauvet.bmsc.washington.edu...

> If you have not looked at Octave, you probably should.  It manages to 
> drive
> gnuplot even under Windows, and whatever tricks they used may be directly
> relevant to your application as well.

That sounds like a good idea.  And I will take a look at Octave.  However, 
the Gnuplot programs I presently have running are working and are doing a 
great job of producing graphics.  They are making it possible to do a lot of 
data analysis that it was impossible to do just a year ago because it 
required so much time and energy.  So, the basic goal has been achieved. 
But there is always room for improvement.

> Sorry, I don't follow what you mean by that.  In particular I don't follow
> what you mean "erased by the last replot command".

My program draws world maps for example.  And they can have a vertical line 
representing longitude that moves to the right or left based on pressing the 
appropriate arrow key.  Each time the line is moved one longitude degree 
Gnuplot has to redraw the entire world map.

It sounds like a newer version of Gnuplot might have a command that can let 
you get around that need to redraw everything when you make changes in just 
one area.  So I will check on that and see if it helps.  There was nothing 
like that in the version I am using.  And I read all of the documentation 
several times.  Multiplot was tried and did not appear to offer any help. 
Only one plot is being used at a time.

> OK, but that could still be programmed in gnuplot itself using the
> "bind" command to reassign the meaning of keypress events.  I don't know

Initially I compared results using the "bind" command versus Perl's 
"IsKeyPressed" command.  And I decided to go with the Perl keyboard monitor 
because most of the programming is being done with Perl.  So it is easier to 
quickly change what task the arrow keys etc. are assigned to do.

> application needs to do.  But you also mentioned a constraint on speed,
> and I rather suspect it's faster to use gnuplot built-in operations when
> they are available rather than emulating them in the perl layer.

I went with Perl for deciding how to draw borders and axes etc. because of 
the need to quickly move them around and expand them and contract them.  It 
is a little easier to do that by storing all of the data in arrays and then 
just multiplying the arrays by some variable factor to expand or contract 
the axes etc.  The adjusted data from the arrays are then stored in data 
files that Gnuplot reads and plots several times a second when necessary.

Once more, the primary goal here is to just get something working that will 
convince governments etc. that they should be developing this type of 
disaster management resource.  And they need to see some data to believe it. 
They won't at first care how the programs work or even what programs are 
being used.  Once they have accepted that this is a worthwhile type of 
effort they will probably just redo all of the computer programming.  That's 
fine with me.




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

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 V11 Issue 1762
***************************************


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