I'm a Perl newbie, trying to implement it in one of my projects and I have "Use of uninitialized value $_ in pattern match (m//)" error while executing the following code:
Output is:#!/tool/pandora64/bin/perl5.8.8 -w use strict; use warnings; my @verilogfiles = glob '*.verilog'; my ($vf, $of, $i, $j); print "Define the path for sdf_annotate.v: "; my $path = <STDIN>; chomp($path); #For verilog files foreach my $b (@verilogfiles) { open $vf, '>>', $b or die "Could not open file '@verilogfiles' + $!"; if($_ =~ /module entity\;/) { print $vf "\`include \"$path\"\n"; } } close ($vf);
Define the path for sdf_annotate.v: rwfg
Use of uninitialized value $_ in pattern match (m//) at opvrmod.pl line 38, <STDIN> line 1. Use of uninitialized value $_ in pattern match (m//) at opvrmod.pl line 38, <STDIN> line 1. Use of uninitialized value $_ in pattern match (m//) at opvrmod.pl line 38, <STDIN> line 1. Use of uninitialized value $_ in pattern match (m//) at opvrmod.pl line 38, <STDIN> line 1. Use of uninitialized value $_ in pattern match (m//) at opvrmod.pl line 38, <STDIN> line 1. Use of uninitialized value $_ in pattern match (m//) at opvrmod.pl line 38, <STDIN> line 1.
I tried the solution suggested in this website. But none worked. Any help?
In reply to Use of uninitialized value $_ in pattern match (m//) by srikdatta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |