Store the .subckt blocks in a hash:
my %subckt; my $name; my $want; while (<DATA>) { if (my $ff = /\.subckt\s+(\w+)/ .. /\.ends/) { $name = $1 if $ff == 1; $subckt{$name} .= $_; } else { $want = $1 if /^\s*xa1\b.*\b(\w+)\s*$/; } } print $subckt{$want};
In reply to Re: Variable not set properly in perl
by Anonymous Monk
in thread Variable not set properly in perl
by sar123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |