How do I choose a package name for a custom Perl module that does not collide with builtin or CPAN packages names?

The namespace Local:: has been reserved for just this purpose. No module that starts with that prefix will be accepted to CPAN or the core. Alternatively, you can use an underscore in the top-level name (like My_Corp::Session or just My_Session). All categories with an underscore have also been reserved. (This is mentioned in perlmodlib, under … Read more

How can I check if a file exists in Perl?

Test whether something exists at given path using the -e file-test operator. print “$base_path exists!\n” if -e $base_path; However, this test is probably broader than you intend. The code above will generate output if a plain file exists at that path, but it will also fire for a directory, a named pipe, a symlink, or … Read more

Why can’t I match my string from standard input in Perl?

The statement $name = <STDIN>; reads from standard input and includes the terminating newline character “\n“. Remove this character using the chomp function: print “What is your name?\n”; $name = <STDIN>; chomp($name); if ($name eq “Jon”) { print “We have met before!\n”; } else { print “We have not met before.\n”; }

OpenSSL DH Key Too Small Error

… SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small I have looked in to using LWP and raw Net:SSLeay, but the problem seems to be in the underlying OpenSSL libs. While it is caused by changes to OpenSSL the problem is actually at the server side. The server is using a weak DH key within the key exchange and … Read more