in reply to Re: Re: Globally change ucfirst in mod_perl
in thread Globally change ucfirst in mod_perl
A couple of points:
BEGIN { *CORE::GLOBAL::ucfirst = sub { join ' ', map CORE::ucfirst, split / /, defined $_[0] ? $_[0] : $ +_; } } $_ = "I shouldn't be printing this, but I am anyway."; my $var = undef; print ucfirst $var;
Perhaps you should be checking for the number of parameters passed instead?
BEGIN { *CORE::GLOBAL::ucfirst = sub { join ' ', map CORE::ucfirst, split / /, @_ ? $_[0] : $_; } }
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
|
|---|