Perl - Sample Interview Question (Junior Level)

What will be the result of running the following code

#!/usr/bin/env perl

use strict;
use warnings;
use Data::Dump 'dump';

sub fill_rand {
 my ($array, $count) = @_;
   if ($count >= 1) {
   unshift @$array, rand();
   fill_rand ($array, --$count);
 }
}

my @array;
fill_rand (\@array, 5);
dump @array;

  1. There will be compilation errors
  2. The program will output one random number and then exits
  3. The program will output five random number and then exits
  4. The program will encounter a deep recursion on subroutine
Tests in Perl for Juniors

Test Name Difficulty Time (minutes) No. of Questions
Perl Online Test for Juniors Perl Junior 40 20

More Specific Tests in Perl for Juniors

Test Name Difficulty Time (Minutes) No. of Questions
Perl-Basic Online Test for Juniors Perl - Basic Junior 20 10
Perl-Regular-expressions Online Test for Juniors Perl - Regular expressions Junior 20 10