Help for this page

Select Code to Download


  1. or download this
    shell$ perl -e 'my $input = <>; chomp($input);if (length($input)) { pr
    +int q(length) }; if (defined($input)) { print q(defined) };
    
  2. or download this
    if($decision eq "to be"){print "Romeo is"}
    else{print "Romeo is not"}
    
  3. or download this
    $dec eq "to be" ? print "Romeo is" : print "Romeo is not";
    
  4. or download this
    shell$ perl -e 'my $input=<>; 
             chomp $input; 
             print q(Romeo ); 
             $input ? print q(is ) : print q(is not ); 
    print qq(\ntaking ),length($input),qq( hours to decide!\n);
    
  5. or download this
    shell$ perl -e 'my $input;  # not yet defined 
             print q(Romeo );
    ...
      !defined $input ? print q(undefined ) :
             $input ? print q(is ) : print q(is not ); 
    print qq(\n taking ),length($input),qq( hours to decide!\n);