perl script on how to count the total number of lines of all the files under a directory

how to count the total number of lines of all the files under a directory using perl script..

I mean if I have 10 files under a directory then I want to count the total number of lines of all the 10 files contain. Please help me in writing a perl script on this.

Does it have to be Perl?

wc -l * | tail -1 | awk '{print $1}'

yes I want in perl as I have to run it in windows.

perl -nle '$a++;END{print $a}' *

May be:

$ cat count.pl 
#!/usr/bin/perl
use strict;
use warnings;
 
my @arr         = ();
my $count       = 0;
 
while (<>) {}
continue
{
  if (eof)
  {
    push (@arr, $. );
    close ARGV;
  }
}
 
foreach (@arr){
    $count += $_;
}
 
print "Total count is $count\n";
$ 
$ 
$ ./count.pl *.txt
Total count is 89
$ 

i tried to run this but this is giving below error.

Can't find string terminator "'" anywhere before EOF at -e line 1.

My requirement is in windows i need to run a perl script which will go to all the folders and calculate total lines of codes in all the files.