Perl match multiple numbers from a variable similar to egrep

I want to match the number exactly from the variable which has multiple numbers seperated by pipe symbol similar to search in egrep.below is the code which i tried

#!/usr/bin/perl
my $searchnum = $ARGV[0];
my $num = "148|1|0|256";
print $num;
if ($searchnum =~ /$num/)
{
 print "found";
}
else
{
  print "not-found";
 
}
 

Expected output
perl number_match 1
found
perl number_mtach.pl 1256
not found

#!/usr/bin/perl
my $searchnum = $ARGV[0];
my $num = '(?:148|1|0|256)';
### or use a regex reference - my $num = qr/148|1|0|256/;
print $num;
if ($searchnum =~ /\b$num\b/)
{
 print "found";
}
else
{
  print "not-found";
 
}

One way:

#!/usr/bin/perl
use strict;
use warnings;

my $num = "148|1|0|256";
my $inp = $ARGV[0];

my %h1=map{$_ => 1}split(/\|/,$num);

if (exists($h1{$inp})){
        print "Found";
}else{
        print "Not Found";
}