develooper Front page | perl.perl5.porters | Postings from October 2013

Re: Silent prototype mismatch

Thread Previous | Thread Next
From:
Eric Brine
Date:
October 14, 2013 04:45
Subject:
Re: Silent prototype mismatch
Message ID:
CALJW-qG4f5xqstwZ_icAxGDZ9-QuoGGtrgMBimnQ70c4HyLt1Q@mail.gmail.com
On Tue, Oct 8, 2013 at 9:13 PM, Eric Brine <ikegami@adaelis.com> wrote:

>
> Does the following make sense?
>
> >perl -wE"sub foo { bar('a','b'); } sub bar($$) { } foo(); say 'done'"
> done
>

huh, that should have been

>perl -wE"sub foo { bar('a'); } sub bar($$) { } foo(); say 'done'"
done

Why is this quiet? Is it intentional?


> Another way to look at it:
>
> >perl -wE"sub bar; sub bar($$) { } say 'done'"
> done
>
> >perl -wE"sub bar($); sub bar($$) { } say 'done'"
> Prototype mismatch: sub main::bar ($) vs ($$) at -e line 1.
> done
>
>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About