in reply to RPC

Just a hunch (my hunch was wrong, see Update below), but try removing the single quotes from the filehandles in your open() and close() statements.

Change this:

open( 'USERS' , 'file' );
To this:
open( USERS , 'file' );
and while we're at it, let's check the results of the open:
open(USERS, 'file') or die "unable to open `file': $!";

Update: my hat's off to tye on the use of a string literal for a filehandle. How many times have I glossed over the following in perlfunc and not noticed?

If FILEHANDLE is an expression, its value is used as the name of the real filehandle wanted.
I suppose what threw me is that I've seen no examples of literal strings used to specify filehandles. Live and learn.

Replies are listed 'Best First'.
Re (tilly) 2: RPC
by tilly (Archbishop) on May 05, 2001 at 19:03 UTC
    That claim notwithstanding, try this:
    #!/usr/bin/perl -w use strict; my $fh = 'OUT'; open ($fh, "< $0") or die "Cannot read $0: $!"; print <$fh>;
    Try replacing some of the $fh's with 'OUT'. Some combinations will work, some will fail. The list that works/fails changes from 5.005 to 5.6.

    Caveat programmer.