use strict; use warnings; use Data::Dumper; while() { print "$1\n" if($_ =~ /([><=!]+)/g) } __DATA__ $this vinoth $that $this >= $that $this gt $that $this != $that $this ne $that $this == $that $this eq $that