Help for this page

Select Code to Download


  1. or download this
    open FILE, "<$file" || die "Oops $!\n";
    
  2. or download this
    print ("Hello World!\n");
    close (FILE);
    
  3. or download this
    /foo/ ? $a += 1 : $a -= 1;
    # parses as
    ...
    # but
    $a += /foo/ ? 1 : -1;
    # will work as expected.
    
  4. or download this
    $_ = 'foo';
    
    ...
    (/foo/) ? print "Found foo\n" : print "No foo here\n";
    print /foo/   ? "Found foo\n" : "No foo here\n";
    print (/foo/) ? "Found foo\n" : "No foo here\n";