Q:

Why isn't this perl prog printing about the translated text?

I am new to perl and programming in general, and I just found out about regular expressions and the substitution operator.
#!/usr/bin/perl

open(LEET, "leet.txt") or die "Can't open leet.txt: $!\n";
while($line = <LEET>) {
    $line =~ s/4/a/gi, s/3/e/gi;
}
print $line;

Why doesn't his print anything? I want to make a leet speak translator that opens up a text file and prints out the translated text.

A:

You are only printing the last line. Try moving the print inside your loop:
while($line = <LEET>) {
    $line =~ s/4/a/gi;
    $line =~ s/3/e/gi;
    print $line;
}

I've also used two separate regex substitutions, you can't combine them in the way you've shown in your question.
Note that Perl also has the tr operator, which is another way of doing both (single-character) substitutions in one step:
$line =~ tr/43/ae/;

