#!/usr/bin/perl use warnings; use strict; my $file = "articles.txt"; open( FILE, "< $file" ); my @all = ; close FILE; my $temp; my ( @art, @produce, @prices, @descriptions ); foreach $temp (@all) { if ( $temp =~ m/\[(.*)\]/ ) { push @art, $1; } } foreach $temp (@all) { if ( $temp =~ m/produce=(.*)/ ) { push @produce, $1; } } foreach $temp (@all) { if ( $temp =~ m/price=(.*)/ ) { push @prices, $1; } } foreach $temp (@all) { if ( $temp =~ m/descriptions=(.*)/ ) { push @descriptions, $1; } }