Perl regex statement function call

:date: 2012-10-12
:tags: programming, script, perl
:category: computing
:author: alf

Well I've just started tempering with Perl, honestly, knew almost nothing about it before..

I just needed to make a one-liner string substitution with a regex making a call to the rand() function, so how I got it working:

.. code-block:: shell-session

alf@melmac:~$ perl -i.bak -pe 's/01:00$/0@{[int(rand(3)+1)]}:@{[int(rand(6)).int(rand(10))]}/' /etc/backupninja.conf