Do you want the array to contain the names of all the text files in the directory? Something like:
#! /usr/bin/perl
use strict;
use warnings;
my $dir = "/root/dir";
opendir(BIN, $dir) or die "Can't open $dir: $!";
my @array = grep { -T "$dir/$_" } readdir BIN;