in reply to problems passing variables between subroutines
Please use a reference an array rather than an actual array in:
sub create_output (\@$) { my (@array_of_lines, $entry_no_new) = @_;
as below:
use feature ":5.14"; use warnings FATAL => qw(all); use strict; use Data::Dump qw(dump pp); sub foo(\@) {my ($array) = @_; say "@$array"; } my @array = qw(1 2 3); foo(@array);
Produces
1 2 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problems passing variables between subroutine
by GrandFather (Saint) on Sep 05, 2012 at 02:04 UTC | |
by Anonymous Monk on Sep 05, 2012 at 09:11 UTC |