+use Maasha::Biopieces;
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+my ( $options, $in, $out, $record, $search, $replace, $delete, $key );
+
+$options = Maasha::Biopieces::parse_options(
+ [
+ { long => 'keys', short => 'k', type => 'list', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'search', short => 's', type => 'string', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'replace', short => 'r', type => 'string', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'delete', short => 'd', type => 'string', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ ]
+);
+
+$in = Maasha::Biopieces::read_stream( $options->{ "stream_in" } );
+$out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } );
+
+$search = $options->{ "search" } || "";
+$replace = $options->{ "replace" } || "";
+$delete = $options->{ "delete" } || "";
+
+while ( $record = Maasha::Biopieces::get_record( $in ) )
+{
+ foreach $key ( @{ $options->{ "keys" } } )
+ {
+ if ( exists $record->{ $key } )
+ {
+ if ( $search and $replace ) {
+ eval "\$record->{ $key } =~ tr/$search/$replace/";
+ } elsif ( $delete ) {
+ eval "\$record->{ $key } =~ tr/$delete//d";
+ }
+ }
+ }
+
+ Maasha::Biopieces::put_record( $record, $out );
+}
+
+Maasha::Biopieces::close_stream( $in );
+Maasha::Biopieces::close_stream( $out );
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+BEGIN
+{
+ Maasha::Biopieces::status_set();
+}
+
+
+END
+{
+ Maasha::Biopieces::status_log();
+}
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+