<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Perl One liner basics !!]]></title>
	<link>https://bioinformaticsonline.com/pages/view/22388/perl-one-liner-basics?</link>
	<atom:link href="https://bioinformaticsonline.com/pages/view/22388/perl-one-liner-basics?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/22388/perl-one-liner-basics</guid>
	<pubDate>Sun, 24 May 2015 09:28:33 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/22388/perl-one-liner-basics</link>
	<title><![CDATA[Perl One liner basics !!]]></title>
	<description><![CDATA[<p>Perl has a ton of command line switches (see perldoc perlrun), but I'm just going to cover the ones you'll commonly need to debug code. The most important switch is -e, for execute (or maybe "engage" :) ). The -e switch takes a quoted string of Perl code and executes it. For example:<br /><br />$ perl -e 'print "Hello, World!\n"'<br />Hello, World!<br /><br />It's important that you use single-quotes to quote the code for -e. This usually means you can't use single-quotes within the one liner code. If you're using Windows cmd.exe or PowerShell, you must use double-quotes instead.<br /><br />I'm always forgetting what Perl's predefined special variables do, and often test them at the command line with a one liner to see what they contain. For instance do you remember what $^O is?<br /><br />$ perl -e 'print "$^O\n"'<br />linux<br /><br />It's the operating system name. With that cleared up, let's see what else we can do. If you're using a relatively new Perl (5.10.0 or higher) you can use the -E switch instead of -e. This turns on some of Perl's newer features, like say, which prints a string and appends a newline to it. This saves typing and makes the code cleaner:<br /><br />$ perl -E 'say "$^O"'<br />linux<br /><br />Pretty handy! say is a nifty feature that you'll use again and again.</p>]]></description>
	<dc:creator>Abhimanyu Singh</dc:creator>
</item>

</channel>
</rss>