Skip to content

fix: remove dead code from String.pm and fix Ephemeral.pm init bug#48

Open
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/remove-dead-code-string
Open

fix: remove dead code from String.pm and fix Ephemeral.pm init bug#48
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/remove-dead-code-string

Conversation

@toddr-bot

@toddr-bot toddr-bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

What

Remove 10 dead functions from String.pm (-160 lines) and fix an uninitialized variable in Ephemeral.pm.

Why

String.pm carried 10 functions that are never called from anywhere in the codebase — not from lib/, bin/, or tests. Two of them (hash2str/str2hash) call undefined escape()/unescape() functions and would crash immediately if invoked. hash2hexbits has a "fixme needs testing" comment from 2005. dump_entity depends on commented-out MIME::Parser and has unreachable code after a return. The prehash symbol was listed in @EXPORT but never defined as a function.

How

  • Removed functions: printb64table, hmac3_sha1, escape_smtp_terminator, unescape_smtp_terminator, hex_dump, hash2str, str2hash, dump_entity, hash2hexbits, clean_body
  • Cleaned @EXPORT: removed hex_dump, printb64table, prehash (the latter was never defined)
  • Removed commented-out #use MIME::Parser (only consumer was the deleted dump_entity)
  • Fixed $rv initialization in Ephemeral.pm::encode_separator() to avoid "uninitialized value" warning

Testing

Full test suite passes: 182 tests across 8 test files. All remaining exported functions (hmac_sha1, xor_key, hextobase64, base64tohex, makesis, parsesis, makesis_nue, parsesis_nue, to_batched_query, from_batched_query, findsimilar, prep_mail, hexbits2hash, hmac2_sha1, randstr, round, debugobj, fisher_yates_shuffle) are verified working.

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 2 insertions(+), 162 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

…n Ephemeral.pm

Remove 10 functions from String.pm that are never called from anywhere
in the codebase. Two of them (hash2str/str2hash) called undefined
escape()/unescape() functions and would crash if ever invoked. Others
include debug utilities, an unused MIME::Parser wrapper, and hash2hexbits
which had a "fixme needs testing" comment since 2005. Clean up @export
to remove references to deleted functions and the never-defined prehash.

Initialize $rv in Ephemeral.pm encode_separator() to avoid "use of
uninitialized value" warning under use warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@toddr toddr marked this pull request as ready for review May 20, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant