My goal is to spit a file or files that are in a specific directory.  My
problem is that I can't read the file.

Attempt to read file:
#!/usr/bin/perl
open (IN, " < /opt/crxml/tstdir/updt1.dat");
until (eof IN) {
  $line = <IN>;
  chomp $line;
  print $line;
  @fields = split /:/, $line;
  print "$fields[0]\n";
}

Same attempt but with directory read 
#!/usr/bin/perl
# Input Files
$in_dir = "/opt/crxml/tstdir";
# Open Files
opendir(IN_DIR, "$in_dir");
# Read Directory
while ($file = readdir(IN_DIR)) {
  next if $file =~ /^\.\.?$/;
  print "$file found in $in_dir\n";
  chomp $file;
#Open Files
  open (IN1, "< $file");
  $tstopen = <IN1>;
  chomp $tstopen;
  print "$tstopen\n";
    @fields1 = split /:/, $tstopen;
    print "$fields1[0]\n";

Does anyone have any idea what I am doing wrong .. OS is solaris 8.

Chuck

Reply via email to