taking 3 characters

taking 3 characters

am 19.12.2006 16:57:46 von Eko Budiharto

--===============1918742829==
Content-Type: multipart/alternative; boundary="0-2136024458-1166543866=:8234"
Content-Transfer-Encoding: 7bit

--0-2136024458-1166543866=:8234
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,
I am looking for a way to take 3 characters ('PJD') out of PJD001012 an=
d use it in the if statement. What I can remember there is a function in =
VB, Java (left), which left ($word, 3) it means takes 3 characters out fr=
om the real value of $word from left or beginning of words. I am reading =
in the perl doc and CPAN, I cannot find the left function in perl.
=20
Is there anyway to do that in perl? Or can I do with regexp? If does, h=
ow to do it? Because I just know doing regexp in mysql (regexp '$word').
=20
I am looking forward to a favorable reply from you. Thank you.
=20
=20

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around=20
http://mail.yahoo.com=20
--0-2136024458-1166543866=:8234
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,
I am looking for a way to take 3 characters ('PJD')&=
nbsp;out of PJD001012 and use it in the if statement. What I can remember=
there is a function in VB, Java (left), which left ($word, 3) it means t=
akes 3 characters out from the real value of $word from left or beginning=
of words. I am reading in the perl doc and CPAN, I cannot find the&=
nbsp;left function in perl.
 
Is there anywa=
y to do that in perl? Or can I do with regexp? If does, how to do it? Bec=
ause I just know doing regexp in mysql (regexp '$word').
I am looking forward to a favorable reply from you.&n=
bsp;Thank you.
 
 

_______=
___________________________________________
Do You Yahoo!?
Tired of=
spam? Yahoo! Mail has the best spam protection around
http://mail.y=
ahoo.com=20
--0-2136024458-1166543866=:8234--

--===============1918742829==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1918742829==--

RE: taking 3 characters

am 19.12.2006 17:05:26 von Brian Raven

From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Eko
Budiharto
Sent: 19 December 2006 15:58
To: activeperl@listserv.activestate.com
Subject: taking 3 characters

> Hi,
> I am looking for a way to take 3 characters ('PJD') out of PJD001012
and use it in the if statement. What I can > remember there is a
function in VB, Java (left), which left ($word, 3) it means takes 3
characters out from the > real value of $word from left or beginning of
words. I am reading in the perl doc and CPAN, I cannot find the
> left function in perl.
>
> Is there anyway to do that in perl? Or can I do with regexp? If does,
how to do it? Because I just know doing
> regexp in mysql (regexp '$word').

See 'perldoc -f substr'.

HTH

--
Brian Raven

_________________________________________

The information contained in this e-mail is confidential and solely
for the intended addressee(s). Unauthorised reproduction, disclosure,
modification, and/or distribution of this email may be unlawful. If you
have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message
do not necessarily reflect those of Atos Euronext Market Solutions.
_________________________________________



=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions.

L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext Market Solutions.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: taking 3 characters

am 19.12.2006 17:13:49 von JavierMoreno

This is a multi-part message in MIME format.

--===============1714928099==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C72388.AB581B7B"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C72388.AB581B7B
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

=20
Hi,
I am looking for a way to take 3 characters ('PJD') out of PJD001012 and
use it in the if statement. What I can remember there is a function in
VB, Java (left), which left ($word, 3) it means takes 3 characters out
from the real value of $word from left or beginning of words. I am
reading in the perl doc and CPAN, I cannot find the left function in
perl.
=20
Is there anyway to do that in perl? Or can I do with regexp? If does,
how to do it? Because I just know doing regexp in mysql (regexp
'$word').
=20
I am looking forward to a favorable reply from you. Thank you.
=20
----------------------
=20
Well I think it goes something like this (using regexp):
=20
$string=3D"PJD001012";
if ($string =3D~ /^(\w{3})/) {
print $1; # do whatever with the resulting substring
}
=20
The caret is the beginning of the string. The \w is a word character.
The number in curly brackets is the number of chars you want. $1 is
whatever is in the parentheses. See the perlretut documentation for
details. I would rather go the route of using regular expressions unless
you have a high constraint on performance due to the parenthesis.
=20
Javier Moreno

