in reply to Grab Current Line of SVG File

$_ will help you to grab current line.. Ex:- while (<$filehandler>){ print $_; # this prints line by line if ($_ =~ / # your search pattern goes here/){ } } }