<br><br><div class="gmail_quote">On 25 October 2010 11:34, Peter Hallam <span dir="ltr">&lt;<a href="http://perth.pm">perth.pm</a>@<a href="http://inatick.com">inatick.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Mon, 25 Oct, 08:58 +0800 James Bromberger wrote:<br></div>
<br>
There&#39;s a couple of orders of magnitude difference here, something worth considering.<br>
<br>
I&#39;ve also looked at Neil&#39;s regex, which is slightly faster by about 2%, and I&#39;ve also looked at the tr// method, which is slower by about 10%<br>
<br>
Finally, if you want a concise (but slow) piece of code, I came up with:<br>
<br>
$url =~ s|([^:]+://[^/]+(:\d+)?/?)?(.*)?$|\L$1\E$3|;<br>
<br>
Regards,<br>
<font color="#888888">Peter.<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Perth-pm mailing list<br>
<a href="mailto:Perth-pm@pm.org">Perth-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/perth-pm" target="_blank">http://mail.pm.org/mailman/listinfo/perth-pm</a><br>
</div></div></blockquote></div><br>&quot;My regex&quot; was taken from a website after I did a search.  I&#39;m dreadful at regular expressions, and would never claim it.<br><br>On a similar note, what do you use Perl for?<br>
I do everything I can in it, and say to many of my clients:<br>&quot;I&#39;d rather code something in Perl in 20 minutes that do something manually in 15 minutes&quot;.<br><br>My best achievement in Perl was automating a user creation system for a company I used to work for (with the help of Sun One Identity Synchronisation Server for Windows).<br>
<br>Essentially a script was run which extracted all new users from the payroll system, then sent a list of new accounts to AD, created those accounts, created email accounts, assigned them to user groups (and mailing lists), and then dropped into Unix and created proper accounts for Unix purposes, as well as Oracle identities.  This was all based on a new person&#39;s job title (Customer Care Consultant, Credit Consultant, etc).  In the end it was about 400 lines of code in production, and around 5 times that in development.  Good times!  Alas, the company no longer exists, and I never got a copy of it when I was made redundant...<br>
<br>Neil<br><br clear="all"><br>-- <br>Neil Hunt<br>Senior Consultant<br>HuntCorp Enterprises<br>Phone: 0412 474 140<br><br>