RatKing has asked for the wisdom of the Perl Monks concerning the following question:
my $result = my_function(); if ( ref $result eq 'SCALAR' ) { # Handle scalar return value } elsif ( ref $result eq 'ARRAY' ) { # Handle Array return value }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to detect a returns value gracefully
by citromatik (Curate) on Feb 26, 2009 at 11:00 UTC | |
|
Re: How to detect a returns value gracefully
by ELISHEVA (Prior) on Feb 26, 2009 at 08:31 UTC | |
by Anonymous Monk on Feb 26, 2009 at 08:39 UTC | |
by almut (Canon) on Feb 26, 2009 at 11:18 UTC | |
by Anonymous Monk on Feb 26, 2009 at 19:53 UTC | |
by almut (Canon) on Feb 26, 2009 at 20:00 UTC | |
| |
|
Re: How to detect a returns value gracefully
by Joost (Canon) on Feb 26, 2009 at 11:43 UTC | |
|
Re: How to detect a returns value gracefully
by Fletch (Bishop) on Feb 26, 2009 at 13:42 UTC |