Thread perlop "eq" (17 answers)
Opened by catweasel at 2008-08-29 21:58

catweasel
 2008-08-29 21:58
#114098 #114098
User since
2008-08-29
13 Artikel
BenutzerIn
[default_avatar]
Hi,

wie kann man das schreiben, dass es funktioniert:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/perl -w
use strict;


my @array = qw/ eins zwei drei /;

while ( @array ) {

        my $count = 1;

        foreach ( @array ) {
                print $count++, " ", $_, "\n";
        }
        
        print "Auswahl: ";
        chomp ( my $aw = <STDIN> );
        
        print "\neins\n\n" if $aw == 1;
        print "\nzwei\n\n" if $aw == 2;
        print "\ndrei\n\n" if $aw == 3;
        exit if $aw eq 'exit';
}

View full thread perlop "eq"