Calculations

2009-11-17 205 words 1 min read

<img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/perl-one-liners.jpg" alt="Perl One Liners" align="bottom" />This is the third part of a seven-part article on famous Perl one-liners. In this part I will create various one-liners for calculations. See <a href="http://www.catonmat.net/blog/perl-one-liners-explained-part-one/">part one for introduction of the series.

Famous Perl one-liners is my attempt to create “perl1line.txt” that is similar to “<a href="http://www.catonmat.net/blog/awk-one-liners-explained-part-one/">awk1line.txt” and “<a href="http://www.catonmat.net/blog/sed-one-liners-explained-part-one/">sed1line.txt” that have been so popular among Awk and Sed programmers.

The article on famous Perl one-liners will consist of at least seven parts:

  • <a href="http://www.catonmat.net/blog/perl-one-liners-explained-part-one/">Part I: File spacing.
  • <a href="http://www.catonmat.net/blog/perl-one-liners-explained-part-two/">Part II: Line numbering.
  • Part III: Calculations (this part).
  • Part IV: String creation. Array creation.
  • Part V: Text conversion and substitution.
  • Part VI: Selective printing and deleting of certain lines.
  • Part VII: Release of perl1line.txt.

After I’m done explaining all these one-liners, I’ll publish an ebook. Everyone who’s subscribed to my blog will get a free copy! <a href="http://www.catonmat.net/feed/">Subscribe now!

The one-liners will make heavy use of Perl special variables. A few years ago I compiled all the Perl special variables in a single file and called it <a href="http://www.catonmat.net/blog/perls-special-variable-cheat-sheet/">Perl special variable cheat-sheet. Even tho it’s mostly copied out of <a href="http://perldoc.perl.org/perlvar.html">perldoc perlvar, it’s still handy to have in front of you, so print it.

Read more…………

URL: <a href=\"http://feedproxy.google.com/~r/catonmat/~3/KqbejYcmAtQ/\">http://feedproxy.google.com/~r/catonmat/~3/KqbejYcmAtQ/</a>
\"Reblog

Related Articles:


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it