if (index($line, $ndata) == 0) { my $ndir = substr($line, length($ndata)); print "$ndir\n"; }