This is about the only way I ever use them - to get a function that does not need parens and behaves like an inbuilt
sub strip($); my $str = ' begone leading whitespace '; print strip $str, " ->this is extra stuff"; sub strip ($) { my $str = shift; $str =~ s/^\s+//gm; $str; }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Prototyping Subs: Good,Bad,Indifferent
by tachyon
in thread Prototyping Subs: Good,Bad,Indifferent
by knexus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |