We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All tested with perl-5.30.0
pack
$ perl -wE'use strict; $a = pack "s>s>s> s>", 1, 2, 3'
undef
$ perl -wE'use strict; $a = pack "s>s>s> s>", 1, 2, 3, undef' Use of uninitialized value in pack at -e line 1.
So, what is the difference? Why does the first not warn?
Likewise 3. pack does not warn when not enough arguments in array:
$ perl -wE'use strict; my @v = (1..3); $a = pack "s>s>s> s>", @v'
$ perl -wE'use strict; my @v = (1..5); $a = pack "s>s>s> s>", @v'
$ perl -wE'use strict; my @v = (1..3,undef); $a = pack "s>s>s> s>", @v' Use of uninitialized value $v[3] in pack at -e line 1.
It took my hours to find why
my @v = unpack "..... s>s>s>" => $input;
had three trailing zeroes where the value was generated in another process passing it through a pipe
$input = pack "..... s>s>s>", @values;
and @values was missing the three last values
The text was updated successfully, but these errors were encountered:
No branches or pull requests
All tested with perl-5.30.0
pack
does not warn when not enough arguments are passed:pack
does warn when passing explicitundef
:So, what is the difference? Why does the first not warn?
Likewise
3.
pack
does not warn when not enough arguments in array:pack
does not warn when too many arguments in array:pack
does warn when array has explicitundef
:It took my hours to find why
had three trailing zeroes where the value was generated in another process passing it through a pipe
and @values was missing the three last values
The text was updated successfully, but these errors were encountered: