Help for this page

Select Code to Download


  1. or download this
    $system1 = <STDIN>;   # this is manual input from the keyboard
    #...
    $system1 =~ s/\W.*//;  # what if input was " box1" (initial space)?
    #...
    
  2. or download this
    ( $system1 = <STDIN> ) =~ s/^\W*(\w+).*/$1/s;
    
  3. or download this
    my %systems = ( box1 => 1, box2 => 2 );
    
    ...
    die $Usage unless ( @ARGV == 1 and $systems{$ARGV[0]} );
    
    $system1 = lc( shift );