http://www.perlmonks.org?node_id=58799

MrNobo1024 has asked for the wisdom of the Perl Monks concerning the following question:

Why does code containing
tr///;
make B::Deparse not work?

Replies are listed 'Best First'.
Re: B::Deparse question
by MeowChow (Vicar) on Feb 16, 2001 at 10:53 UTC
    Why does code contain
    tr///;
    ? :-)

    update: Perhaps the reason is just that, to cause B::Deparse to not work. We now have a defense against those killjoy deobfuscator sorts who would arm themseleves with nothing but B::Deparse in the war against obfuscated code. And it's really quite stealthy too:

    y;;; y yyy y,,, tr,,, tr sss
    Well, you get the idea.
Re: B::Deparse question
by extremely (Priest) on Feb 16, 2001 at 11:33 UTC
    It's version .59? From the ToDo list at the beginning of the Deparse.PM file:
    # Todo: # - finish tr/// changes # - add option for even more parens (generalize \&foo change) # - {} around variables in strings ("${var}letters") # base/lex.t 25-27 # comp/term.t 11 # - left/right context # - recognize `use utf8', `use integer', etc # - treat top-level block specially for incremental output # - interpret in high bit chars in string as utf8 \x{...} (when?) # - copy comments (look at real text with $^P?) # - avoid semis in one-statement blocks # - associativity of &&=, ||=, ?: # - ',' => '=>' (auto-unquote?) # - break long lines ("\r" as discretionary break?) # - configurable syntax highlighting: ANSI color, HTML, TeX, etc. # - more style options: brace style, hex vs. octal, quotes, ... # - print big ints as hex/octal instead of decimal (heuristic?) # - handle `my $x if 0'? # - include values of variables (e.g. set in BEGIN) # - coordinate with Data::Dumper (both directions? see previous) # - version using op_next instead of op_first/sibling? # - avoid string copies (pass arrays, one big join?) # - auto-apply `-u'? # - while{} with one-statement continue => for(; XXX; XXX) {}? # - -uPackage:: descend recursively? # - here-docs? # - <DATA>?

    Your question is number one on the ToDo list. =) =)

    --
    $you = new YOU;
    honk() if $you->love(perl)