Help for this page

Select Code to Download


  1. or download this
    sub get_captures {
        my ($pattern, $line) = @_;
    ...
        shift(@captures);
        return @captures;
    }
    
  2. or download this
    sub get_captures {
        my ($pattern, $line) = @_;
        my @captures = $line =~ m/$pattern/;
        return @captures[0 .. $#+ - 1];
    }