You need a regular expression to match on wildcards like "*".
Adapt this to your situation.
The syntax is a bit weird because the letter immediately following "$user" is a word character and there has to be a way to tell where the $user variable stops and the "_ABC" begins....
use strict;
use warnings;
my $user_input = "abc";
my $regex = qr/${user_input}_ABC_.*pd/;
foreach my $file (qw (abc abc_ABC_something.pdf abc_ABC_anything.pdf
+))
{
next unless $file =~ /$regex/;
print "$file is valid\n";
}
__END__
abc_ABC_something.pdf is valid
abc_ABC_anything.pdf is valid