Help for this page

Select Code to Download


  1. or download this
    perl -l -n -e 'BEGIN{$sum=0;} $sum=$sum+ $1 if /(\d+)/;print $1; END {
    +print "Total: ",$sum}'
    
  2. or download this
    echo -e "a\nb\nc" | perl -lne 'next if /b/; print'
    a
    c
    echo -e "a\nb\nc" | perl -lne 'last if /b/; print'
    a
    
  3. or download this
    perl -lne 'print $s += $1 if /(\d+)/'