in reply to Pulling a file with a given extension

Did you check whether DIR was opened successfully? If you're using a relative directory, are you sure you know the current directory?
  • Comment on Re: Pulling a file with a given extension

Replies are listed 'Best First'.
Re^2: Pulling a file with a given extension
by rashley (Scribe) on Oct 18, 2005 at 16:00 UTC
    Yes, I added a print statement that verified I'm getting into the correct directory, and yes, the directory has "test.dat" in it.

    Still, when I run it I get "$datfile ==>" and that's it.

      Do you see "test.dat" outputted when you do
      opendir DIR, '.' or die "Cannot open current dir. $!"; print("$_\n") foreach readdir DIR; closedir DIR;

      If so, I suspect the filename isn't actually "test.dat". Maybe it has a trailing space. Maybe there's some funky character in there that's not getting displayed.