/[kvake]/add.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /add.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Thu Apr 27 10:24:11 2000 UTC (23 years, 11 months ago) by dpavlin
Branch: MAIN
Changes since 1.1: +8 -1 lines
File MIME type: text/plain
podrava neto tipa: cat | ./add.pl (pipe sa stdin-a)

1 #!/usr/local/bin/perl
2
3 # Kreira replacement stringkove za kvake.pl
4 #
5 # kori¹tenje: ./add.pl rijec1 rijec2 rijec3 [...] >> kvake.pl
6
7 open(KVAKE,">> zamjene.pl") || die "ne mogu otvoriti zamjene.pl";
8
9 my @words = @ARGV;
10 while (<>) {
11 chomp;
12 push @words,"$_";
13 }
14
15 print "Dodajem ",$#words+1," rijeèi...\n";
16 foreach $word (@words) {
17 print KVAKE "s/".replace($word)."/$word/g;\n";
18 }
19
20 close(KVAKE);
21
22 sub replace {
23
24 my $foo=$_[0];
25
26 $foo=~s/ch/è/g; $foo=~s/CH/È/g;
27 $foo=~s/cc/æ/g; $foo=~s/CC/Æ/g;
28 $foo=~s/zh/¾/g; $foo=~s/ZH/®/g;
29 $foo=~s/sh/¹/g; $foo=~s/SH/©/g;
30 $foo=~s/dh/ð/g; $foo=~s/DH/Ð/g;
31
32 return $foo;
33
34 }

  ViewVC Help
Powered by ViewVC 1.1.26