We were having a conversation on the KW.pm IRC channel (and our network is down at work so I can't really do any work work) about bareword filehandles this morning.
We started off talking about how bwfhs are bad compared to lexical filehandles (at least for most use cases). Then I noted that the one advantage is that if you use UPPERCASE bwfhs they are easy to see in code.
So we got talking about lower case bwfhs, and how horrible they are because they look like functions. So what happens if you use a lower-case bwfh that has the same name as a builtin function?
open lc, ">/tmp/foo"; print lc "Yadda Yadda Yadda\n";That, as most long-time perlers would expect, prints "yadda yadda yadda\n" to the currently selected filehandle.
open lc, ">/tmp/foo"; ""->print("Yikes\n");
open lc, ">/tmp/foo"; select ""; print "Yikes\n";
open lc, ">/tmp/foo"; select uc; print "Yikes\n";