Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

•Re: Re: Perl & C/C++

by merlyn (Sage)
on Mar 29, 2003 at 17:02 UTC ( [id://246620]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://246620]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-03-28 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found