#!/usr/bin/perl -w use strict; my $string = "name = arrunich"; if ($string =~ m/= \s* (\S+)/x) { print "$1 \n"; }