[问题] use of uninitialized ....

楼主: hyffdmy (ㄚ保)   2013-04-27 12:37:36
Hi ,
程式码如下, 会有类似这样的错误
mod_spice_bulk_cut.pl tcbn28lpbwp12t30p140_141a.spi > 2
Use of uninitialized value in concatenation (.) or string at
/array9/ip/ip00_15/ip00_15j/test_perl/mod_spice_bulk_cut.pl line 27, <FILE>
line 3.
Use of uninitialized value in concatenation (.) or string at
/array9/ip/ip00_15/ip00_15j/test_perl/mod_spice_bulk_cut.pl line 27, <FILE>
line 4.
Use of uninitialized value in concatenation (.) or string at
/array9/ip/ip00_15/ip00_15j/test_perl/mod_spice_bulk_cut.pl line 27, <FILE>
line 5.
Use of uninitialized value in concatenation (.) or string at
/array9/ip/ip00_15/ip00_15j/test_perl/mod_spice_bulk_cut.pl line 27, <FILE>
line 6.
然后 这是我的输入档案的字串
.subckt LVLLH I Z VDD VDDL VSS
MM15 net46 I VSS VSS nch_mac l=30n w=4n m=1
MM10 net64 net57 VSS VSS nch_mac l=30n w=4n m=1
MM5 Z net46 VSS VSS nch_mac l=30n w=4n m=8
MM2 net57 I VSS VSS nch_mac l=30n w=4n m=1
MM14 net57 I VDDL VDDL pch_mac l=30n w=52.0n m=1
MM4 Z net46 VDD VDD pch_mac l=30n w=52.0n m=8
MM6 net49 net64 VDD VDD pch_mac l=30n w=20.0n m=3
MM17 net46 I net49 VDD pch_mac l=30n w=20.0n m=3
MM9 net44 net46 VDD VDD pch_mac l=30n w=20.0n m=3
MM16 net64 net57 net44 VDD pch_mac l=30n w=15.00n m=1
.ends
#!/usr/bin/perl -w
use strict;
open FILE, "<$ARGV[0]";
open FILEX, ">$ARGV[0].mod";
my $tmp;
while(<FILE>)
{
if ($_ =~ /^\.subckt\s+(.*)/ || $_ =~ /^\.SUBCKT/)
{
print FILEX ".subckt $1 VPP VBB\n";
}
# elsif ($_ =~ /^M(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.*)/ &&
$_ =~ /pch/)
# {
## $_ =~ s/ VDD pch/ VPP pch/;
# print FILEX $_;
# }
elsif ($_ =~ /(\w+) (.*) VSS VSS (.*)/ && $_ =~ /nch/)
{
print "$1\n";
# print FILEX "$1 $3\n";
}
else
{
print FILEX $_;
}
}
请问一下 为什么该行的$1 $3会有这样的问题???
而且吐出的字串是空的
Thanks./
作者: abliou (愚者)   2013-04-27 14:29:00
错误还警告?你用-w会有警告是正常的吧
楼主: hyffdmy (ㄚ保)   2013-04-27 15:13:00
sorry 重点不是警告 是字串没有吐出来 我觉得还满奇怪的..
作者: CindyLinz (Cindy Wang)   2013-04-27 18:00:00
你那个 && 后面也是 regex, 它跑下去就会把 $1,$3 盖掉

Links booklink

Contact Us: admin [ a t ] ucptt.com