in reply to How to Check whether the Function Parameter is a Scalar or a Hashref
You ccan also add whatever else you might need, like:SWITCH: for (ref $param) { /HASH/ && do { # Do something for hash ref last SWITCH; }; /^$/ && do { # Do something for scalar last SWITCH; }; }
/ARRAY/ && do { # Do something for array ref last SWITCH; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to Check whether the Function Parameter is a Scalar or a Hash
by Ovid (Cardinal) on Oct 05, 2005 at 23:25 UTC | |
by sauoq (Abbot) on Oct 06, 2005 at 02:05 UTC | |
|
Re^2: How to Check whether the Function Parameter is a Scalar or a Hash
by radiantmatrix (Parson) on Oct 06, 2005 at 18:29 UTC | |
|
Re^2: How to Check whether the Function Parameter is a Scalar or a Hash
by Roy Johnson (Monsignor) on Oct 06, 2005 at 16:39 UTC |