View file File name : change_email_header.pl Content :#!/usr/bin/perl use strict; my $header = shift @ARGV; my $add = shift @ARGV; $add =~ tr/+/ /; $add =~ s/\%([A-Z0-9][A-Z0-9])/pack("C",hex($1))/eg; $add .= ' ' unless $add =~ /\s$/; # read headers while (<>) { chomp; last if $_ eq ''; # end of headers! my ($h, $v) = /^(\S+): (.*)/; if (defined $h) { if ($h eq $header) { $v = $add . $v; } print "$h: $v\n"; } else { print "$_\n"; ## weird } } # sep print "\n"; # body while (<>) { print; }