#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $sep = '<;>'; my $string = 'a<;>eine<;>an<;>eine<;>one<;>eine<;>to have a smoke<;>eine rauchen [ugs.]<;>'; my @info = split /$sep/, $string; my @array; while( @info ){ push @array, [shift @info, shift @info]; } print Dumper \@array;