in reply to Re: Perl & C/C++
in thread Perl & C/C++

It's only a warning if the file doesn't exist. Not death.

And for safety, I have to localize a filehandle anyway... so as long as I am doing that, if I pick *ARGV, I get the diamond for free.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^3: Perl & C/C++ (lexical filehandle?)
by Aristotle (Chancellor) on Mar 30, 2003 at 23:58 UTC
    Any reason not to just use a lexical variable for the handle? You can also get rid of the $1 if since push imposes list context on the regex anyway.
    my @COLOR; { open my $fh, "<", "/usr/lib/X11/rgb.txt" or last; push @COLOR, /\d+\s+\d+\s+\d+\s+(\S+)/ while <$fh>; }

    Makeshifts last the longest.