Showing posts with label #perl. Show all posts
Showing posts with label #perl. Show all posts

Monday, June 9, 2014

[Solved] PERL Programming Challenge

Fancy your PERL programming skills ? Take this challenge and answer these simple 5 questions on PERL.
Update : Added solutions


  1. How do I eliminate the newline character from the input variable $age in PERL ?
      • chomp($age);

  2. Write a PERL one-liner to convert tab spaces in a file called tabs.txt to one space each
      • perl -pe 's/\t/ /g' tabs.txt;

  3. How do you empty the contents of an array called : myarray in PERL?
      • $#myarray = -1;

  4. How do I append a new line containing the text “Get water” before the 3rd line of a file : todo.txt using PERL ?
      • perl -pe 'print "Get water\n" if $. == 3’ todo.txt;

  5. How do you download the contents of a URL with PERL ?
      • By using LWP.pm [ Perl Module ]
      • use LWP::Simple;
      • $webdata = get ‘http://your-website.com';

Monday, June 2, 2014

Linux Weekly NewsBytes : 1424

Here is a list of the latest, most happening events and news items from the Linux World. Keep reading to find out what's making the most noise around Linux this week

  • Came across a short and sweet article that describes the simple steps to installing printers on your Linux machine, be it a local printer or a network printer. Read it to find out how simple the entire process is
The Linux Foundation will pay you for working on Open Source Projects

  • Yea, you read it correct. They will pay you. The Linux Foundation has decided to fund some selected, highly critical projects. This seems to have been triggered by the HeartBleed bug. I see this as a good way to avoid future HeartBleeds. The first projects selected for audit are OpenSSL, OpenSSH and NTP
  • This is first major release after 5.18 and has been released after 12 months of hard work. Next release is planned for May 2015.