Petras has asked for the wisdom of the Perl Monks concerning the following question:
If you can't tell just by looking at it that I'm running Windows, you probably can't help me here :~)use File::Find; open (OUT, ">filelist.txt"); find( sub { $temp = $File::Find::name; $temp =~ s/C:\/users\/User\/Music\/(.*)/$1/gi; print OUT "$temp\n"; }, "C:/users/User/Music/"); close OUT;
into two or even one lines? And does anyone know a good place to start looking for something like a brevity tutorial? I recently watched a podcast where the speaker said, "If statements are obsolete if you know how to use the space-ship operator!" I'm not so much looking to obfuscate, but I'd like to save a few keystrokes.$temp = $File::Find::name; $temp =~ s/C:\/users\/User\/Music\/(.*)/$1/gi; print OUT "$temp\n";
|
|---|