Help for this page

Select Code to Download


  1. or download this
    my $bool = not (1==1);
    if ($bool eq "") {
       print "False stringifies to the empty string.\n" 
    } else { print "Nope.\n" }
    
  2. or download this
      my $bignum = 1000;
      for (1..1000) { $bignum *= $bignum }
      print "bignum is now $bignum\n";
      my $epsilon = 1/$bignum;
      print "epsilon is now $epsilon\n";
    
  3. or download this
      my $foo = 3;
      my $x = print($foo) + 7;
    ...
      # Here print is used as a statement,
      # but mult (a function) is used as a list operator.
      print "\n";
    
  4. or download this
    print join "\n", 
            split(/\s+/,"Just Another Perl Hacker"),
            "\n";
    
  5. or download this
    int main()
    {
    ...
        sprintf (buf, "Hello %s here\n", a);
        printf ("%s", buf);
    }
    
  6. or download this
    my $count = @{[@foo, @bar, @baz]};
    print "There are $count elements altogether between the three arrays.\
    +n";
    
  7. or download this
    $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
    split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/