my $outfile = $_."_"."$nm" for @lines ;
####
print sprintf "Have %d items\n", 0+@lines;
my $item = $lines[0];
my $outfile = $item . '_' . $nm;
print "$outfile\n";
####
#! / usr/bin/perl -w
use strict;
use warnings;
use POSIX 'strftime';
my $nm = strftime('%Y', localtime).".txt";
my @lines = map { /:([^\s]+)/ ? $1 : () } # take the stuff between the : and the first blank
grep { /Acct:/ }
; # Read a file line by line and select the lines matching Acct:
print sprintf "Have %d items\n", 0+@lines;
my $item = $lines[0];
my $outfile = $item . '_' . $nm;
print "$outfile\n";
print $outfile;
#open (OUTFILE, ">$outfile");
# do whatever with the values in @lines
#print "$_\n" for @lines;
__DATA__
foo
Acct:123
Acct:456
bar