<?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>Andrew Beaton :: FAQ &#187; Perl</title>
	<atom:link href="http://andrewbeaton.net/faq/category/programming/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewbeaton.net/faq</link>
	<description>Tips from the world of a software developer</description>
	<lastBuildDate>Wed, 13 Jul 2011 17:03:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Get DateTime in YYYY-mm-dd HH:MM:SS format using Perl</title>
		<link>http://andrewbeaton.net/faq/2011/04/14/get-datetime-in-yyyy-mm-dd-hhmmss-format-using-perl/</link>
		<comments>http://andrewbeaton.net/faq/2011/04/14/get-datetime-in-yyyy-mm-dd-hhmmss-format-using-perl/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 11:54:34 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[localtime]]></category>
		<category><![CDATA[POSIX]]></category>
		<category><![CDATA[strftime]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[YYYY-mm-dd HH-MM-SS]]></category>

		<guid isPermaLink="false">http://andrewbeaton.net/faq/?p=133</guid>
		<description><![CDATA[For many years I&#8217;ve been using the long process of obtaining everything from localtime(), adding 1900 to the year etc. etc. but I&#8217;ve just come across the method below, which uses strftime from the POSIX module. use POSIX; &#160; my $DateTime = strftime &#34;%F %T&#34;, localtime $^T; This gives you: 2006-10-02 02:06:07 Now that&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>For many years I&#8217;ve been using the long process of obtaining everything from <em>localtime()</em>, adding  1900 to the year etc. etc. but I&#8217;ve just come across the method below, which uses <em>strftime</em> from the <a title="POSIX" href="http://perldoc.perl.org/POSIX.html">POSIX</a> module.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> POSIX<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$DateTime</span> <span style="color: #339933;">=</span> strftime <span style="color: #ff0000;">&quot;%F %T&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066;">localtime</span> <span style="color: #0000ff;">$^T</span><span style="color: #339933;">;</span></pre></div></div>

<p>This gives you:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">2006</span>-<span style="color: #000000;">10</span>-02 02:06:07</pre></div></div>

<p>Now that&#8217;s a lot easier!</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewbeaton.net/faq/2011/04/14/get-datetime-in-yyyy-mm-dd-hhmmss-format-using-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read MP3 ID3 Tags in Perl</title>
		<link>http://andrewbeaton.net/faq/2009/12/03/read-mp3-id3-tags-in-perl/</link>
		<comments>http://andrewbeaton.net/faq/2009/12/03/read-mp3-id3-tags-in-perl/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 20:59:12 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[id3]]></category>
		<category><![CDATA[id3 tags]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[tags]]></category>

		<guid isPermaLink="false">http://andrewbeaton.net/faq/?p=76</guid>
		<description><![CDATA[The package I use for simple tag reading is MP3::Tag, available on CPAN with more information here. The following example shows how easy it is to retrieve tags from an MP3 file. use MP3::Tag; &#160; my $file = MP3::Tag-&#62;new&#40;$filename&#41;; &#160; my &#40;$title, $track, $artist, $album, $comment, $year, $genre&#41; = $file-&#62;autoinfo&#40;&#41;; &#160; print &#34;Title: [$title]\n&#34;; print [...]]]></description>
			<content:encoded><![CDATA[<p>The package I use for simple tag reading is MP3::Tag, available on CPAN with more information <a href="http://search.cpan.org/~ilyaz/MP3-Tag-1.12/lib/MP3/Tag.pm">here</a>.</p>
<p>The following example shows how easy it is to retrieve tags from an MP3 file.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> MP3<span style="color: #339933;">::</span><span style="color: #006600;">Tag</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$file</span> <span style="color: #339933;">=</span> MP3<span style="color: #339933;">::</span><span style="color: #006600;">Tag</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$filename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$title</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$track</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$artist</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$album</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$comment</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$year</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$genre</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$file</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">autoinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Title: [$title]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Artist: [$artist]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Album: [$album]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Track: [$track]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Year: [$year]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Genre: [$genre]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Comment: [$comment]<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://andrewbeaton.net/faq/2009/12/03/read-mp3-id3-tags-in-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

