Since an array has the factorial of its element count possible orders, your $input must have that range to obtain a 1-1 relation. Are you sure that so stringent a requirement is needed?
Check out List::Util::shuffle(). It may be good enough for what you want.
You won't want to keep C++ comments in your perl, and prototypes are usually not desirable. See perltrap.
After Compline,
Zaxo
In reply to Re: Random 1-1 mapping
by Zaxo
in thread Random 1-1 mapping
by tomazos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |