Eksempler

* Lav <Hx> om til <Hx+1>:

  find . -type f| xargs perl -i -pe 's:<H(\d)>:"<H".($1+1).">":ge'

* Find filer, der er fælles for n kataloger:

  #!/usr/bin/perl
  @files=<*>;
  for $dir (@ARGV) {
      @files = grep(-e "$dir/$_", @files);
  }
  print join("\n",@files);
  perl -e '@files=<*>;for $dir (@ARGV) { @files = grep(-e "$dir/$_", =
  @files); } print join("\n",@files);' kataloger...

* Unikke linier:

  perl -ne '$a{$_}++ or print' files...

* Lav slidesæt:

  #!/usr/bin/perl
  $/="%\%slide";
  %than=("<" => "<", ">" => ">" );
  while(<>) {
      my @HTML;
      for (split(/\n+/,$_)) {
  	  s/(<|>)/$than{$1}/g;
  	  /^%%/ && next;
  	  /^\s*$/ && next;
  	  /^\*/ && do { push(@HTML,"<H2>",$_,"</H2>"); next; };
  	  /^  \-/ && do { push(@HTML,"<UL><H3>",$_,"</H3></UL>"); next; };
  	  /^    \+/ && 
  	      do { push(@HTML,"<UL><UL><H4>",$_,"</H4></UL></UL>"); next; };
  	  /^\S/ && do { push(@HTML,"<H1><CENTER>",$_,"</CENTER></H1>"); next; };
  	  { push(@HTML,"<PRE>",$_,"\n</PRE>"); next; };
      }
      $slide++;
      open(FH,">slide.${slide}.html") || die;
      print FH "<HTML>",@HTML,"</HTML>";
      close FH;
  }