Raymond Wan wrote:
Alan Haggai Alavi wrote:

On 8 April 2010 11:00, Raymond Wan <r....@aist.go.jp> wrote:
for (my $i = 0; $i < length ($buffer); $i += 4) {
print unpack ('I', $buffer[$i].$buffer[$i + 1].$buffer[$i + 2].$buffer[$i +
3]), "\n";
}

Wildcards can be used within the template in pack. There is no need of
the inner loop you have written. For example, to unpack all signed
longs:

my @signed_longs = unpack ( 'I*', $buffer );

Ah! Wildcards...never saw that one coming... I presumed I was just misunderstanding the perldocs.

Strange usage of the term "wildcard" here.
I think "quantifier" is more appropriate.

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to