Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Prescan lines for already defined variables and put some dollar signs in
- # Very hacky as there is no catch-all case
- while ($line =~ m/\s+([\w]+)\s*/g) {
- my $match = $1;
- # print "Match: $match\n";
- chomp($match);
- if (defined($variables{$match})) {
- if ($line =~ /\s{1}$match\s{1}/g) {
- # print "Condition 1 satisfied for $match\n";
- $line =~ s/ $match / \$$match /g;
- print "$line\n";
- } elsif ($line =~ /$match[\w]{1}/g) {
- # print "Condition 2 satisfied for $match\n";
- $line =~ s/ $match/ \$$match/g;
- } else {
- # print "Condition 3 satisfied for $match\n";
- $line =~ s/$match/\$$match/g;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement