develooper Front page | perl.perl5.porters | Postings from April 2015

[perl #124034] perlvar $@ could be improved

From:
James E Keenan via RT
Date:
April 28, 2015 01:08
Subject:
[perl #124034] perlvar $@ could be improved
Message ID:
rt-4.0.18-4093-1430183299-1290.124034-15-0@perl.org
On Mon Mar 09 22:46:38 2015, mauke- wrote:
> 
> This is a bug report for perl from l.mai@web.de,
> generated with the help of perlbug 1.40 running under perl 5.20.2.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> $ perldoc -v '$@'
>     $EVAL_ERROR
>     $@      The Perl syntax error message from the last "eval()"
> operator. If
>             $@ is the null string, the last "eval()" parsed and
> executed
>             correctly (although the operations you invoked may have
> failed in
>             the normal fashion).
> 
> ...
> 
> 
> This description somewhat misses the point.
> 
> - it implies $@ is only set by eval STRING and for compiler errors
> ("syntax
>    error", "parsed and executed correctly")
> - $@ is not necessarily a "message" (i.e. a string)
> - doesn't mention the common use as a generic exception mechanism via
> die/eval
>   BLOCK
> - What is "failed in the normal fashion"? Nowadays the normal fashion
> is often
>   to throw an exception.
> - I like "empty string" better than "null string"
> 

I agree with at least your last bullet point.  Could you provide a patch with alternative working for people to chew over?

Thank you very much.
-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=124034



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