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 | |
by hdb (Monsignor) on Sep 03, 2013 at 10:07 UTC | |
by tobyink (Canon) on Sep 03, 2013 at 10:12 UTC |