#!/usr/bin/perl use strict; use warnings; my $string = 'belp;2015-06-25 10:40:01;uptime 20037241.55'; my @a = split(";", $string); my @b = split(" ", $a[2]); my $uptime = $b[1]; print "$uptime\n";