"Sputnik" help  
Sputnik Help
Language Reference - Operators - Operator qwb (Quick Byte Array)

Operator qwb

The Quick Byte Array operator.

printr qwb"Hello";
// PRINTS
// Array
// (
//     [0] => 72
//     [1] => 101
//     [2] => 108
//     [3] => 108
//     [4] => 111
// )

This is useful for defining an array of bytes in string format. It can be used to define a sequence of bytes which may be problematic to represent directly in a string, such as a binary file.

Using a foreach loop

my $array = qwb"Hello";
foreach (my $v in $array)
{
   say sprintf("Value dec %1^d hex 0x%1^X", $v);
}
// PRINTS
// Value dec 72 hex 0x48
// Value dec 101 hex 0x65
// Value dec 108 hex 0x6C
// Value dec 108 hex 0x6C
// Value dec 111 hex 0x6F

To see a list of all the operators go here.


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org