martes, 15 de noviembre de 2016

My first post on Perl

So yes...I started to learn Perl...why? 3 simple reasons...

  1. I love programming.
  2. For me...Perl belongs to the whole trinity of Scripting Languages along with Ruby and Python (Sorry don't make the cut)
  3.'s Perl! Come on!

So...I have been reading Beginning awesome book by the way...

If you're using any flavor of Linux or should have Perl installed already...if you're using can always download it and install it -:)

So far...I love's pretty amazing...and now I can see why people say that both Python and Ruby heavily borrow stuff from Perl...and sure...PHP too...

I don't have of course much experience...but as always...I start doing a simple and small program to get me into the right here's my Fibonacci numbers app...
use strict;
use warnings;
use diagnostics;

sub fib {
 my ($num,$a,$b) = @_;
 my $result = '';
 if ($a>0 && $num>1){
  $result = $result . ($a+$b) . " " . fib($num-1,$a+$b,$a)
 }elsif($a == 0){
  $result = $a . " " . $b . " " . ($a+$b) . " " . fib($num-1,$a+$b,$b)
 return $result

print "Enter a number: ";
my $num = <>;


And here's the nice output...

By now...I already have my classic "LED Numbers" app ready...but that goes into another post -;)


Development Culture.

No hay comentarios: