<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>alexyz &#187; Perl</title>
	<atom:link href="http://alexyz.com/category/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexyz.com</link>
	<description>developer notes</description>
	<lastBuildDate>Thu, 15 Mar 2012 22:48:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Perl valid email regular expression</title>
		<link>http://alexyz.com/perl-valid-email-regular-expression/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=perl-valid-email-regular-expression</link>
		<comments>http://alexyz.com/perl-valid-email-regular-expression/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 20:23:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://alexyz.com/?p=1213</guid>
		<description><![CDATA[# Check for valid email address / ^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$ /]]></description>
			<content:encoded><![CDATA[<p># Check for valid email address</p>
<p>/<br />
^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$<br />
/</p>
]]></content:encoded>
			<wfw:commentRss>http://alexyz.com/perl-valid-email-regular-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl string substitution substr</title>
		<link>http://alexyz.com/perl-string-substitution-substr/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=perl-string-substitution-substr</link>
		<comments>http://alexyz.com/perl-string-substitution-substr/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 20:16:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://alexyz.com/?p=1202</guid>
		<description><![CDATA[example: my $text = &#8220;This is one heck of a story&#8221;; my $swap = &#8220;heck&#8221;; my $replacement = &#8220;hell&#8221;; substr($text, index($text, $swap), length($swap), $replacement); print $text;]]></description>
			<content:encoded><![CDATA[<p>example:</p>
<p>my $text = &#8220;This is one heck of a story&#8221;;</p>
<p>my $swap = &#8220;heck&#8221;;</p>
<p>my $replacement = &#8220;hell&#8221;;</p>
<p>substr($text, index($text, $swap), length($swap), $replacement);</p>
<p>print $text;</p>
]]></content:encoded>
			<wfw:commentRss>http://alexyz.com/perl-string-substitution-substr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl chop chomp</title>
		<link>http://alexyz.com/perl-chop-chomp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=perl-chop-chomp</link>
		<comments>http://alexyz.com/perl-chop-chomp/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 20:14:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://alexyz.com/?p=1200</guid>
		<description><![CDATA[sub spacer { print &#8220;&#60;br /&#62;&#8221;; } my $text = &#8220;This is one heck of a story&#8221;; # remove the last character print chop($text); spacer(); # returns y print $text; spacer(); # we can see that it also DID alter the variable # remove newlines from the end of a string only $text = $text [...]]]></description>
			<content:encoded><![CDATA[<p>sub spacer</p>
<p>{ print &#8220;&lt;br /&gt;&#8221;; }</p>
<p>my $text = &#8220;This is one heck of a story&#8221;;</p>
<p># remove the last character</p>
<p>print chop($text); spacer(); # returns y</p>
<p>print $text; spacer(); # we can see that it also DID alter the variable</p>
<p># remove newlines from the end of a string only</p>
<p>$text = $text . &#8220;\n\n&#8221;;</p>
<p>print $text; spacer();</p>
<p>print chomp($text); spacer(); # again, returns # of items &#8220;chomp&#8221;ed <img src='http://alexyz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>print $text; spacer();</p>
]]></content:encoded>
			<wfw:commentRss>http://alexyz.com/perl-chop-chomp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl output pretty HTML</title>
		<link>http://alexyz.com/perl-output-pretty-html/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=perl-output-pretty-html</link>
		<comments>http://alexyz.com/perl-output-pretty-html/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 20:11:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://alexyz.com/?p=1198</guid>
		<description><![CDATA[# outputting pretty HTML # basically a matter of including \n # and using Perl qq function my (@time,@days,@months,$time,$days,$months); @time = localtime; @days = qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday); @months = qw(January February March April May June July August September October November December); print qq(\n&#60;html&#62;\n&#60;head&#62;\n&#60;title&#62;Get the date&#60;/title&#62;\n&#60;/head&#62;\n&#60;body&#62;\n); print qq(Today is &#60;strong&#62;$days[$time[6]], $months[$time[4]] $time[3]&#60;/strong&#62;.); [...]]]></description>
			<content:encoded><![CDATA[<p># outputting pretty HTML</p>
<p># basically a matter of including \n<br />
# and using Perl qq function</p>
<p>my (@time,@days,@months,$time,$days,$months);</p>
<p>@time = localtime;</p>
<p>@days = qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday);</p>
<p>@months = qw(January February March April May June July August September October November December);</p>
<p>print qq(\n&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;Get the date&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n);</p>
<p>print qq(Today is &lt;strong&gt;$days[$time[6]], $months[$time[4]] $time[3]&lt;/strong&gt;.);</p>
<p>print &#8220;\n&lt;/body&gt;\n&#8221;;</p>
<p>print &#8216;&lt;/html&gt;&#8217;;</p>
]]></content:encoded>
			<wfw:commentRss>http://alexyz.com/perl-output-pretty-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>session_start() php when to do it again!</title>
		<link>http://alexyz.com/session_start-php-when-to-do-it-again/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=session_start-php-when-to-do-it-again</link>
		<comments>http://alexyz.com/session_start-php-when-to-do-it-again/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 22:18:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://alexyz.com/?p=332</guid>
		<description><![CDATA[I was stuck for a bit there. I have a page that loads via AJAX, but I had to modify it to work for Google&#8217;s googlebot #! system&#8230; The googlebot logic senses that it&#8217;s googlebot, and uses PHP includes instead of the AJAX! Well the includes don&#8217;t need the session_start() again, but the AJAX loads [...]]]></description>
			<content:encoded><![CDATA[<p>I was stuck for a bit there.</p>
<p>I have a page that loads via AJAX, but I had to modify it to work for Google&#8217;s googlebot #! system&#8230;</p>
<p>The googlebot logic senses that it&#8217;s googlebot, and uses PHP includes instead of the AJAX!</p>
<p>Well the includes don&#8217;t need the session_start() again, but the AJAX loads DO!</p>
<p>So, NOT to be forgotten, session_start() will work per LOAD, hard to explain that, but you can wrap your head around it&#8230;</p>
<p>fancy!</p>
<p>BETTER SOLUTION: Sessions manager class, framework or similar&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://alexyz.com/session_start-php-when-to-do-it-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl Regular Expressions cheat sheet</title>
		<link>http://alexyz.com/perl-regular-expressions-cheat-sheet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=perl-regular-expressions-cheat-sheet</link>
		<comments>http://alexyz.com/perl-regular-expressions-cheat-sheet/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 14:35:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://alexyz.com/?p=135</guid>
		<description><![CDATA[/.*/ : matches anything /.*oose/ : wild card .* [] : class [a-z] : any lower case letter [A-Z] : any upper case letter [a-zA-Z] : any upper or lower case letter, notice runs together [a-zA-Z0-9] : any upper/lower or zero to nine [ a-z] : any lower case letter OR a space! [\-] : [...]]]></description>
			<content:encoded><![CDATA[<p>/.*/ : matches anything<br />
/.*oose/ : wild card .*</p>
<p>[] : class<br />
[a-z] : any lower case letter<br />
[A-Z] : any upper case letter<br />
[a-zA-Z] : any upper or lower case letter, notice runs together<br />
[a-zA-Z0-9] : any upper/lower or zero to nine<br />
[ a-z] : any lower case letter OR a space!<br />
[\-] : any hyphen, notice the excerpting from special inner  expression functionality \<br />
[^a] : negated class, match if sentence does NOT have &#8216;a&#8217;</p>
<p>shorthands:<br />
\d = [0-9]<br />
\D = [^0-9]<br />
\w = [a-zA-Z0-9_]<br />
\s = [ \t\n\r\f]<br />
\S = [^ \t\n\r\f]</p>
<p>In search string NOT classes additional things:<br />
^ at beginning means it must start to match<br />
$ at the end means it must end to match<br />
\b then string means must be beginning of word<br />
string then \b means it must be end of word<br />
\B before or after means it must NOT be start or end</p>
<p>example:<br />
my $example = &#8220;This is still a very strange sentence&#8221;;<br />
if($example =~ m/\bstill\b/){ print &#8220;This string HAS the exact word  &#8216;still&#8217; in it somewhere at least once, not a variation thereof such as  stillness&#8221;; }</p>
<p>example 2:<br />
my $phone = (000) 000-0000;<br />
if($phone =~ /^\(\d\d\d\) \d\d\d\d$/) { print &#8220;phone number  formatted correctly&#8221;; }</p>
]]></content:encoded>
			<wfw:commentRss>http://alexyz.com/perl-regular-expressions-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