------_=_NextPart_001_01C72388.AB581B7B
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



charset=3Dus-ascii">


 


Hi,

I am looking for a way to take 3 characters ('PJD') out of =
PJD001012=20
and use it in the if statement. What I can remember there is a function =
in VB,=20
Java (left), which left ($word, 3) it means takes 3 characters out from =
the real=20
value of $word from left or beginning of words. I am reading in the =
perl=20
doc and CPAN, I cannot find the left function in perl.

 

Is there anyway to do that in perl? Or can I do with regexp? If =
does, how=20
to do it? Because I just know doing regexp in mysql (regexp =
'$word').

 

I am looking forward to a favorable reply from you. Thank =
you.

 

color=3D#0000ff=20
size=3D2>----------------------

color=3D#0000ff=20
size=3D2>
 


face=3DVerdana=20
color=3D#0000ff size=3D2>Well I think it goes something like this (using =

regexp):

face=3DVerdana=20
color=3D#0000ff size=3D2>
 

face=3DVerdana=20
color=3D#0000ff size=3D2>$string=3D" color=3D#000000=20
size=3D3>PJD001012";

face=3DVerdana=20
color=3D#0000ff size=3D2>if ($string =3D~ /^(\w{3})/) =
{

class=3D911570316-19122006>    face=3DVerdana color=3D#0000ff size=3D2>print $1; # do whatever with the =
resulting=20
substring

face=3DVerdana=20
color=3D#0000ff size=3D2>}

 

color=3D#0000ff>The =
caret is the=20
beginning of the string. The \w is a word character. The =
number in=20
curly brackets is the number of chars you want. $1 is whatever is in the =

parentheses. See the perlretut documentation for details. I would rather =
go the=20
route of using regular expressions unless you have a high constraint on=20
performance due to the parenthesis.

class=3D911570316-19122006> 

class=3D911570316-19122006>Javier=20
Moreno


------_=_NextPart_001_01C72388.AB581B7B--

--===============1714928099==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1714928099==--

RE: taking 3 characters

am 19.12.2006 17:42:20 von rocque.m

Here's a cool how-to on substr()

http://www.perlmeme.org/howtos/perlfunc/substr.html

Marc Rocque
Interim Director IT Services
rocque.m@gmc.edu

-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com on behalf of Brian Raven
Sent: Tue 12/19/2006 11:05 AM
To: activeperl@listserv.activestate.com
Subject: RE: taking 3 characters


From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Eko
Budiharto
Sent: 19 December 2006 15:58
To: activeperl@listserv.activestate.com
Subject: taking 3 characters

> Hi,
> I am looking for a way to take 3 characters ('PJD') out of PJD001012
and use it in the if statement. What I can > remember there is a
function in VB, Java (left), which left ($word, 3) it means takes 3
characters out from the > real value of $word from left or beginning of
words. I am reading in the perl doc and CPAN, I cannot find the
> left function in perl.
>
> Is there anyway to do that in perl? Or can I do with regexp? If does,
how to do it? Because I just know doing
> regexp in mysql (regexp '$word').

See 'perldoc -f substr'.

HTH

--
Brian Raven

_________________________________________

The information contained in this e-mail is confidential and solely
for the intended addressee(s). Unauthorised reproduction, disclosure,
modification, and/or distribution of this email may be unlawful. If you
have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message
do not necessarily reflect those of Atos Euronext Market Solutions.
_________________________________________



=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions.

L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext Market Solutions.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: taking 3 characters [solved]

am 20.12.2006 03:05:07 von Eko Budiharto

--===============1329870103==
Content-Type: multipart/alternative; boundary="0-74888523-1166580307=:23701"
Content-Transfer-Encoding: 7bit

--0-74888523-1166580307=:23701
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

thank you for your help. It's solved.

Brian Raven wrote: =20
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Eko
Budiharto
Sent: 19 December 2006 15:58
To: activeperl@listserv.activestate.com
Subject: taking 3 characters

> Hi,
> I am looking for a way to take 3 characters ('PJD') out of PJD001012
and use it in the if statement. What I can > remember there is a
function in VB, Java (left), which left ($word, 3) it means takes 3
characters out from the > real value of $word from left or beginning of
words. I am reading in the perl doc and CPAN, I cannot find the=20
> left function in perl.
>=20
> Is there anyway to do that in perl? Or can I do with regexp? If does,
how to do it? Because I just know doing=20
> regexp in mysql (regexp '$word').

See 'perldoc -f substr'.

HTH

--=20
Brian Raven=20

_________________________________________

The information contained in this e-mail is confidential and solely=20
for the intended addressee(s). Unauthorised reproduction, disclosure,=20
modification, and/or distribution of this email may be unlawful. If you=20
have received this email in error, please notify the sender immediately=20
and delete it from your system. The views expressed in this message=20
do not necessarily reflect those of Atos Euronext Market Solutions.
_________________________________________



==================== =====3D=
========
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
========
The information contained in this e-mail is confidential and solely for t=
he intended addressee(s). Unauthorised reproduction, disclosure, modifica=
tion, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immedi=
ately and delete it from your system. The views expressed in this message=
do not necessarily reflect those of Atos Euronext Market Solutions.

L'information contenue dans cet e-mail est confidentielle et uniquement d=
estinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.=
Toute copie, publication ou diffusion de cet email est interdite. Si cet=
e-mail vous parvient par erreur, nous vous prions de bien vouloir preven=
ir l'expediteur immediatement et d'effacer le e-mail et annexes jointes d=
e votre systeme. Le contenu de ce message electronique ne represente pas =
necessairement la position ou le point de vue d'Atos Euronext Market Solu=
tions.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around=20
http://mail.yahoo.com=20
--0-74888523-1166580307=:23701
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

thank you for your help. It's solved.

Brian Raven <Brian.=
Raven@aems.net>
wrote:

DDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
Fr=
om: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bou=
nces@listserv.ActiveState.com] On Behalf Of Eko
Budiharto
Sent: 19 =
December 2006 15:58
To: activeperl@listserv.activestate.com
Subject=
: taking 3 characters

