perl-rewrite-version - A tool to rewrite your Perl module versions


 perl-rewrite-version [options] [subdir ...]
   perl-rewrite-version --from lib/Foo/
   perl-rewrite-version --trial --no-allow-underscore -V 3.30_3 lib script
   perl-rewrite-version -LdvgD /opt/projects/Foo-Bar/
   V=v1.0.0 perl-rewrite-version
   -D, --dist-dir <dir>         distribution directory to operate on (default: current directory)
   -d, --dry-run                don't actually update files (default: disabled)
   -f, --from <file>            file to read version from
   -g, --global                 rewrite versions globally instead of just the first per file (default: disabled)
   -L, --follow-symlinks        follow symlinks when finding perl files to rewrite (default: disabled)
   -t, --trial                  mark version as a trial version (default: disabled)
   -u, --allow-underscore       allow decimal versions with underscores (default: enabled)
   -V, --set-version <version>  set version manually instead of from file
   -v, --verbose                print progress messages to STDOUT (default: disabled)


perl-rewrite-version is a command-line tool using App::RewriteVersion to update Perl module versions in a distribution. The main module's version is read, and then used to update the version in all perl files in the distribution with a version assignment. The subdirectories (relative to the distribution directory) to update versions in can be specified as arguments, defaulting to lib, script, and bin if no subdirectories are specified. The V environment variable can be used to set the "current" version instead of retrieving it from a module, and the -V option overrides the version to rewrite regardless of the current version.

Existing version assignments and new versions must be parseable with the same rules as in "DESCRIPTION" in Dist::Zilla::Plugin::RewriteVersion, that is to say, they should either be a decimal number with a single decimal point, or a tuple version with a leading v and at least 3 segments separated by decimal points. Version assignments should be in the form our $VERSION = '...';.

See the script perl-bump-version for automatic incrementing of the version across your distribution.


-D, --dist-dir <dir>

Distribution directory to operate on, defaults to current working directory.

-d, --dry-run

Run as normal but don't actually update any files. Useful with --verbose to verify expected functionality.

-f, --from <file>

File to read main version from. If unspecified, the main module of the distribution will be guessed in order to determine its version, see "current_version" in App::RewriteVersion. Ignored if the V environment variable or the -V option is set.

-g, --global

Update all instances of version assignment, instead of just the first occurrence in each file.

Follow directory symlinks when traversing the distribution for perl files to rewrite.

-t, --trial

Mark version assignment as a trial release. This will only add a # TRIAL comment to the version assignment, as the -TRIAL indication is not part of the version and should be added to the name of the archive you upload to PAUSE, which is outside of the scope of this tool.

-u, --allow-underscore

Allow decimal versions with underscores. Enabled by default, use --no-allow-underscore to disable. See "Using underscore in decimal $VERSION" in Dist::Zilla::Plugin::BumpVersionAfterRelease for more information.

-V, --set-version <version>

Override the version to use for rewriting, ignoring any existing versions and the V environment variable.

-v, --verbose

Print progress output to STDOUT.


Report any issues on the public bugtracker.


Dan Book <>


This software is Copyright (c) 2015 by Dan Book.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)


Dist::Zilla::Plugin::RewriteVersion, Version::Next