develooper Front page | perl.perl5.porters | Postings from July 2008

RE: Alarums and Excursions (was [perl #2783] Security of ARGV using 2-argument open)

Thread Previous | Thread Next
From:
Ed Avis
Date:
July 28, 2008 07:47
Subject:
RE: Alarums and Excursions (was [perl #2783] Security of ARGV using 2-argument open)
Message ID:
7A5C308A1A3D554B8B8C0E331F7D2BB10ECCA8@wcl-exc.wcl.local
Mark Mielke <mark@mark.mielke.cc> wrote

[magic handling of special characters in <>]

>I think the only 
>part I'm missing to be 50% + 1 convinced personally is a 
>survey or some other measure on how widely used these features 
>are.

I think this is mostly unknowable.  We've done a little survey here and IIRC the answers were

- I might have used it once on Windows (me).

- You can use the trailing newline stripping for some idiom where you set ARGV from input data without chomping.

- I expect tchrist will give examples of where he likes it and uses it.

But mostly, even those who dislike the idea of making <> un-magic were not really using the special features except for golfing.  And people on this list are about the most expert perl users you will find.  If even we don't use it, chances are that hardly anyone else does.

You suggested that an 'ordinary user' of a program that happens to be written in perl and using <> might start to rely upon the magic behaviour.  But this seems to me unlikely if the magic is not mentioned in the program's documentation (and it never is).  Only someone who already knew perl would do so.  (Indeed, someone who knew more about the behaviour of <> than the original programmer knew, or at least documented.)  And most of the time, I would expect people to prefer the shell's standard facilities for redirecting input from a pipeline, which work with all programs.

-- 
Ed Avis <eda@waniasset.com> 



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About