> Hi,
> I am looking for a way to t=
ake 3 characters ('PJD') out of PJD001012
and use it in the if stateme=
nt. What I can > remember there is a
function in VB, Java (left), w=
hich left ($word, 3) it means takes 3
characters out from the > rea=
l value of $word from left or beginning of
words. I am reading in the =
perl doc and CPAN, I cannot find the
> left function in perl.
&=
gt;
> Is there anyway to do that in perl? Or can I do with regexp?=
If does,
how to do it? Because I just
know doing
> regexp in mysql (regexp '$word').

See 'perldo=
c -f substr'.

HTH

--
Brian Raven

______________=
___________________________

The information contained in this e-ma=
il is confidential and solely
for the intended addressee(s). Unauthor=
ised reproduction, disclosure,
modification, and/or distribution of t=
his email may be unlawful. If you
have received this email in error, =
please notify the sender immediately
and delete it from your system. =
The views expressed in this message
do not necessarily reflect those =
of Atos Euronext Market Solutions.
___________________________________=
______



=================3D=
================
Atos Euronext Market =
Solutions Disclaimer
=================3D=
================
The information conta=
ined in this e-mail is confidential and solely for the intended addressee=
(s). Unauthorised reproduction, disclosure, modification, and/or distribu=
tion of this email may
be unlawful.
If you have received this email in error, please notify =
the sender immediately and delete it from your system. The views expresse=
d in this message do not necessarily reflect those of Atos Euronext Marke=
t Solutions.

L'information contenue dans cet e-mail est confidenti=
elle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)=
) elle est adressee. Toute copie, publication ou diffusion de cet email e=
st interdite. Si cet e-mail vous parvient par erreur, nous vous prions de=
bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail =
et annexes jointes de votre systeme. Le contenu de ce message electroniqu=
e ne represente pas necessairement la position ou le point de vue d'Atos =
Euronext Market Solutions.

_______________________________________=
________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.co=
m
To unsubscribe:
http://listserv.ActiveState.com/mailman/mysubs

&#=
32;__________________________________________________
Do You Yahoo!? r>Tired of spam? Yahoo! Mail has the best spam protection around
htt=
p://mail.yahoo.com=20
--0-74888523-1166580307=:23701--

--===============1329870103==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1329870103==--