in reply to string, or integer?

You should have guessed that pack() is the opposite of unpack(). From perldoc -f pack:
my $bytes = pack("n", 9); # network byte order for 0x0009

--
[ e d @ h a l l e y . c c ]