in reply to return +0
Unary "+" has no effect whatsoever, even on strings. It is useful syntactically for separating a function name from a parenthesized expression that would otherwise be interpreted as the complete list of function arguments.
The calluse warnings; use strict; my $return=&call(); print "Return value :$return"; sub innercall($) { print "I am called\n"; return 'gzip'; } sub call() { return +(innercall('test')||'') =~ /gzip/; }
andreturn +(innercall('test')||'') =~ /gzip/;
exhibit same behavior!Hope this helps!!return (innercall('test')||'') =~ /gzip/;
would return either a '1' or ' ' depending on the match success and failure respectivelyreturn +($r->header_in('Accept-Encoding')||'') =~ /gzip/;
|
|---|