in reply to Passing a hash byreference to a subroutine
referencing and dereferencing in Perl is used for passing data structures to subroutines. for examples @example is an array to pass it to subroutine
@examples = ('perl', 'linux'); $reference_of_example = \@examples; #referencing your_sub($ref_example); sub your_sub { $ref = @_; print Dumper(@$ref); #@$ref is dereferencing array. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing a hash byreference to a subroutine
by haukex (Archbishop) on Apr 07, 2017 at 10:07 UTC | |
|
Re^2: Passing a hash byreference to a subroutine
by thanos1983 (Parson) on Apr 07, 2017 at 10:22 UTC |