#!/usr/bin/perl -w #!C:/xampp/perl/bin/perl -w # # This file is part of a perl tutorial # # (C) Copyright 1999 Hans Kern # # File name : pldemo14.cgi # Created by : Hans Kern # Creation date: 25.5.99 # # Beispiel ausdruck1 ? ausdruck2 : ausdruck3 print "Content-type:text/plain\n\n"; #use strict; my $a; my $b; my $c; my $w; my $x; my $y; my $z; $x = -5; $y = -10; $z = -15; $w=3; # Definition von $w $a = $x ? $x : $y; $b = $z ? $z : $y; $c = $y ? $z : $y; if( defined ($w)){ $b=$y; } else { $b=$x; } print "a: $a\n"; print "b: $b\n"; print "c: $c\n"; print "w: $w\n"; print "x: $x\n"; print "y: $y\n"; print "z: $z\n";