#!/usr/bin/perl

# Copyright 2022-2026, Paul Johnson (paul@pjcj.net)

# This software is free.  It is licensed under the same terms as Perl itself.

# The latest version of this software should be available from my homepage:
# https://pjcj.net

use feature "current_sub";

sub recursive_func
{
    my ($ref) = @_;
    return $ref unless ref $ref eq "ARRAY";
    return __SUB__->($ref->[0]);
}

recursive_func([[[]]]);
