A way to approach this would be to create a pair of facilities - a 'restricted-datasource' and a 'restrict-output'.
The first causes any data obatained from that a specified source is 'auto-tainted' (to coin a phrase) - essentially one half of your I/O handle layer. Note that default input operations remain untainted (unless tainted by other means).
The second overloads the various output functions, and prevents output of any tainted data (and should throw a compile-time error).

The downside of this sort of approach, however, is that you can still fall prey to the '$a=taintsource; $b=$a; print $b;' problem. The only way to prevent that is to move all data into a complex object (that contains sensitivity information along with the data), and write operator/function overloads to operate on that object - as well as a set of new functions to raise/lower the sensitivity of an object.
The performance impact is left as an exercise...although it offers the basis for a very secure language - where you could only output data specifically flagged as outputable for that destination.
-R

In reply to Re: Re: 'Restricted' data, an additional security mechanism for Perl. by rdm
in thread 'Restricted' data, an additional security mechanism for Perl. by pjf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.