nursyza has asked for the wisdom of the Perl Monks concerning the following question:
I'm a newbie in Perl. I need some help with this coding.
MODULE C17 (N1, N2, N3, N6, N7, N22, N23);
Based on the line above, I want to program so that it will print out only the name "MODULE C17".
Here is the coding that I tried but it prints out the whole line.
my $MODULE_NAME = $_; if (defined($MODULE_NAME) && ($MODULE_NAME =~ /MODULE (.*);/)) { my $module_name = $1; print "Module name = $module_name\n"; }
Back to
Seekers of Perl Wisdom