szabgab has asked for the wisdom of the Perl Monks concerning the following question:
In code like above if f() returns more than 3 or less than 3 values perl would silently disregard this and go on doing its business. This cannot be checked at comile time but is there any way to get at least a warning about such cases in run time? Can that maybe turned into a FATAL error? If that could be done, then probably it would also work on the following code as well:my ($x, $y, $z) = f();
my ($x, $y, $z) = @_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Incorrect number of values in list assignment
by ikegami (Patriarch) on Sep 06, 2010 at 06:16 UTC | |
|
Re: Incorrect number of values in list assignment
by Utilitarian (Vicar) on Sep 06, 2010 at 05:50 UTC | |
|
Re: Incorrect number of values in list assignment
by BrowserUk (Patriarch) on Sep 06, 2010 at 06:13 UTC | |
|
Re: Incorrect number of values in list assignment
by chromatic (Archbishop) on Sep 06, 2010 at 06:14 UTC | |
by szabgab (Priest) on Sep 06, 2010 at 08:48 UTC | |
by chromatic (Archbishop) on Sep 06, 2010 at 19:32 UTC | |
by ikegami (Patriarch) on Sep 07, 2010 at 05:40 UTC | |
|
Re: Incorrect number of values in list assignment
by Utilitarian (Vicar) on Sep 06, 2010 at 05:50 UTC |