CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [jwhit61] Track. Title format for audio files: Edit Log



FishMonger
Veteran / Moderator

Dec 28, 2008, 8:50 AM


Views: 9038
Re: [jwhit61] Track. Title format for audio files

The script is missing 2 very important items which should be in every Perl script you write and one specifically for your script

Code
use strict; 
use warnings;

use Cwd; # this is a core module


There is no vaild reason to use the backticks to spawn shell commands when there are Perl commands to do the exact same thing, which in this script means all of your backtick commands should go away.

Your GetArtistAlbum sub could be reduced to 1 line and will be more efficient and platform independent.

Code
sub GetArtistAlbum { 
return ( split m!/!, cwd() )[-2,-1];
}


Here are a few docs you should read.
perldoc Cwd
perldoc -f glob
perldoc -f grep
perldoc -f sort
perldoc -q quoting
perldoc perlstyle


(This post was edited by FishMonger on Dec 28, 2008, 8:51 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Dec 28, 2008, 8:51 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives