#!/usr/bin/perl use strict; use warnings; our $list; our @clients; our $filedef1=$ARGV[0]; #name of client CSV file &read_clients (); # define regex components my $accode = qr(^"(.*)",.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*)x; my $name = qr(^.*,"(.*)",.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*,.*)x; # do regex matches print "Extractions:\n"; my @extractions = $list =~ m{(?: $name)}mxgc; print "$extractions[$_], " for 0.. $#extractions; print "End of Program!\n"; ##Beginning of subroutine for reading the document source file. sub read_clients { open FILEDEF1, "< $filedef1" or die "error reading $filedef1-$!"; while (<>) { push (@clients, ); } close FILEDEF1; $list = join(' ',@clients); print $list; } ##End of block for reading the document source file.