Re: 3-argument open on STDIN
- From: merlyn@xxxxxxxxxxxxxx ((Randal L. Schwartz))
- Date: Mon, 22 Aug 2011 16:42:14 -0700
"Bryan" == Bryan R Harris <Bryan_R_Harris@xxxxxxxxxxxx> writes:
Bryan> How can I use the "safe" 3-argument open and still be able to read off a
Bryan> pipe?
You don't. 2-arg open has to be good for something.
And 2-arg open is perfectly safe if the second arg is a literal:
open OTHER, "<-" or die;
open my $handle, "<-" or die;
Don't let anyone tell you "Always use 3-arg open" unless they also
footnote it with "unless you have no variables involved".
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxxxxxx> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
.
- Follow-Ups:
- Re: 3-argument open on STDIN
- From: Bryan R Harris
- Re: 3-argument open on STDIN
- Prev by Date: Re: loop break condition
- Next by Date: Re: loop break condition
- Previous by thread: Re: 3-argument open on STDIN
- Next by thread: Re: 3-argument open on STDIN
- Index(es):
Relevant Pages
|