Perl Programming/Keywords/pack

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Previous: our Keywords Next: package

The pack keyword[edit | edit source]

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 | edit source]


Example[edit | edit source]

Following code
 pack("n/a* w/a", "hello,", "world")
outputs the line

See also[edit | edit source]

Previous: our Keywords Next: package