#!/usr/bin/perl use strict, use warnings; my $file = '/path/to/file'; my @array; { local $/ = "\n//\n"; open my $fh,'<',$file or die $!; @array = <$fh>; chomp @array; close $fh; }