#!/usr/bin/perl use strict; my $abc = 'a;b;c;d'; my ($a, $b) = (split(';',$abc))[0,1]; print "$a and $b";