Help for this page

Select Code to Download


  1. or download this
    my $foo="asdhflakjsdfhlaksjdfhlaksdjfhalks";
    $foo =~ s/(.{20}).{3,}/$1../;
    print "-"x 20, "\n";
    ...
    $foo =~ s/(.{20}).{3,}/$1../;
    print "-"x 20, "\n";
    print $foo,"\n";
    
  2. or download this
    use integer;
    my $foo="Just another perl hacker";
    ...
    sub f2 {
    ($_,$l)=@_;$s=$l-3;$n=$s/2;$m=$n+($s&1);s/(.{$m}).*(.{$n})/$1...$2/;$_
    }