Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Perl Power Tools - Saint Perl 6

1,807 views

Published on

The revitalization of the Perl Power Tools. See http://blogs.perl.org/users/brian_d_foy/2014/09/revitalizing-the-perl-power-tools.html

Published in: Technology
  • Be the first to comment

Perl Power Tools - Saint Perl 6

  1. 1. brian d foy! Saint Perl 6 Perl Power ToolsPerl Power Tools brian d foy! Saint Perl 6
  2. 2. BSD! everywhere
  3. 3. addbib apply ar arch arithmetic asa awk banner basename bc cal cat chgrp ching chmod chown clear cmp col colrm comm cp cut date dc deroff diff dirname du echo ed env expand expr factor false file find fish fold fortune from glob grep hangman head id install join kill ln lock look ls mail make man maze mimedecode mkdir mkfifo moo morse od par paste patch pig ping pom ppt pr primes printenv printf pwd rain random rev rm rmdir robots shar sleep sort spell split strings sum tac tail tar tee test time touch tr true tsort tty uname unexpand uniq units unpar unshar uudecode uuencode wc what which whois words wump xargs yes
  4. 4. http://goo.gl/upzi9j
  5. 5. s/ppt/PerlPowerTools/gi
  6. 6. #!/usr/bin/perl ! print <>;
  7. 7. NAME cat -- concatenate and print files ! SYNOPSIS cat [-benstuv] [file ...] ! DESCRIPTION The cat utility reads files sequentially, … ! The options are as follows: ! -b Number the non-blank output lines, start- ing at 1. ! -e Display non-printing characters (see the -v option), and display a dollar sign (`$') at the end of each line.
  8. 8. while (<>) { if ($squeeze_empty) { my $is_empty = /^$/; if ($is_empty && $was_empty) { next; } $was_empty = $is_empty; } ! $_ = sprintf "%6d $_", ++ $count if $number_lines || $number_non_blanks && /S/; ! $_ =~ s/$/$/ if $ends; if ($nonprinting) { $_ =~ s/([x80-xFF])/"M-" . ("x7F" & $1)/ge; $_ =~ s/([x00-x08x0B-x1F])/"^" . chr (0100 + ord $1)/ge; $_ =~ s/x7F/^?/g; } if ($tabs) { $_ =~ s/x09/^I/g; } ! print; }
  9. 9. github.com/briandfoy/ PerlPowerTools
  10. 10. www.perlpowertools.com
  11. 11. Tests!

×