diotalevi has asked for the wisdom of the Perl Monks concerning the following question:
I recently figured out how to type unicode in Emacs so I thought it'd be fun to write some functions with unicode names. Nope. It didn't work. I recalled [5.8.0 Note] A Sub Named Sigma but the same magic doesn't work here. Am I doing this wrong or is this a bug in my perl? I tried both 5.8.8 and bleadperl.
use utf8;
use strict;
use warnings;
use Test::More tests => 2;
sub ∃ (&\@) { my $cb = shift @_; $cb->() and return 1 for @_; 0 }
sub ∄ (&\@) { not ∃( @_ ) }
my @numbers = 1 .. 10;
ok( ∃ { /\d/ } @numbers, '∃' );
ok( ∄ { /[[:alpha:]]/ } @numbers, '∄' );
1..2 Illegal declaration of anonymous subroutine at /home/josh/src/any.pl l +ine 6. # Looks like your test died before it could output anything.
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A sub named ∃ (\w)
by tye (Sage) on Nov 29, 2006 at 06:17 UTC | |
by diotalevi (Canon) on Nov 29, 2006 at 17:52 UTC | |
|
Re: A sub named ∃
by monarch (Priest) on Nov 29, 2006 at 08:28 UTC | |
|
Re: A sub named ∃
by Steve_p (Priest) on Nov 30, 2006 at 03:41 UTC | |
by vkon (Curate) on Nov 30, 2006 at 11:11 UTC | |
by diotalevi (Canon) on Nov 30, 2006 at 16:48 UTC | |
by vkon (Curate) on Nov 30, 2006 at 21:27 UTC | |
by diotalevi (Canon) on Nov 30, 2006 at 21:39 UTC | |
| |
by ikegami (Patriarch) on Nov 30, 2006 at 16:36 UTC |