No, create a function with the 2 optional parts as input and the string $pack_template as output.
What!? What possible merit is there is creating a function to do concatenation? Perl has an operator to do that:
my $packed = pack PACK_TEMPLATE . (condition ? OPTIONAL_ADDITION : '' +), @bits;
In reply to Re^4: Factoring out common code in two methods of a class
by BrowserUk
in thread Factoring out common code in two methods of a class
by jvector
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |