perl-diddler has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my ($Devel, $Debuff_Output) = (1,1); if ($Debuff_Output) { select STDERR; $| = 1; select STDOUT; $| = 1; } if ($Devel) { use Carp qw(cluck confess); $SIG{__WARN__} = $SIG{__DIE__} = sub {confess @_} } my @array = (1, 2, 3, 4); my @array2 = (3, 5, 7); sub arlen ($) { my $ar_nam=$_[0]; no strict 'refs'; my $ar_len = eval $#$ar_nam; sprintf "name=%s, length=%d", $ar_nam, $ar_len; } foreach ('array', 'array2') { no strict 'refs'; printf "Array %s\n", arlen $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: simple symbolic reference Q
by chromatic (Archbishop) on Oct 04, 2010 at 20:54 UTC | |
by perl-diddler (Chaplain) on Oct 04, 2010 at 23:04 UTC | |
by chromatic (Archbishop) on Oct 04, 2010 at 23:17 UTC | |
by perl-diddler (Chaplain) on Oct 05, 2010 at 01:21 UTC | |
by AnomalousMonk (Archbishop) on Oct 05, 2010 at 02:14 UTC | |
by AnomalousMonk (Archbishop) on Oct 05, 2010 at 02:27 UTC | |
|
Re: simple symbolic reference Q
by morgon (Priest) on Oct 04, 2010 at 22:15 UTC | |
by perl-diddler (Chaplain) on Oct 04, 2010 at 22:35 UTC | |
by Anonymous Monk on Oct 05, 2010 at 13:33 UTC | |
|
Re: simple symbolic reference Q
by eyepopslikeamosquito (Archbishop) on Oct 05, 2010 at 10:59 UTC |