ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
Re: $& and friends
by Bill Luebkert other posts by this author
Jan 28 2008 4:32PM messages near this date
$& and friends | RE: $& and friends
Wayne Simmons wrote:
>  Ok I've read in the docs that $& and his mates $' and $` and some bad boys
>  that slow down all regular expressions in an entire program. So in an effort
>  to prevent having to use them I was going to use either:
>  @- and @+
>  Or 
>  The index function
>  
>  I was wondering if anyone knows whether the @- and @+ system variables were
>  bad like the saw ampersand and friends.  
>  
>  Also would they be better to use than searching the string again using the
>  index function?

It would help if you gave an example of what you're trying to accomplish.
I've used those vars maybe once or twice in testing, but never found a
need for them in any of my normal scripts (but then again, I bleieve number
vars ($1, $2, ...) have the same cost which I do use frequently).

It's a one-time penalty and I wouldn't really worry much about it.  You could
time it and see what the penalty actually is and see if it's warranted.


_______________________________________________
ActivePerl mailing list
ActivePerl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Gary Yang
Scott Campbell
Brian Raven
Wayne Simmons
Bill Luebkert
Wayne Simmons
Bill Luebkert
kenneth
Andy Bach
Curtis Leach

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved