subroutine-prototypes Questions
4
Solved
Perl provides an API via CORE::prototype, that allows you to get a prototype. This is further documented by Sub::Util which is the documented method for working with subs,
Sub::Util::prototype,
Re...
Caressa asked 10/9, 2020 at 19:27
2
Solved
In Perl, I've always liked the key-value pair style of argument passing,
fruit( apples => red );
I do this a lot:
sub fruit {
my %args = @_;
$args{apples}
}
Purely for compactness and hav...
Aleurone asked 24/1, 2016 at 0:41
2
Solved
Caveats associated with prototypes accepted and notwithstanding, can the two below contrived subs exist within the same package, i.e. to provide an optional block parameter like sort does?
sub mypr...
Furfuraceous asked 14/10, 2014 at 19:13
2
Solved
This is what I have:
use 5.14.0;
use strict;
use warnings;
sub my_func(&$) {
my $coderef = shift;
my %attribs = @_;
}
This is what I'd like to achieve:
my_func {
print 1;
} first_attrib...
Vannie asked 16/12, 2011 at 13:11
1
© 2022 - 2024 — McMap. All rights reserved.