在 Perl 中,我可以做
perl -MIO::Socket::SSL=debug4 my_program.pl
Run Code Online (Sandbox Code Playgroud)
这将详细显示 SSL 握手
DEBUG: .../IO/Socket/SSL.pm:2649: new ctx 98842176
DEBUG: .../IO/Socket/SSL.pm:562: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:564: socket connected
DEBUG: .../IO/Socket/SSL.pm:586: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:619: using SNI with hostname fundresearch.fidelity.com
DEBUG: .../IO/Socket/SSL.pm:654: request OCSP stapling
DEBUG: .../IO/Socket/SSL.pm:673: set socket to non-blocking to enforce timeout=180
DEBUG: .../IO/Socket/SSL.pm:686: call Net::SSLeay::connect
DEBUG: .../IO/Socket/SSL.pm:689: done Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:699: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:709: waiting for fd to become ready: SSL wants a read first …Run Code Online (Sandbox Code Playgroud) I needed to replace the Alias 'cd' with my function named 'cd'.
I tried to remove the alias from a function, but it didn't work. The following was a simple testing script,
function remove_alias {
get-command cd
Remove-Item -Path Alias:cd
get-command cd
}
remove_alias
Run Code Online (Sandbox Code Playgroud)
I ran it from Windows 10 and native Powershell version 5.1.18362.752. The output was below. The alias didn't change
PS> . .\test_remove_alias.ps1
CommandType Name Version Source
----------- ---- ------- ------
Alias cd -> Set-Location
Alias cd …Run Code Online (Sandbox Code Playgroud) 我需要使用变量控制打印方法
我的代码如下
#!/usr/bin/perl
# test_assign_func.pl
use strict;
use warnings;
sub echo {
my ($string) = @_;
print "from echo: $string\n\n";
}
my $myprint = \&echo;
$myprint->("hello");
$myprint = \&print;
$myprint->("world");
Run Code Online (Sandbox Code Playgroud)
当我运行时,我收到以下打印函数分配错误
$ test_assign_func.pl
from echo: hello
Undefined subroutine &main::print called at test_assign_func.pl line 17.
Run Code Online (Sandbox Code Playgroud)
看起来我需要为打印函数添加命名空间前缀,但我找不到命名空间。谢谢您的任何建议!