I have a text file that I read in. I am trying to add words that match two different conditions to two different lists, and I am having some problems. I am hoping you all can look this over and tell me what I'm doing wrong.
open SCH, "< $runset{SchFile}" or die "Can't open $runset{SchFile}";{ local $/ = ".ENDS\n"; } while (<SCH>) { # Only look in our subckt of intrest! if ( m/^\.SUBCKT\s+($runset{SchCell})/ ){ print "\nFound $runset{SchCell}\n"; # For each word in the whole thing see if it matches the # two lists my ($word, %seen); $word = $_; foreach $word (@_) { print "$word"; if ($word =~ m/VDD|VCC/){ print "Matched VDD $word\n"; push @PN, $word if !$seen{Power}++; }elsif ($word =~ m/VSS|GND/){ print " Matched VSS $word\n"; push @GN, $word if !$seen{GND}++; } } } } close SCH; --DATA-- .SUBCKT FOO X y Z .PININFO test VDD VDD VDD Vss vdd VSS t y foo blah blah bla .ENDS .SUBCKT test2 vdds VSS VDD .PININFO test2 2FS SEL blah blah blah .ENDS --DATA--
Thanks so much for your help!
The <it>seeker</it> of perl wisdom. In reply to Adding elements to an array from an array
by Rhodium
For:
Use:
& & < < > > [ [ ] ]