You don't need the
~~ operator for simple matching,
=~ is enough. Moreover,
~~ is experimental and will change or be removed in the future, so it's better to stay away from it.
Also, when matching against a regex, don't include double quotes in it, as they are interpreted literally, but your strings don't contain them. The slashes are already the delimiters, no need for anything else.
You can use the | alternative operator inside a regex:
#!/usr/bin/perl --
use warnings;
use strict;
use feature qw{ say };
while (<DATA>) {
if (/no private key could be found for decryption|signing key not
+found|no keys found/) {
say 'Missing key(s)';
} elsif (/file not found/) {
say 'File not found'
} else {
say 'Unknown error';
}
}
__DATA__
3001:input file not found
1080:no private key could be found for decryption
1053:signing key not found
3013:no keys found
3011:invalid passphrase specified
3011:invalid passphrase specified
3090:operation failed, file not found
3028:multiple inputs cannot be sent to a single output file
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord
}map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,