Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Ask Bjoern Hansen

On 8 Sep 2000, Chaim Frenkel wrote:

> >> Oh, why not? Does anybody actually *ever* check the return value of
> >> print? I think it's not as if we'd break a lot of code.
> 
> ABH> uh, what? you don't do much socket programming now, do you? sockets
> ABH> breaks all the time. Disks runs out of space while you write to
> ABH> files. and so on and so on.
> 
> Could someone enlighten this poor soul and tell me what I _can_ do
> with an error return from a print or close?

rollback transactions to the database, flag the thing you tried to
do as something that should be retried, close and reopen the socket
connection and try again, send a mail to the NOC that the world is
on fire, etcetera, etcetera ...

Tim always refers to
http://search.cpan.org/doc/TIMB/DBI_Talk4_2000/sld024.htm
 
> Reporting it may be useless (disk full).

eh? I like to get someone aware of it so the problem can be fixed. I
also like my application to stop doing whatever it tried to do and
if possibly know what it didn't do so it can try it again later.
 

 - ask 

-- 
ask bjoern hansen - 
more than 70M impressions per day, 




Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Chaim Frenkel

> "ABH" == Ask Bjoern Hansen <[EMAIL PROTECTED]> writes:

>> Oh, why not? Does anybody actually *ever* check the return value of
>> print? I think it's not as if we'd break a lot of code.

ABH> uh, what? you don't do much socket programming now, do you? sockets
ABH> breaks all the time. Disks runs out of space while you write to
ABH> files. and so on and so on.

Could someone enlighten this poor soul and tell me what I _can_ do
with an error return from a print or close?

Reporting it may be useless (disk full).

While I'm asking, what does one do while switching around file descriptors
and an error is returned. Is there anywhere to report it?


-- 
Chaim FrenkelNonlinear Knowledge, Inc.
[EMAIL PROTECTED]   +1-718-236-0183



Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Bart Lateur

On Fri, 8 Sep 2000 01:18:19 -0700 (PDT), Ask Bjoern Hansen wrote:

>I really don't understand why you want to have what's printed.

It is handy, sometimes.

But I do think that the overhead of creating a longish string every time
you print something, which is then simply discarded, is not really
acceptable. I expect a rather significant slowdown. A rough guess: 20%,
which that is the slowdown I onotice if you print with $\ set to "\n"
instead of to nothing. It's just not worth it.

-- 
Bart.



Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Ask Bjoern Hansen

On Wed, 6 Sep 2000, Bart Lateur wrote:

> >Those are not the semantics of print.   It returns true (1) if successful, and
> >false (undef) otherwise.  You cannot change that.  If I write print "0", it
> >bloody well shan't be returning false.
> 
> Oh, why not? Does anybody actually *ever* check the return value of
> print? I think it's not as if we'd break a lot of code.

uh, what? you don't do much socket programming now, do you? sockets
breaks all the time. Disks runs out of space while you write to
files. and so on and so on.

> Problem is: if you need defined() to see if the print was succesful, you
> cannot return what was printed as well. It's one thing or the other. So
> you cannot have it both ways.

I really don't understand why you want to have what's printed. If
you need it in a variable, you can just make the variable first and
then print.


 - ask

-- 
ask bjoern hansen - 
more than 70M impressions per day,