Help for this page

Select Code to Download


  1. or download this
    switch ( $foo ) {
        case ( tr/I/I/ == 1 ) { $bar = 'low' }
    ...
        case ( tr/I/I/ == 3 ) { $bar = 'high' }
        else { warn "Bad $_\n" }
    }
    
  2. or download this
    Use of uninitialized value $_ in transliteration (tr///)
    
  3. or download this
    #!perl! -w
    use strict;
    ...
    }
    
    print "Foo: $foo Bar: $bar\n";
    
  4. or download this
    given ( $foo ) {
        when ( tr/I/I/ == 1 ) { $bar = 'low' }
    ...
        when ( tr/I/I/ == 3 ) { $bar = 'high' }
        default { $bar = "drat" }
    }