#!/usr/bin/perl # Demonstrate different loops for use with string substitutions use strict; use warnings; # use diagnostics; my $NewRev = "\tabc\tkis17.1.33en_12345.exe\n\n"; $NewRev = $RedirectUrl =~ s/.*kis17/17/r =~ s/.exe//r =~ s/en_/./r ; print "run on line: \$RedirectUrl = <$RedirectUrl>\n\n"; for ($NewRev = $RedirectUrl) {s/.*kis17/17/; s/.exe//; s/en_//; } print "for at the start: \$RedirectUrl = <$RedirectUrl>\n\n"; END