Friday, May 28, 2010

Juniper Switches and Perl

We have some new switches at work - Juniper.  I had a few scripts that could look at a Cisco switch and I could configure and modify Cisco switches.  I had heard that the Juniper switches used Perl.  Looks like they doThere are quite a few Juniper OS (Junos) Perl modules so maybe this won't be too bad. 

Wednesday, May 12, 2010

Jr. High Math - Perl to the rescue

My daughter needed a calculator to check square roots last night.  I couldn't believe it - we didn't have one!  Well, I had my beloved HP 15C from engineering school days.  RPN is cool - right?!  Yeah, you can imagine how that went over.  So, then I grabbed a slide rule.  I know!  You guessed it - worse reaction than RPN.  So then I grabbed her Dell netbook, which was running Ubuntu Linux , and wrote a Perl hack that was basically

   print "Enter a number\n";
   $number = stdin;
   chomp $number;
   $root = sqrt $number;
   print "The square root of $number is $root\n";

Ha!  It worked and she used it.  Perl to the rescue!