in reply to odd behavior with DATA section

i personally like this for ditching comments and blank lines (but obviously this is a TMTOWTDI item):
while (my $line = <DATA>) { chomp $line; $line =~ s/\s*#.*//; unless $line =~ /\S/; ... }
Also note that for the path creation you can use File::Path
my $dir = "$base_dir/$filepath" do { mkpath $dir; print "Made $dir\n"; } unless -d $dir;
As for the original issue, I'm not sure where those blanks are coming from.. It doesn't seem like it's one trailing line at the end of DATA.. to debug further i would first try this and hope the answer becomes apparent:
warn "Line: ==$line=="; my ($filename, $filepath) = split '\t', $line; warn "filename: '$filename' --- filepath: '$filepath'";

Replies are listed 'Best First'.
Re^2: odd behavior with DATA section
by Nkuvu (Priest) on Jul 23, 2005 at 01:10 UTC
    Thanks for the note on the File::Path. I meant for this to be a quick throwaway script, and knew that the Cygwin mkdir could do this pretty easily. If I had planned for something any more long term than throwaway I would have looked for a solution better suited to re-use. But nice to know what to look for, anyway.

    I did change the script to output the line before the split, and the file and path after. The output is getting long:

    And no apparent answer jumps at me. Another good suggestion, though, and one I hadn't tried.