Perl

Perl is a highly capable, feature-rich programming language with over 36 years of development. Perl runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large scale development projects.

Below a script in Perl. Here is one example of getting file list of a given directory recursively.

            
            use strict;
            use File::Find;
            use File::Copy;
            use Data::Dumper;
    
            my @FILE_LIST;
    
            # -- main --
            {
              my $sDir = "/home/username";
              my @aFileList = GetFileList($sDir);
            }
    
            # ----------------------------
            sub GetFileList($)
            # ----------------------------
            {
              my $root = shift;
    
              @FILE_LIST = ();
              find(\&filter, $root);
              return @FILE_LIST;
            }
    
            # ----------------------------
            sub filter
            # ----------------------------
            {
              my $root = $File::Find::topdir;
              my $path = $File::Find::name;
              my $file_name = $_;
    
              if( $file_name =~ /\.(cgi|pl)$/i )
              {
                $root =~ s/\\/\\\\/g;
                $path =~ s/^$root[\/\\]//;
                push @FILE_LIST, $path;
              }
            }