DEV Community

Discussion on: 13 reasons why you should not use Perl

Collapse
 
mc7244 profile image
Michele Beltrame • Edited

Regarding point 4, why are you using that syntax? With recent (at least 10 years old I think) versions of Perl you can just do:

sub func1($x, $y, $z) {
    // do something with the variables
}
func1(1, 2, 3);
Enter fullscreen mode Exit fullscreen mode

If for some reason you need to use a very old Perl interpreter, there's still a better solution:

sub func1 {
    my ($x, $y, $z) = @_;
    // do something with the variables
}
func1(1, 2, 3);
Enter fullscreen mode Exit fullscreen mode

Michele.

Collapse
 
davorg profile image
Dave Cross • Edited

It was Perl 5.20 that introduced subroutine signatures (in 2014). And they're not widely used, I think, because they're still marked as experimental.

Collapse
 
mc7244 profile image
Michele Beltrame

One thing I agree with, is that they likely should be not be marked "experimental" anymore. ;-)

Thread Thread
 
jacoby profile image
Dave Jacoby

Getting things from experimental to in and from deprecated to out are not tasks that happen in Perl.