Not necessarily speed tips, but some style thing.
- Kudos on using prepare / execute.
- Instead of ->execute($var[0], $var[1], ...), why not just use ->execute(@var); or ->execute(@var[0..6]);?
- Unless I am missing something elsewhere, I don't see what DIE is. Did you perhaps mean die?
- Look into the use of my and scoping your variables in as small of a scope as needed. $mp3 as an example should be declared at the point where the new() call is made (eg: my $mp3=MP3::Tag->new(..)).
- While the if (/\.mp3$/i) { is ok, you can avoid a level of nesting by changing the enclosing if block to return unless /\.mp3$/i;. My statement becomes invalid if you wish to do something else if it does not end in mp3.
- The section where you declare @songinfo, $mp3, and @dirs is wonky. They are mixed types, and I don't think that it does what you think it does (but I could be wrong ;-)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|