in reply to What does the dash before hash assignment means?

The => is just a grandified comma interpreting its left side as a string, so in your question it is the same as fun( '-url', $httpRefer ). So no hash involved yet unless the called function creates one. See these two examples:

use strict; use warnings; use Data::Dumper; sub fun1 { print Dumper \@_; } sub fun2 { my %args = @_; print Dumper \%args } my $httpRefer = 'someValue'; fun1( -url => $httpRefer ); fun2( -url => $httpRefer ); __END__ $VAR1 = [ '-url', 'someValue' ]; $VAR1 = { '-url' => 'someValue' };

Replies are listed 'Best First'.
Re^2: What does the dash before hash assignment means?
by tobyink (Canon) on Sep 03, 2013 at 10:03 UTC

    The fat comma is a bit of a red herring. The same is true with a regular comma...

    fun1( -url, $httpRefer ); fun2( -url, $httpRefer );
    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

      Interesting, thanks for this comment! It works in the same way, unless one omits the hyphen. Without it one gets an Bareword "url" not allowed while "strict subs" in use at dash.pl line 9. error.