in reply to generate a new toc

          ....now I get the following error. readline () on closed filehandle INP at toc.pl line 60

You need to do some error-checking on file open:

open(INP, "$file") or die "Could not open file $file : $!\n";

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

Replies are listed 'Best First'.
Re^2: generate a new toc
by grashoper (Monk) on Feb 20, 2008 at 22:08 UTC
    OK I tried to do open (INP, "+>" $file)or die "Could not open file $file : $!\n"; now I get a scalar found where operator expected error..
      OK I tried to do open (INP, "+>" $file)or die

      The arguments of open() are separated with commas. You mean

      open (INP, "+>", $file) or die;

      Don't put single variables into double quotes, it is a useless interpolation (except when you use a reference of a package which overloads stringification, and know what you're doing).

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
        even with single quotes I get the same error, I really need to get this working, I was thinking maybe html link extor would help, I am really puzzled why my new file doesn't work, could the # signs in the urls be the problem? id:669050 is my original post.