in reply to File slurping into $text and then accessing a specific line?

Depending on how you decide on the particular line. There is

my $line = ( split "\n", $_ )[$wanted_line];
which splits $_ into a list and selects a line by number or
my ($line) = /^(.*?PATTERN.*?)$/ms;
which will pick a line on what PATTERN it conatins.