develooper Front page | perl.perl5.porters | Postings from January 2013

[perl #104060] Writing to $> and friends hide errors

Thread Next
From:
Ricardo SIGNES via RT
Date:
January 24, 2013 15:09
Subject:
[perl #104060] Writing to $> and friends hide errors
Message ID:
rt-3.6.HEAD-4370-1359040155-1409.104060-14-0@perl.org

So some of the options:

1. deprecate assigning to these vars, giving a long deprecation period (2yr) to let the 
deprecation warnings hit people using vendorperls;  after that period, assigning to $<,etc. is 
fatal

2. continue to allow assignment to $<,etc., but make failures fatal

3. leave things as they are, but document the acrobatics that are required to try for sane error 
handling

Also mentioned: #2, but fatal only under some pragma like autodie or a feature.

My tentative favorite is #2.  A grep of CPAN finds people using assignment to these vars, but 
not checking that things work.  Programs that are working should keep working.  Programs 
that are silently "working" should admit their sins.  I predict that often these programs will be 
run in contexts where warnings will be invisible.

Documentation should also be updated to explain why users should look at using something 
else instead, too.

-- 
rjbs

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About