Difference is due to the different behaviour of reverse() dependent on (list|scalar) context; see the perldoc on it. In the "non working" case, printf() causes the list context for func1() causes the list context for reverse(). Try forcing the scalar context...
printf("String after: %s\n\n", scalar func1($buf));
In reply to Re^2: Module Style and Usage
by parv
in thread Module Style and Usage
by ozboomer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |