in reply to How Perl Optimize your code & some code TIPS ;-P
Another approach is using variable aliasing to @_ array in subroutine calls:
This is memory efficient too.$data = 'foo' x (1024*1024) ; test($data) ; sub test { if ( $_[0] =~ /foo/s ) { print "bar\n" ;} };
--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
|
---|