String::Replace::Safe - Performs arbitrary replacement in strings, safely


  use String::Replace::Safe ':all';
  print replace('hello name', 'name' => 'world');
  print unreplace('hello world', {'name' => 'world'});
  my $r = String::Replace::Safe->new('name' => 'world');
  print $r->replace('hello world');


String::Replace::Safe is a safe version of the String::Replace library. That is that this version does not depend on the order of evaluation of the argument to its function. This version is also consistently slower than the unsafe version (by a factor of approximately 50%).

Apart from that, the interface of the safe version is exactly the same (both functionnal and object oriented) as the interface of the String::Replace library. Hence the absence of documentation here.


Please report any bugs or feature requests to, or through the web interface at


Mathias Kende (


Version 0.02 (January 2013)


Copyright 2013 © Mathias Kende. All rights reserved.

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

1 POD Error

The following errors were encountered while parsing the POD:

Around line 142:

=cut found outside a pod block. Skipping to next block.