in reply to Modifying value of $1 clobbers $2, $3 etc?

liz has the problem nailed down exactly. The solution, of course, is simple:

if ( $str =~ /^Title: (.*)\s+Author: (.*)\s+ISBN: (.*)/ ) { my ($title, $author, $isbn) = ($1,$2,$3); $author =~ s/\.//g; # Remove full stops print "<$title><$author><$isbn>"; # Do more stuff... }

$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/