S
Shotoku Taishi
#!/usr/bin/perl-w
$DIR = ".";
$hello = "hello.txt";
open(OUTPUT,">$DIR/$hello") or
die("Can't open $DIR/$hello : $!\n");
my @a = qw(
hello.exp
hallo.exp
Hola.exp
Ciao.exp
);
foreach $a (@a) {
print OUTPUT <<EOT;
file=$a log=$a\.log
EOT
}
The above generates a file hello.txt with the following output:
file=hello.exp log=hello.exp.log
file=hallo.exp log=hallo.exp.log
file=Hola.exp log=Hola.exp.log
file=Ciao.exp log=Ciao.exp.log
but I would like the output to be
file=hello.exp log=hello.log
file=hallo.exp log=hallo.log
file=Hola.exp log=Hola.log
file=Ciao.exp log=Ciao.log
How would I do this using the simple search and replace routine?
I have tried
s/\.exp\./\./g;
but the output does not seem to change.
How do I apply the search and replace routine so that it works?
Thank you in advance.
Michael
$DIR = ".";
$hello = "hello.txt";
open(OUTPUT,">$DIR/$hello") or
die("Can't open $DIR/$hello : $!\n");
my @a = qw(
hello.exp
hallo.exp
Hola.exp
Ciao.exp
);
foreach $a (@a) {
print OUTPUT <<EOT;
file=$a log=$a\.log
EOT
}
The above generates a file hello.txt with the following output:
file=hello.exp log=hello.exp.log
file=hallo.exp log=hallo.exp.log
file=Hola.exp log=Hola.exp.log
file=Ciao.exp log=Ciao.exp.log
but I would like the output to be
file=hello.exp log=hello.log
file=hallo.exp log=hallo.log
file=Hola.exp log=Hola.log
file=Ciao.exp log=Ciao.log
How would I do this using the simple search and replace routine?
I have tried
s/\.exp\./\./g;
but the output does not seem to change.
How do I apply the search and replace routine so that it works?
Thank you in advance.
Michael