in reply to Read Directory

Had you used strict, the perl compiler would have tould you the error. This

if(-d BUS)

doesn't do what you want. BUS is a bareword here which is just a symbol that can be used e.g. as a directory handle (not under strict, though). Then, even if it was a directory entry (which it isn't), you need to prepend $path to correctly name it's location.You can use either of

if ( $_ eq "BUS" and -d "$path/$_" ) # string equality test if ( /^BUS$/ && -d "$path/$_" ) # pattern match on $_

But it is not necessary to read the contents of a directory to test for existence of a directory within whose name you know beforehand. You could as well just do

use strict; use warnings; my $path='/home/something/something/something'; if ( -d "$path/BUS" ) { opendir my $VEH, "$path/BUS" or die"couldnt open the directory\n"; while(readdir $VEH ) { print "$_\n"; } }
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'