Help for this page

Select Code to Download


  1. or download this
    print "Are you sure? [y]";
    chomp(my $ans = <STDIN>);
    $ans ||= "y";
    ...
    } else {
       # do otherthing
    }
    
  2. or download this
    #!/usr/bin/perl
    print "Are you sure? [y]";
    if (<> =~ /^(y(es)?)?\n$/i) {
    ...
    else {
      # answer was no
    }