I want an output of my file where I need to substitute all tabs with spaces and put \a at the beginning of each line. Please advise
what I am doing wrong with the last two substitute attempts:
$db = 'aaa.txt';
open(DATA, "$db" or die "did not open: $!\n";
@dat = (<DATA>);
close(DATA);
open(DATA, "$db" or die "did not open part 2: $!\n";
foreach $line (@dat)
{
$line =~ s/main/index/g;
$line =~ s/\t/\s/g; #This is not working
$line =~ s/\a/^/g; #This is not working
print $line;
}
close(DATA);