M
MM
Hi all,
I am trying to write a perl script to do some simple modifications to a text
file. Amongst other things it has to delete a few lines. Here is a relevant
part of my script:
LINE: while ($line = <OF>) {
if ((/END_ADDRESS_SPACE/) && ($count2 < 3)) {
$count2 += 1;
$line = <OF>;
do {
$line = <OF>;
} until ($line == /ADDRESS_SPACE/);
next LINE;
}
print NF $line;
}
The lines that I am trying to skip contain forward slashes and that seems to
confuse the match in the until statement...
END_ADDRESS_SPACE;
///////////////////////////////////////////////////////////////////////////////
//
// Processor 'ppc405_0' address space
'plb_bram_if_cntlr_1_bram_combined' 0xFFFE8000:0xFFFEFFFF (32 KB).
//
///////////////////////////////////////////////////////////////////////////////
ADDRESS_SPACE plb_bram_if_cntlr_1_bram_combined RAMB16
[0xFFFE8000:0xFFFEFFFF]
Thanks,
/Mikhail
I am trying to write a perl script to do some simple modifications to a text
file. Amongst other things it has to delete a few lines. Here is a relevant
part of my script:
LINE: while ($line = <OF>) {
if ((/END_ADDRESS_SPACE/) && ($count2 < 3)) {
$count2 += 1;
$line = <OF>;
do {
$line = <OF>;
} until ($line == /ADDRESS_SPACE/);
next LINE;
}
print NF $line;
}
The lines that I am trying to skip contain forward slashes and that seems to
confuse the match in the until statement...
END_ADDRESS_SPACE;
///////////////////////////////////////////////////////////////////////////////
//
// Processor 'ppc405_0' address space
'plb_bram_if_cntlr_1_bram_combined' 0xFFFE8000:0xFFFEFFFF (32 KB).
//
///////////////////////////////////////////////////////////////////////////////
ADDRESS_SPACE plb_bram_if_cntlr_1_bram_combined RAMB16
[0xFFFE8000:0xFFFEFFFF]
Thanks,
/Mikhail