W
wana
I want to replace a key word in a file with a string. Here is a
segment of code cut out of a script I wrote to help me generate
desktop application links.
<code>
open TEMPLATE, './template.desktop' or
die("could not open template.desktop file\n");
my @template = <TEMPLATE>;
foreach (@template)
{
s/EXEC/$ARGV[0]/g;
s/NAME/$ARGV[1]/g;
}
open OUTFILE, ">$ENV{'HOME'}/Desktop/$ARGV[2]" or
die("could not open output file\n");
print OUTFILE @template;
close OUTFILE;
</code>
I was just wondering if there was a better way.
Thank you to all for help on this question and all previous questions
I have submitted to this group for which all responses and
particularly certain special responses have been most helpful.
wana
segment of code cut out of a script I wrote to help me generate
desktop application links.
<code>
open TEMPLATE, './template.desktop' or
die("could not open template.desktop file\n");
my @template = <TEMPLATE>;
foreach (@template)
{
s/EXEC/$ARGV[0]/g;
s/NAME/$ARGV[1]/g;
}
open OUTFILE, ">$ENV{'HOME'}/Desktop/$ARGV[2]" or
die("could not open output file\n");
print OUTFILE @template;
close OUTFILE;
</code>
I was just wondering if there was a better way.
Thank you to all for help on this question and all previous questions
I have submitted to this group for which all responses and
particularly certain special responses have been most helpful.
wana