in reply to Packing unsafe string for later context-based escaping

Hi Dallaylaen :)

In fact you are searching a module that will make all the checks for you, right?
But what in case of potential problem?

Option 1 => an exception is thrown and you will invalidate the input
Option 2 => go ahead and try to solve it with another code (your code...) => same problematic :(

Rem: your post is a good question

Perl::Critic have polities, it could help.
https://metacpan.org/pod/Perl::Critic

Peace
  • Comment on Re: Packing unsafe string for later context-based escaping

Replies are listed 'Best First'.
Re^2: Packing unsafe string for later context-based escaping
by Dallaylaen (Chaplain) on Jan 05, 2016 at 19:20 UTC

    Um, no, I'm not trying to check anything. I'm trying to pack a string which I get from a user (whether checked or not) in such a way that it is displayed in a safe manner to another user while retaining the original content for my own dark purposes.

    This may be seen as data/presentation split for a given string, where specific presentation method is common for all string and depends on which part of my software I'm currently in.

      A JSON format will not help you?