Question: The one-liner should:

* solve a real-world problem
* not be extensively cryptic (should be easy to understand and reproduce)
* be worth the time it takes to write it (should not be too clever)

I'm looking for practical tips and tricks (complementary examples for `perldoc perlrun`).

Answer: 
*The problem*: A media player does not automatically load subtitles due to their names differ from corresponding video files.

*Solution*: Rename all \*.srt (files with subtitles) to match the \*.avi (files with video).

```
perl -e'while(<*.avi>) { s/avi$/srt/; rename <*.srt>, $_ }'

```

CAVEAT: Sorting order of original video and subtitle filenames should be the same.

Here, a more verbose version of the above one-liner:

```
my @avi = glob('*.avi');
my @srt = glob('*.srt');

for my $i (0..$#avi)
{
  my $video_filename = $avi[$i];
  $video_filename =~ s/avi$/srt/;   # 'movie1.avi' -> 'movie1.srt'

  my $subtitle_filename = $srt[$i]; # 'film1.srt'
  rename($subtitle_filename, $video_filename); # 'film1.srt' -> 'movie1.srt'
}

```
Remove MS-DOS line-endings.

```
perl -p -i -e 's/\r\n$/\n/' htdocs/*.asp

```