Find Jobs
Hire Freelancers

Canadian postal code range check in Perl

$30-100 USD

En curso
Publicado hace alrededor de 14 años

$30-100 USD

Pagado a la entrega
The goal of this perl function is to check if a particular postal code falls into a a number of "bad" postal code ranges ## Deliverables The goal of this perl function is to check if a particular postal code falls into a a number of "bad" postal code ranges Canadian postal code follow a format like "A0A 0A0". See wikipedia for more info [login to view URL] The range of bad postal code is explained here: [login to view URL] This table represent ranges of the three first character of the postal code. This means we completly ignore the the last three characters of the postal code. We only use the first three to check in they are in a bad range. So the first example is A0A-A0Z this means any postal that begin with A0 is bad. The ranges are saved in a mysql table in 6 columns (f1,f2,f3,f4,f5,f6). I've been using this code which works most of the time. However it doesnt work properply for range like V1Z-V2R. Trying to match V2K gives me no match when in fact it is within that range. sub Check_for_ups_surcharge { my ($postalcode, $dbh) = @_; my ($f1,$f2,$f3) = split(//,$postalcode); # we only keep the three first characters my $sth = $dbh->prepare("SELECT CONCAT(f1,f2,f3,'-',f4,f5,f6) FROM surcharge_area_ups WHERE f1 LIKE '$f1' AND '$f2' BETWEEN f2 AND f5 AND '$f3' BETWEEN f3 and f6 LIMIT 1 "); $sth->execute or die ("Couldn't execute: " . DBI->errstr); my ($surcharge_code) = $sth->fetchrow_array; my $surcharge = "No"; $surcharge = "<b><font color=red>yes</font></b>" if ($surcharge_code); return($surcharge); } So the job is create a little bit of perl/SQL to correctly check if a postal code is within one of the bad range.
ID del proyecto: 3397506

Información sobre el proyecto

6 propuestas
Proyecto remoto
Activo hace 14 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
6 freelancers están ofertando un promedio de $42 USD por este trabajo
Avatar del usuario
See private message.
$42,50 USD en 3 días
4,8 (432 comentarios)
7,4
7,4
Avatar del usuario
See private message.
$51 USD en 3 días
5,0 (82 comentarios)
5,7
5,7
Avatar del usuario
See private message.
$42,50 USD en 3 días
4,8 (28 comentarios)
4,2
4,2
Avatar del usuario
See private message.
$34 USD en 3 días
5,0 (3 comentarios)
3,6
3,6
Avatar del usuario
See private message.
$46,75 USD en 3 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
See private message.
$34 USD en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de CANADA
montreal, Canada
5,0
4
Miembro desde nov 15, 2010

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.