Perl Programming/Keywords/pack

Previous: our Keywords Next: package

The pack keyword

edit

pack takes a LIST of values and converts it into a string using the rules defined in the TEMPLATE. The string returned is the concatenation of the appropriately converted values.

Syntax

edit
  pack TEMPLATE, LIST

Example

edit
  Following code
 pack("n/a* w/a", "hello,", "world")
outputs the line
"\000\006hello,\005world"

See also

edit
Previous: our Keywords Next: package