in reply to Re: Re: problems returning from recursive subroutine
in thread problems returning from recursive subroutine

$ perl -e '@ARGV ||= "."' Can't modify array dereference in logical or assignment (||=) at -e li +ne 1, at EOF
Don't get your contexts mixed up. The left side of a logical operator is always in scalar context. Also don't forget - rename may fail, so if you're going to return the new filename you should be sure the renaming succeeded. Overall this seems more like a job for map:
sub pp { map { my $new = lc $_; ($new eq $_ or -e $new) ? $_ : rename($_, $new) ? $new : $_; } @_; }

Makeshifts last the longest.