Changes for version 0.02 - 2026-10-15

  • `dir`
    • A `dir` that is a symbolic link to a directory is listed through the link in every mode. A recursive listing with the default `cpu => 1` returned nothing for one, because `File::Find` took the link for a file, while a non-recursive listing and a recursive one with `cpu` above 1 followed it.
    • `dir => '///'` returns `/etc` and the like. Only a single trailing slash after something other than a slash was removed, so it returned `////etc`.
  • `format_commas`
    • `format_commas($n, '%.0u')` rounds half up to a whole number. The documented way to ask for a whole number appended the hundredths of any fraction without a decimal point: `1234.56` came out as `1,23456`, and `0.4` as `040`.
  • `json_file_to_ref`
    • A bare `NaN`, `Infinity` or `-Infinity` is turned into `null` only outside JSON strings. Text inside a string that looked like one in value position was rewritten too, so `"values: [1, NaN, 2]"` was read as `"values: [1, null, 2]"`.
  • `random_key` and `random_value`
    • Both leave the hash's iterator at the start, as they did before 0.01. 0.01 left it one pair in, so an `each` loop over the same hash afterwards skipped its first pair.
  • `p` and `np`
    • A `p` or `np` of the calling package's own is kept when the stub for the other one loads DDP. DDP exports both, so a package with its own `p` that called `np` had that `p` replaced by DDP's.
    • A `p` or `np` called again after DDP failed to load dies again. It looped forever, because the package was marked as loaded before the load was tried.
    • If DDP is configured to export `p` under another name (an `alias` in `~/.dataprinter`), calling `p` dies saying so. It looped forever.
  • `structure` and `st`
    • `structure` and `st` indent everything inside a scalar reference by its depth. The contents of a reference such as `{ a => { ptr => \{ x => 1 } } }` were printed one level below the top, as if they belonged to the outermost hash.
  • Test suite
    • `t/structure.t` is new and covers `structure` and `st`, which had no tests.

Modules

Small everyday helpers: directory listing, shell commands, JSON files, number formatting, and data-structure shapes