however I was hoping there's a clever way to work with parameters in pack() itselfAs far as I can tell, there isn't one. Though I agree that would have been interesting.
this is meant to be in a CPAN package I wanted to keep it as clean as possibleI suppose that's why you don't want to put the function in its own file? Because it kind of belongs in a separate module?
Why do it even pad numbers on the right side?Because adding things on the right of your data should not change how the left part is interpreted, I guess
I just thought of another way to do what you want: pack 'H*', 'a12' =~ s/^(.(..)*)$/0$1/rxs. Still not as clear as a function though.
In reply to Re^3: Pack uneven length hex
by Eily
in thread Pack uneven length hex
by melez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |