Help for this page

Select Code to Download


  1. or download this
      my $filename = shift @_;
    
    ...
      my $first  = shift;
      my $second = shift;
      my $third  = shift;
    
  2. or download this
    public static void do_something(String str) {
       System.out.println("got " + str);
    ...
    public static int do_something() {
       return 42;
    }
    
  3. or download this
    sub do_it {
       my ($str,$numb) = @_;
    ...
    do_it('Hello World');
    do_it('lucky number',7);
    print "the answer is ", do_it(), "\n";
    
  4. or download this
    def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
        while 1:
    ...
    quit = 0
    while not quit:
       quit = ask_ok(prompt = 'Do you really want to quit?')
    
  5. or download this
    use strict;
    
    ...
    while (not $quit) {
       $quit = ask_ok({prompt => 'Do you really want to quit?'});
    }
    
  6. or download this
    use strict;
    use base qw(Attribute::Default);
    ...
    while (not $quit) {
       $quit = ask_ok(prompt => 'Do you really want to quit?');
    }