aboutsummaryrefslogtreecommitdiff
path: root/challenge-328/deadmarshal/perl/ch-1.pl
blob: 3214e4c42dc67a399f95657693ee1691df3a2e02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env perl
use strict;
use warnings;

sub replace_all{
  my %h = map{$_ => 1} split '',$_[0];
  my @chars = grep{!exists $h{$_}} 'a'..'z';
  $_[0] =~ s/\?/$chars[0]/r
}

printf "%s\n",replace_all('a?z');
printf "%s\n",replace_all('pe?k');
printf "%s\n",replace_all('gra?te');