in reply to Where did I go wrong?

i don't really know how to configure this post.
As this site is best viewed with OpenEyes™, it's all there, right under the preview: Writeup Formatting Tips


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Where did I go wrong?
by sjlo (Initiate) on Nov 13, 2007 at 22:46 UTC
    getting the error.. Name 'main::FILE" used only once: possible typo at line 9 Use of uniniitalized value in concatenation <.> or string and Attemping line: 302 Moved Temporarily not sure what that means
      You probably want something like
      use strict; use warnings; my $FILE = undef; my $filename = 'C:\tmp\blah.txt'; open( $FILE, '<', $filename ) or die "Can't open $filename: $!"; while(<$FILE>) { ... } close $FILE or die "Close failed";
      See perlopentut for more.

      Also, it looks like you are running Win32. /tmp/blah.txt is not a proper Win32 filename.

      Update: Thanks to cdarke for pointing out Win32 filename subtleties, where /tmp/blah.txt indeed is a possibly filename.

      --
      Andreas
        /tmp/blah.txt is not a proper Win32 filename.

        Works for me. It expects a directory called tmp on the current 'drive' (partition). mkdir tmp creates it. The problem with using backslashes as a directory separator is that you then MUST use single quotes around them, or 'escape' them. It is an easy mistake to put the filename inside double quotes. / is much safer, and works on Windoze happily.