Learn Perl

 

Want to learn Perl? Good tutorials can be hard to find, and many of the top tutorials that Google directs people towards were written over 10 years ago and do not teach best practices. In fact, some of the practices that they encourage are downright bad practices. If you’re just starting out with Perl and you want to learn modern Perl programming techniques and practices start with a tutorial that was written recently using a modern version of Perl.

I recommend the following guides:

Once you’ve digested the basics, move on to these more advanced topics:

  • Perl for Facebook – Write a Perl program that works with Facebook data, pulling data from and updating information on Facebook.
  • Net::Twitter – You can also write Perl apps that work with Twitter using Twitter API calls in Perl.
  • Moose – Moose is a complete object system for Perl. You can create objects from scratch using Perl, or you can use any one of dozens of modules that create objects for you. Moose is an easy to use and comprehensive object system, well worth the time to learn.
  • DBIx::Class – Object-relational mapping simplified. Store your objects in a database.
  • Dancer – A micro web application framework for Perl. Fast, lightweight, and powerful.
  • Catalyst – Web framework for Perl similar to Ruby on Rails.
  • PSGI/Plack– From the website: “PSGI is an interface between Perl web applications and web servers, and Plack is a Perl module and toolkit that contains PSGI middleware, helpers and adapters to web servers.” If you’re writing large, scalable, service-oriented web applications in Perl, check out PSGI/Plack.

Work-around for a locked-up Gnome 3 screen saver in Ubuntu 11.10

Gnome 3 has a screen saver (or more accurately a screen blanker — there are no pretty pictures) which is turned on by default and which password-protects (locks) your desktop by default when it activates. Unfortunately it’s been known to be buggy since it was released as part of Gnome 2, often refusing to unlock your screen and forcing you to reboot your system.

Users of the Gnome 3 desktop shell are reporting that for some video card and monitor combinations the Gnome 3 screen saver, after getting a key press / mouse movement that should prompt you for your password to unlock the screen:

  • Won’t unlock the screen at all.
  • Will display a mouse pointer but no password prompt.
  • Will display your original screen and all open documents (without prompting for a password) but will not allow you to click on anything, basically appearing as a locked-up desktop.

My setup reliably produces situation #3.

To unlock a locked-up desktop:

  • Ctrl-Alt-F1 will give you a text-based terminal login.
  • Log in with your user name and password.
  • Type: “killall gnome-screensaver”
  • Ctrl-Alt-F7 to get back to the (now unlocked) Gnome 3 desktop.

To replace the Gnome 3 screen saver with something less buggy:

  • Activities > Applications > Other > Synaptic Package Manager
  • Quick filter: xscreensaver
  • Right click ‘xscreensaver’ and select ‘Mark for Installation’
  • Click ‘Apply’ to install
  • Activities > Applications > System Tools  > System Settings > Screen
  • Set “Turn off after” to ‘Never’ and “Lock” to ‘OFF’. This disables gnome-screensaver.
  • Activities > Applications > All > Screensaver
  • Follow the prompts to activate xscreensaver

If you try to uninstall gnome-screensaver Synaptic Package Manager will also want to uninstall gnome and gnome-core, which is a bad idea if you want to run Gnome. Gnome will always start gnome-screensaver even if you have it disabled, and xscreensaver won’t run if gnome-screensaver is running. So you basically need to kill gnome-screensaver after Gnome has started and then start xscreensaver. You can do this by adding a startup program:

  • Activities > Applications > Other > Startup Programs > Add
  • Name: “Screen Saver”
  • Command: “sleep 30; killall gnome-screensaver; sleep 5; xscreensaver”
  • Comment: “Kill gnome-screensaver, start xscreensaver”
  • Click “Add”

Hope you find this useful.

Adding a task bar to Gnome 3 on Ubuntu 11.10

To install Gnome 3 on Ubuntu 11.10 start up a terminal and type:

sudo apt-get install gnome-shell

To use Gnome 3 instead of Unity: when you log in, click the “gear” above your password. Select “Gnome”, log in.

After you get tired of “click Activities, find the window you want, click the window” every time you want to switch from one window to another, and you decide you really need a taskbar again to maintain your sanity, start up a terminal and type:

sudo apt-get install tint2
tint2 &

You now have a taskbar again. To get it to appear every time you start Gnome 3 go to Activities > Applications > Other > Startup Applications, then click “Add”, Name: “tint2 task bar”, Command: “tint2”, click “Save”.

Done.

Hope you find this useful.