BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:

Is there any other way of interpreting this error:

c:\test>junk0 '/' must follow a numeric type in unpack at c:\test\junk0.pl line 28, +<FILE> chunk 10.

than perl thinks 'v' isn't a numeric type? The line 28 is:

my $s2 = unpack 'v/A*', substr $$ref2, $p2, $n2;

I cannot reproduce it in simple tests:

$x = pack 'v/A*', 'x'x100;; print unpack 'v/A*', $x;; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

And the code has to run for a couple of hours before the problem arises. (But it does happen the first time this line of code is executed.)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re: Error: '/' must follow a numeric type in unpack
by jethro (Monsignor) on Oct 29, 2008 at 14:43 UTC

    I could reproduce the error message with a string of length 1, like this:

    my $s2 = unpack 'v/A*', "a";

    Wrong error message for the problem that the string was too short to unpack

        Yes, definitely.