![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Three argument version of open '>-' (updated)by choroba (Cardinal) |
on Mar 01, 2021 at 21:42 UTC ( [id://11128967]=perlquestion: print w/replies, xml ) | Need Help?? |
choroba has asked for the wisdom of the Perl Monks concerning the following question:
In an ancient part of the code at work, we use
Perl::Critic complains about it and wants us to replace it with a three argument variant. But, what's the 3-arg variant of >-? I thought might be the same, but it isn't, cf. versus
Then I tried with but it's different, too:
Is there a three-argument version of open that behaves the same as '>-'? Update: Here's a SSCCE. Closing STDOUT is a global state, so call this with an argument (1, 2, 3, 4) to test a particular implementation.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Back to
Seekers of Perl Wisdom
|
|