sub test_arr { my @arr = @_; $a = join('|', @arr); } sub test_ref { my @arr = @{$_[0]}; $a = join('|', @arr); } sub test_ref2 { $a = join('|', @_); }