ukázka/skriptování-proměnné.pl
author František Kučera <franta-hg@frantovo.cz>
Tue, 13 Aug 2013 13:01:21 +0200
changeset 132 1b16c8828fc0
parent 120 4d33f14e99dd
permissions -rwxr-xr-x
zaostalé prohlížeče: textarea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
103
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
#!/usr/bin/perl
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
# Projde zdroják v javě a najde v něm,
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# jaké proměnné prostředí se nastavují pro běh skriptů
104
9224b3d36c61 #20 Skriptování: komentář
František Kučera <franta-hg@frantovo.cz>
parents: 103
diff changeset
     5
# Výstup: tělo XHTML tabulky (řádky)
103
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
use strict;
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
use warnings;
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
open(JAVA, "<", $ENV{"XWG_SKRIPTOVANI_JAVA"}) or die $!;
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
while (<JAVA>) {
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
	if (/"(.*)=".*\/\/\s+env:(.*)/) {
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
		print "<tr><td><code>$1</code></td><td>$2</td></tr>\n";
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
	}
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
}
aa91d1c6d4c1 #20 Skriptování: možnost spouštět skripty ze souborů (atribut: src).
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17