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'
}

```
In response to [Ovid's Vim/ack combination](https://stackoverflow.com/questions/111868/what-is-your-latest-useful-perl-one-liner-or-a-pipe-involving-perl/113716#113716):

I too am often searching for something and then want to open the matching files in Vim, so I made myself a little shortcut some time ago (works in [Z shell](https://en.wikipedia.org/wiki/Z_shell) only, I think):

```
function vimify-eval; {
    if [[ ! -z "$BUFFER" ]]; then
        if [[ $BUFFER = 'ack'* ]]; then
            BUFFER="$BUFFER -l"
        fi
        BUFFER="vim  \$($BUFFER)"
        zle accept-line
    fi
}

zle -N vim-eval-widget vimify-eval

bindkey '^P' vim-eval-widget

```

It works like this: I search for something using ack, like `ack some-pattern`. I look at the results and if I like it, I press arrow-up to get the ack-line again and then press `Ctrl` + `P`. What happens then is that Z shell appends and "-l" for listing filenames only if the command starts with "ack". Then it puts "$(...)" around the command and "vim" in front of it. Then the whole thing is executed.