[Perth-pm] Using perl?

Neil Hunt neil.hunt at huntcorp.com.au
Sun Oct 24 21:12:09 PDT 2010


On 25 October 2010 11:34, Peter Hallam <perth.pm at inatick.com> wrote:

> On Mon, 25 Oct, 08:58 +0800 James Bromberger wrote:
>
> There's a couple of orders of magnitude difference here, something worth
> considering.
>
> I've also looked at Neil's regex, which is slightly faster by about 2%, and
> I've also looked at the tr// method, which is slower by about 10%
>
> Finally, if you want a concise (but slow) piece of code, I came up with:
>
> $url =~ s|([^:]+://[^/]+(:\d+)?/?)?(.*)?$|\L$1\E$3|;
>
> Regards,
> Peter.
> _______________________________________________
> Perth-pm mailing list
> Perth-pm at pm.org
> http://mail.pm.org/mailman/listinfo/perth-pm
>

"My regex" was taken from a website after I did a search.  I'm dreadful at
regular expressions, and would never claim it.

On a similar note, what do you use Perl for?
I do everything I can in it, and say to many of my clients:
"I'd rather code something in Perl in 20 minutes that do something manually
in 15 minutes".

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).

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'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...

Neil


-- 
Neil Hunt
Senior Consultant
HuntCorp Enterprises
Phone: 0412 474 140
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/perth-pm/attachments/20101025/b69ab3e1/attachment.html>


More information about the Perth-pm mailing list