Actions Status MetaCPAN Release

NAME

update - Greple module to update files

SYNOPSIS

greple -Mupdate

Options:

--update
--with-backup

--diff
--diffcmd command

VERSION

Version 0.02

DESCRIPTION

This greple module substitute the target file contents by command output. For example, next command replace all words in the file to uppercase.

greple -Mupdate '\w+' --cm 'sub{uc}' --update file

Above is a very simple example but you can implement arbitrarily complex function in conjunction with other various greple options.

You can check how the file will be edited by --diff option.

greple -Mupdate '\w+' --cm 'sub{uc}' --diff file

Command sdif or cdif is would be useful to see the difference visually.

greple -Mupdate '\w+' --cm 'sub{uc}' --diff file | cdif

This module has spun off from App::Greple::subst module. Consult it for more practical use case.

OPTIONS

INSTALL

CPANMINUS

$ cpanm App::Greple::update

GITHUB

$ cpanm https://github.com/kaz-utashiro/greple-update.git

SEE ALSO

App::Greple, https://github.com/kaz-utashiro/greple

App::Greple::update, https://github.com/kaz-utashiro/greple-update

App::Greple::subst, https://github.com/kaz-utashiro/greple-subst

App::sdif, App::cdif

AUTHOR

Kazumasa Utashiro

LICENSE

Copyright 2022 Kazumasa Utashiro.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.