in reply to How to read directories from the text file using perl?

I couldnt make the correct code for the above requirements
#!/usr/bin/perl; use strict; # I have the text file named as data.txt. my $infile = 'data.txt'; # Now i like to read the line from data.txt open IN,'<',$infile or die "$!"; print "Reading from '$infile'\n"; my $dir; while (<IN>){ chomp; # in which the line # starts with ZERO # contains the directory path? if (/^ZERO:(.*)/){ $dir = $1; } } close IN; print "Directory is '$dir'\n";

What's the problem, which part couldn't you do ?

poj