mikkoi has asked for the wisdom of the Perl Monks concerning the following question:
I would like to create my own subroutines which would work the same way as print FILEHANDLE LIST works.
Is there any non-magic way to create a subroutine with an optional first argument? Or would that just create confusion in code?
The sub in question would be used to send a job into a queue. In most circumstances, there is only one queue. But there could be others. And the sub takes only one argument.
example:
queue $job; queue OTHER_QUEUE $job;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Optional Subroutine Arguments Like in "print FILEHANDLE LIST"
by LanX (Saint) on May 28, 2023 at 00:12 UTC | |
by eyepopslikeamosquito (Archbishop) on May 28, 2023 at 03:19 UTC | |
by ikegami (Patriarch) on May 31, 2023 at 00:47 UTC | |
by LanX (Saint) on May 31, 2023 at 14:50 UTC | |
Re: Optional Subroutine Arguments Like in print FILEHANDLE LIST
by kcott (Archbishop) on May 28, 2023 at 02:59 UTC | |
Re: Optional Subroutine Arguments Like in <code>print FILEHANDLE LIST</code>
by tybalt89 (Monsignor) on May 27, 2023 at 23:51 UTC |