mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
29 lines
426 B
Perl
29 lines
426 B
Perl
use strict;
|
|
use warnings;
|
|
|
|
open(IN_FILE, $ARGV[0]);
|
|
open(OUT_FILE, ">", $ARGV[1]);
|
|
|
|
my @labels = ();
|
|
|
|
while (<IN_FILE>) {
|
|
if ($_ =~ /^\.(.+):/) {
|
|
push(@labels, $1);
|
|
}
|
|
}
|
|
|
|
seek IN_FILE, 0, 0;
|
|
|
|
while (<IN_FILE>) {
|
|
for (my $i = 0; $i < scalar(@labels); $i++) {
|
|
my $find = quotemeta '.' . $labels[$i];
|
|
my $replace = '$' . $labels[$i];
|
|
$_ =~ s/$find/$replace/;
|
|
}
|
|
|
|
print OUT_FILE $_;
|
|
}
|
|
|
|
close(IN_FILE);
|
|
close(OUT_FILE);
|