Arabic
view release on metacpan or search on metacpan
lib/Arabic.pm view on Meta::CPAN
since the ... is also the three-dot version of the range operator
(see "Range Operators"). These examples of the yada yada are still syntax errors:
print ...;
open my($fh), '>', '/dev/passwd' or ...;
if ( $condition && ... ) { print "Hello\n" };
There are some cases where Perl can't immediately tell the difference between an
expression and a statement. For instance, the syntax for a block and an anonymous
hash reference constructor look the same unless there's something in the braces that
give Perl a hint. The yada yada is a syntax error if Perl doesn't guess that the
{ ... } is a block. In that case, it doesn't think the ... is the yada yada because
it's expecting an expression instead of a statement:
my @transformed = map { ... } @input; # syntax error
You can use a ; inside your block to denote that the { ... } is a block and not a
hash reference constructor. Now the yada yada works:
my @transformed = map {; ... } @input; # ; disambiguates
my @transformed = map { ...; } @input; # ; disambiguates
lib/Earabic.pm view on Meta::CPAN
#
# via File::HomeDir::Unix 1.00
#
sub my_home {
my $home;
if (exists $ENV{'HOME'} and defined $ENV{'HOME'}) {
$home = $ENV{'HOME'};
}
# This is from the original code, but I'm guessing
# it means "login directory" and exists on some Unixes.
elsif (exists $ENV{'LOGDIR'} and $ENV{'LOGDIR'}) {
$home = $ENV{'LOGDIR'};
}
### More-desperate methods
# Light desperation on any (Unixish) platform
else {
$home = CORE::eval q{ (getpwuid($<))[7] };
( run in 0.465 second using v1.01-cache-2.11-cpan-748bfb374f4 )