2 ## Copyright (C) 2023 by jrmu <jrmu@ircnow.org>
4 ## Permission is granted to use, copy, modify, and/or distribute
5 ## this work for any purpose with or without fee. This work is
6 ## offered as-is, with absolutely no warranty whatsoever. The
7 ## author is not responsible for any damages that result from
10 # Modify the previous program to change every Fred to Wilma and
11 # every Wilma to Fred. Now input like fred&wilma should look like
12 # Wilma&Fred in the output.
18 if (scalar(@ARGV) != 1) {
19 die "Usage: $0 filename";
21 my $filepath = ($ARGV[0] =~ s/.[^.]*\z/.out/r);
22 open my $fh, ">", $filepath or die "Unable to write to '$filepath': $!";