#!/usr/bin/perl -w use strict; use Data::Dumper; my $aref; print STDERR 'before: ' . Dumper($aref); x($aref); print STDERR 'after func: ' . Dumper($aref); push (@{$aref},'hownow'); print STDERR 'last:' . Dumper($aref); sub x{ my $in = shift; push (@{$in},'whatever'); print STDERR 'infunc:' . Dumper($in); }
[download]
produces output
before: $VAR1 = undef; infunc:$VAR1 = [ 'whatever' ]; after func: $VAR1 = undef; last:$VAR1 = [ 'hownow' ];
[download]