my @filelist = glob($data); $result = join('
',@filelist); #N.B I haven't tested the above code, it's for example/illustration purposes only.