i have a very basic question. Since i am new to Perl, i am unable to resolve this myself. Any help will be greatly appreciated.
I am browsing through a file and searching for a string. If the string matches, i want to pick the next line. Somehow i am not able to move my file handler to the next line after pattern matches.
Input Ex:
sis_admin_role("Enter Name",
`Enter Current role,
`Enter Age);
Expected output: Enter Current role.
My code:
while(<f0>) {
chomp;
if($_ =~ /Name/) {
$next_line = <f0>;
print "$next_line[0]\n";
}
}
I am browsing through a file and searching for a string. If the string matches, i want to pick the next line. Somehow i am not able to move my file handler to the next line after pattern matches.
Input Ex:
sis_admin_role("Enter Name",
`Enter Current role,
`Enter Age);
Expected output: Enter Current role.
My code:
while(<f0>) {
chomp;
if($_ =~ /Name/) {
$next_line = <f0>;
print "$next_line[0]\n";
}
}