Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Compare hash with arrays and print

by Marshall (Canon)
on Jul 12, 2010 at 23:19 UTC ( [id://849125]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Compare hash with arrays and print
in thread Compare hash with arrays and print

update: oops I do see that you do have a print statement. and looks like it should work.

This "select FILE3;" statement by itself does nothing useful. I actually wouldn't use select at all in this situation.

The Perl print statement is a "smart" critter. If the first arg of print is the file handle of some open file, Perl will print to that file handle. print FILE3 "abc"; will print "abc" to FILE3. The Perl default is essentially "print stdout "abc";". Select makes the default print go to wherever you want (instead of stdout), but here it appears easier to just put the file handle in the print statement.

print FILE3 $_; or similar will work fine. A plain "print;" sends $_ to the default file handle. With a file handle specified, I think you have to explicitly say $_ for the same effect.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2025-12-09 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (88 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.