my $dataFile = '/opt/ExportedPGPKeys/SampleData.txt'; my $isEncrypted = `pgp -ea +batchmode $dataFile 0xc33721`; #0xc33721 is the public key ID. print " The output value is $isEncrypted \n";