$ cat names
projectname_flag_jantemp
projectname_flag_febtemp
projectname_flag_marchtemp
projectname_flag_mondaytemp
$
Perl code:
my $infile = "names";
open my $fpi, '<', $infile or die "$!";
while (<$fpi>) {
my $temp = # what should come here? #
func($temp);
}
I want temp to have
jan
feb
march
monday
respectively.
The pattern always remains the same
projectname_flag_<>temp
How should I do the extraction?