#! /usr/bin/perl -w use strict; my $old_str = 'make -r -f ..\../tools/cell/makefile cell.lib'; my $new_str = ( $old_str =~ /\s+(\S*makefile)/ )[0]; print "New string: $new_str$/"; __END__