in reply to Re^2: check for wantarray?
in thread check for wantarray?
etc. Messy but would take care of the problem. This is how I handle some XML data structures deparsed from API calls to certain applications that can return an array of hashrefs, an arrayref of hashrefs, a single hashref or undefined.@ret = somesub(); if (ref $ret[0] eq 'HASH') { .... } elsif (ref $ret[0] eq 'ARRAY') { .... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: check for wantarray?
by ikegami (Patriarch) on Dec 27, 2008 at 01:30 UTC |