perl5.16

Perl REST client, authentication issue

我与影子孤独终老i 提交于 2019-12-12 13:18:36
问题 I am using Perl 5.16 with REST::Client for REST call with GET, but it shows an error 401 authentication issue. I am not clear how to resolve this issue. Code use REST::Client; use JSON; use Data::Dumper; use MIME::Base64; my $username = 'test'; my $password = 'test'; my $client = REST::Client->new(); $client->setHost('http://myurl'); my $headers = { Accept => 'application/json', Authorization => 'Full' . encode_base64($username . ':' . $password) }; $client->GET('folder/file', $headers);

qr operation in perl 5.16

泄露秘密 提交于 2019-12-04 07:09:35
问题 I am trying to fix a very old script, which is trying to find a string FILE_DESC_LIMIT in a text file and change it to something else. For this my current script which is working fine on Perl 5.10 I see it uses a regular expression qr!^FILE_DESC_LIMIT=\d+(\s*)!; But this is not working in Perl 5.16 , so I tried to print this expression. In 5.10 I see (?-xism:\bFILE_DESC_LIMIT=\d+(\s*)) While in Perl 5.16 i see (?^:^FILE_DESC_LIMIT=\d+(\s*)) I see qr was adding -xism while it not adding it in

qr operation in perl 5.16

☆樱花仙子☆ 提交于 2019-12-02 10:46:44
I am trying to fix a very old script, which is trying to find a string FILE_DESC_LIMIT in a text file and change it to something else. For this my current script which is working fine on Perl 5.10 I see it uses a regular expression qr!^FILE_DESC_LIMIT=\d+(\s*)!; But this is not working in Perl 5.16 , so I tried to print this expression. In 5.10 I see (?-xism:\bFILE_DESC_LIMIT=\d+(\s*)) While in Perl 5.16 i see (?^:^FILE_DESC_LIMIT=\d+(\s*)) I see qr was adding -xism while it not adding it in 5.16, why there is a difference here? If I add it explicitly in my regular expression, it works. But I