counting differently
am 23.02.2004 15:51:54 von Cliff
This is a multi-part message in MIME format.
--===============0161218104==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_001D_01C3F9F2.AB0BE070"
This is a multi-part message in MIME format.
------=_NextPart_000_001D_01C3F9F2.AB0BE070
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Is there a way to force a variable to walk through the alphabet the way =
it can numbers?
ie: for numbers: $k=3D0; $k=3D$k+1; would give you 1
for letters $k=3D'a'; $k=3D$k+1; this won't give you 'b'; but is there =
any way of doing this that will?
------=_NextPart_000_001D_01C3F9F2.AB0BE070
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
charset=3Diso-8859-1">
Is there a way to force a variable to =
walk through=20
the alphabet the way it can numbers?
ie: for numbers: $k=3D0; =
$k=3D$k+1; would give=20
you 1
for letters $k=3D'a'; $k=3D$k+1; this =
won't give you=20
'b'; but is there any way of doing this that =
will?
------=_NextPart_000_001D_01C3F9F2.AB0BE070--
--===============0161218104==
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
--===============0161218104==--
Re: counting differently
am 23.02.2004 16:38:21 von intertwingled
cliff@globalmagic.com wrote:
>Is there a way to force a variable to walk through the alphabet the way it can numbers?
>
>ie: for numbers: $k=0; $k=$k+1; would give you 1
>
>for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there any way of doing this that will?
>
>
>----------------------------------------------------------- -------------
>
>_______________________________________________
>ActivePerl mailing list
>ActivePerl@listserv.ActiveState.com
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
root@www:~# perl -e "for('a'...'z') { print }"
abcdefghijklmnopqrstuvwxyzroot@www:~#
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: counting differently
am 23.02.2004 16:40:59 von Michael Koehn
cliff@globalmagic.com wrote:
> Is there a way to force a variable to walk through the alphabet the way
> it can numbers?
>
> ie: for numbers: $k=0; $k=$k+1; would give you 1
>
> for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there any
> way of doing this that will?
>
>
> ------------------------------------------------------------ ------------
$k = 'a';
$k = chr(ord($k)+1);
$k will now contain 'b'. This works for ASCII, and English. No
promises for Unicode or other languages. This actaully walks the ASCII
sequence of characters, so the character after 'z' will be '{'.
Michael Koehn
Bergen County Schools
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: counting differently
am 23.02.2004 16:41:15 von intertwingled
intertwingled wrote:
> cliff@globalmagic.com wrote:
>
>> Is there a way to force a variable to walk through the alphabet the
>> way it can numbers?
>>
>> ie: for numbers: $k=0; $k=$k+1; would give you 1
>>
>> for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there
>> any way of doing this that will?
>>
>>
>> ------------------------------------------------------------ ------------
>>
>> _______________________________________________
>> ActivePerl mailing list
>> ActivePerl@listserv.ActiveState.com
>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>>
> root@www:~# perl -e "for('a'...'z') { print }"
> abcdefghijklmnopqrstuvwxyzroot@www:~#
>
>
Actually, also:
root@www:~# perl -e "for('a'..'z') { print }"
abcdefghijklmnopqrstuvwxyzroot@www:~#
... and ... are slightly different operators.
Tony
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: counting differently
am 23.02.2004 16:43:50 von MoniqueChacon-Taylor
This is a multi-part message in MIME format.
--===============0433304847==
content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C3FA23.D50D2641"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3FA23.D50D2641
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
An easy way=20
=20
Define an array with the alphabet
@alphabet=3D("a","b",...)
$i=3D0
$temp=3D$alphabet[$i] "meaning $temp=3D"a"
$temp=3D$alphabet[$i+1] will now be "b"
-----Original Message-----
From: cliff@globalmagic.com [mailto:cliff@globalmagic.com]
Sent: Monday, February 23, 2004 6:52 AM
To: activeperl@listserv.ActiveState.com
Subject: counting differently
Is there a way to force a variable to walk through the alphabet the way =
it can numbers?
=20
ie: for numbers: $k=3D0; $k=3D$k+1; would give you 1
=20
for letters $k=3D'a'; $k=3D$k+1; this won't give you 'b'; but is there =
any way of doing this that will?
------_=_NextPart_001_01C3FA23.D50D2641
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
charset=3Diso-8859-1">
size=3D2>An=20
easy way
size=3D2>Define=20
an array with the alphabet
size=3D2>@alphabet=3D("a","b",...)
size=3D2>$i=3D0
size=3D2>$temp=3D$alphabet[$i] "meaning =
$temp=3D"a"
size=3D2>$temp=3D$alphabet[$i+1] will now be "b"
Is there a way to force a variable to =
walk=20
through the alphabet the way it can numbers?
ie: for numbers: $k=3D0; =
$k=3D$k+1; would give=20
you 1
for letters $k=3D'a'; $k=3D$k+1; this =
won't give you=20
'b'; but is there any way of doing this that=20
will?
------_=_NextPart_001_01C3FA23.D50D2641--
--===============0433304847==
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
--===============0433304847==--
RE: counting differently
am 23.02.2004 16:44:29 von Pim.Bussink
This is a multi-part message in MIME format.
--===============0826494859==
content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C3FA23.EC774578"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3FA23.EC774578
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Cliff,
=20
maybe as a Perl (but not programming) novice I am missing your point / =
application, but one could of course create an array @letter =3D (a..z) =
and walk through that, or if you are into Object Orientation create a =
letter class with a next() member function that knows the alphabet.
=20
By the way, a question of mine: could one overload the ++ operator =
(which I like better than Cliff's '+ 1') instead of this next() above, =
by the way, such that
$letter =3D 'a';
$letter++ gives you 'b'? I guess you ned to hack the code for that? =
Far-fetched perhaps... Oh well.
=20
Cheers, Pim
-----Original Message-----
From: cliff@globalmagic.com [mailto:cliff@globalmagic.com]
Sent: 23 February 2004 14:52
To: activeperl@listserv.ActiveState.com
Subject: counting differently
Is there a way to force a variable to walk through the alphabet the way =
it can numbers?
=20
ie: for numbers: $k=3D0; $k=3D$k+1; would give you 1
=20
for letters $k=3D'a'; $k=3D$k+1; this won't give you 'b'; but is there =
any way of doing this that will?
------_=_NextPart_001_01C3FA23.EC774578
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
charset=3Diso-8859-1">
color=3D#0000ff>
size=3D2>
class=3D421173915-23022004>Cliff,
>
color=3D#0000ff>
size=3D2>
class=3D421173915-23022004>
>
class=3D421173915-23022004>
color=3D#0000ff>
size=3D2>maybe as a Perl (but not =
programming)=20
novice I am missing your point / application, but
class=3D421173915-23022004>one could of course create an array =
@letter =
(a..z) and walk through that, or =
if you are=20
into Object Orientation creat
class=3D421173915-23022004>e=20
a letter class with a=20
next() member=20
function that knows the=20
alphabet.
face=3DTahoma>
color=3D#0000ff>
class=3D421173915-23022004>
AN>
face=3DTahoma>
color=3D#0000ff>By the =
way, a question=20
of mine: could one overload the ++ operator (which I like better =
than=20
Cliff's '+ 1') instead of this next() above, by the way, such=20
that
face=3DTahoma>
color=3D#0000ff>$letter =
=
'a';
face=3DTahoma>
color=3D#0000ff>
class=3D421173915-23022004>$letter++ gives you=20
'b'? I guess you ned to hack the code for that? Far-fetched=20
perhaps... Oh =
well.
face=3DTahoma>
color=3D#0000ff>
class=3D421173915-23022004>
AN>
face=3DArial=20
color=3D#0000ff size=3D2>Cheers, =
Pim
Is there a way to force a variable to =
walk=20
through the alphabet the way it can numbers?
ie: for numbers: $k=3D0; =
$k=3D$k+1; would give=20
you 1
for letters $k=3D'a'; $k=3D$k+1; this =
won't give you=20
'b'; but is there any way of doing this that=20
will?
------_=_NextPart_001_01C3FA23.EC774578--
--===============0826494859==
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
--===============0826494859==--
RE: counting differently
am 23.02.2004 16:47:36 von Tony.Anderson
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--===============1226866364==
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C3FA24.5C186498"
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C3FA24.5C186498
Content-Type: text/plain
Use the prefix operator:
$ perl -e '$x = "a"; print ++$x, "\n";'
b
-----Original Message-----
From: cliff@globalmagic.com [mailto:cliff@globalmagic.com]
Sent: Monday, February 23, 2004 8:52 AM
To: activeperl@listserv.ActiveState.com
Subject: counting differently
Is there a way to force a variable to walk through the alphabet the way it
can numbers?
ie: for numbers: $k=0; $k=$k+1; would give you 1
for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there any way
of doing this that will?
This electronic message contains information, which may be confidential,
privileged or otherwise protected from disclosure. The information is
intended to be used solely by the recipient(s) named. If you are not an
intended recipient, be aware that any review, disclosure, copying,
distribution or use of this message or its contents is prohibited. If you
have received this message in error, please notify the sender and delete
this message from your system. Employees of the company are prohibited from
making defamatory statements and from infringing copyright or any other
legal right. Any such communication or infringement is contrary to company
policy and outside the scope of employment.
------_=_NextPart_001_01C3FA24.5C186498
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
charset=3Dus-ascii">
Message
Use =
the prefix=20
operator:
size=3D2>
$ =
perl -e '$x =3D "a";=20
print ++$x, "\n";'
b
size=3D2>
size=3D2>
align=3Dleft>
size=3D2>-----Original Message-----
From: =
cliff@globalmagic.com=20
[mailto:cliff@globalmagic.com]
Sent: Monday, February 23, =
2004 8:52=20
AM
To: activeperl@listserv.ActiveState.com
Subject: =
counting=20
differently
Is there a way to force a variable to =
walk through=20
the alphabet the way it can numbers?
ie: for numbers: $k=3D0; =
$k=3D$k+1; would give=20
you 1
for letters $k=3D'a'; $k=3D$k+1; this =
won't give you=20
'b'; but is there any way of doing this that =
will?
This electronic message contains =
information, which may be confidential, privileged or otherwise =
protected from disclosure. The information is intended to be used =
solely by the recipient(s) named. If you are not an intended =
recipient, be aware that any review, disclosure, copying, distribution =
or use of this message or its contents is prohibited. If you have =
received this message in error, please notify the sender and delete =
this message from your system. Employees of the company are prohibited =
from making defamatory statements and from infringing copyright or any =
other legal right. Any such communication or infringement is contrary =
to company policy and outside the scope of employment.
------_=_NextPart_001_01C3FA24.5C186498--
--===============1226866364==
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
--===============1226866364==--
RE: counting differently
am 23.02.2004 16:49:04 von Donald.Stephens
This is a multi-part message in MIME format.
--===============1972395435==
content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C3FA24.9041F7EB"
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3FA24.9041F7EB
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sure. Start with the Ascii value of the letter, add one, then convert back =
to letter.
=20
for ($i =3D ord('a'); $i <=3D ord('z'); $i++)
{
print chr($i) . "\n";
}
=20
Donald C. Stephens
Associate Software Engineer
Analytics Prototyping and Scientific Programming
Moody's KMV
Tel: 212.553.1346
Fax: 574.472.5990
-----Original Message-----
From: cliff@globalmagic.com [mailto:cliff@globalmagic.com]
Sent: Monday, February 23, 2004 9:52 AM
To: activeperl@listserv.ActiveState.com
Subject: counting differently
Is there a way to force a variable to walk through the alphabet the way it =
can numbers?
=20
ie: for numbers: $k=3D0; $k=3D$k+1; would give you 1
=20
for letters $k=3D'a'; $k=3D$k+1; this won't give you 'b'; but is there any =
way of doing this that will?
-----------
The information contained in this e-mail message, and any attachment, is co=
nfidential and for use solely by the intended recipient. If you have recei=
ved this message in error, please delete this message immediately. Althoug=
h Moody's KMV makes every effort to protect its computing environment from =
malicious code, Moody's KMV is not responsible for any virus or other type =
of suspect code that may be transferred via this e-mail message.
------_=_NextPart_001_01C3FA24.9041F7EB
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
1">
ze=3D2>Sure.=20
Start with the Ascii value of the letter, add one, then convert back to=20
letter.
size=3D2>
T=20
face=3DArial color=3D#0000ff size=3D2>for ($i =3D ord('a'); $i <=3D ord(=
'z');=20
$i++)
T=20
face=3DArial color=3D#0000ff size=3D2>{
class=3D986164115-23022004>
000ff=20
size=3D2>print chr($i) . "\n";
T=20
face=3DArial color=3D#0000ff size=3D2>}
T=20
face=3DArial color=3D#0000ff size=3D2>
Donald C. Stephens<=
/DIV>
Associate Software=20
Engineer
Analytics Prototyping and =
Scientific=20
Programming
Moody's KMV
Tel: 212.553.1346
ONT>
Fax:=20
574.472.5990
Is there a way to force a variable to wa=
lk=20
through the alphabet the way it can numbers?
ie: for numbers: $k=3D0; $k=3D$k+1=
; would give=20
you 1
for letters $k=3D'a'; $k=3D$k+1; this wo=
n't give you=20
'b'; but is there any way of doing this that=20
will?
-----------
The information contained in this e-mail message, and any attachment, is co=
nfidential and for use solely by the intended recipient. If you have recei=
ved this message in error, please delete this message immediately. Althoug=
h Moody's KMV makes every effort to protect its computing environment from =
malicious code, Moody's KMV is not responsible for any virus or other type =
of suspect code that may be transferred via this e-mail message.
------_=_NextPart_001_01C3FA24.9041F7EB--
--===============1972395435==
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
--===============1972395435==--
RE: counting differently
am 23.02.2004 16:57:28 von Sui Ming Louie
This is a multi-part message in MIME format.
--===============0564689118==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0095_01C3F9FB.D7475670"
This is a multi-part message in MIME format.
------=_NextPart_000_0095_01C3F9FB.D7475670
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Try reading documentation for function chr:
Perldoc -f chr
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
cliff@globalmagic.com
Sent: Monday, February 23, 2004 9:52 AM
To: activeperl@listserv.ActiveState.com
Subject: counting differently
Is there a way to force a variable to walk through the alphabet the way it
can numbers?
ie: for numbers: $k=0; $k=$k+1; would give you 1
for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there any way
of doing this that will?
------=_NextPart_000_0095_01C3F9FB.D7475670
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
charset=3Dus-ascii">
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Try reading documentation for =
function chr:
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> =
Perldoc –f chr
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>
face=3DTahoma>
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original =
Message-----
From:
activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com]
style=3D'font-weight:
bold'>On Behalf Of cliff@globalmagic.com
Sent: Monday, February =
23, 2004
9:52 AM
To:
activeperl@listserv.ActiveState.com
Subject: counting =
differently
face=3D"Times New Roman">
style=3D'font-size:12.0pt'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>Is there a way to force a =
variable
to walk through the alphabet the way it can numbers?
face=3D"Times New Roman">
style=3D'font-size:12.0pt'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>ie: for numbers: =
$k=3D0;
$k=3D$k+1; would give you 1
face=3D"Times New Roman">
style=3D'font-size:12.0pt'>
face=3DArial>
style=3D'font-size:10.0pt;font-family:Arial'>for letters $k=3D'a'; =
$k=3D$k+1; this
won't give you 'b'; but is there any way of doing this that =
will?
------=_NextPart_000_0095_01C3F9FB.D7475670--
--===============0564689118==
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
--===============0564689118==--
Re: counting differently
am 23.02.2004 16:59:28 von Cliff
This is a multi-part message in MIME format.
--===============0677077318==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0050_01C3F9FC.1B5F4890"
This is a multi-part message in MIME format.
------=_NextPart_000_0050_01C3F9FC.1B5F4890
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
to all who responded; THANKS! it worked!
----- Original Message -----=20
From: Bussink, Pim GJ SUKEP-EPE-T-D=20
To: cliff@globalmagic.com ; activeperl@listserv.ActiveState.com=20
Sent: Monday, February 23, 2004 10:44 AM
Subject: RE: counting differently
Cliff,
maybe as a Perl (but not programming) novice I am missing your point / =
application, but one could of course create an array @letter =3D (a..z) =
and walk through that, or if you are into Object Orientation create a =
letter class with a next() member function that knows the alphabet.
By the way, a question of mine: could one overload the ++ operator =
(which I like better than Cliff's '+ 1') instead of this next() above, =
by the way, such that
$letter =3D 'a';
$letter++ gives you 'b'? I guess you ned to hack the code for that? =
Far-fetched perhaps... Oh well.
Cheers, Pim
-----Original Message-----
From: cliff@globalmagic.com [mailto:cliff@globalmagic.com]
Sent: 23 February 2004 14:52
To: activeperl@listserv.ActiveState.com
Subject: counting differently
Is there a way to force a variable to walk through the alphabet the =
way it can numbers?
ie: for numbers: $k=3D0; $k=3D$k+1; would give you 1
for letters $k=3D'a'; $k=3D$k+1; this won't give you 'b'; but is =
there any way of doing this that will?
------=_NextPart_000_0050_01C3F9FC.1B5F4890
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
charset=3Diso-8859-1">
to all who responded; THANKS! it=20
worked!
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
----- Original Message -----
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black">From:=20
href=3D"mailto:Pim.Bussink@Shell.com">Bussink,=20
Pim GJ SUKEP-EPE-T-D
To:
title=3Dcliff@globalmagic.com=20
href=3D"mailto:cliff@globalmagic.com">cliff@globalmagic.com ;
title=3Dactiveperl@listserv.ActiveState.com=20
=
href=3D"mailto:activeperl@listserv.ActiveState.com">activepe rl@listserv.A=
ctiveState.com=20
Sent: Monday, February 23, 2004 =
10:44=20
AM
Subject: RE: counting =
differently
color=3D#0000ff>
=
class=3D421173915-23022004>Cliff,
>
color=3D#0000ff>
=
class=3D421173915-23022004>
>
size=3D+0>
class=3D421173915-23022004>
color=3D#0000ff>
size=3D2>maybe as a Perl (but =
not=20
programming) novice I am missing your point / application,=20
but one could of course =
create an=20
array @letter =3D (a..z) and walk through that,
class=3D421173915-23022004>or if you are into Object Orientation=20
create a
class=3D421173915-23022004>letter class with a =
next()
class=3D421173915-23022004>member function
class=3D421173915-23022004>that knows the=20
alphabet.
size=3D+0>
face=3DTahoma>
=
class=3D421173915-23022004>
AN>
size=3D+0>
face=3DTahoma>
class=3D421173915-23022004>By=20
the way, a question of mine: could one overload the ++ operator =
(which I=20
like better than Cliff's '+ 1') instead of this next() above, by the =
way, such=20
that
size=3D+0>
face=3DTahoma>
class=3D421173915-23022004>$letter =
'a';
size=3D+0>
face=3DTahoma>
class=3D421173915-23022004>$letter++ gives you 'b'? I guess you =
ned to=20
hack the code for that? Far-fetched perhaps... Oh=20
well.
size=3D+0>
face=3DTahoma>
=
class=3D421173915-23022004>
AN>
face=3DArial=20
color=3D#0000ff size=3D2>Cheers, =
Pim
Is there a way to force a variable =
to walk=20
through the alphabet the way it can numbers?
ie: for numbers: $k=3D0; =
$k=3D$k+1; would=20
give you 1
for letters $k=3D'a'; $k=3D$k+1; =
this won't give=20
you 'b'; but is there any way of doing this that=20
will?
------=_NextPart_000_0050_01C3F9FC.1B5F4890--
--===============0677077318==
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
--===============0677077318==--
RE: counting differently
am 23.02.2004 17:04:58 von Brian Raven
cliff@globalmagic.com wrote:
>
> Is there a way to force a variable to walk through the alphabet the
> way it can numbers?
>
> ie: for numbers: $k=0; $k=$k+1; would give you 1
>
> for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there
> any way of doing this that will?
But ++$a will, because it is magic in this context. (See 'perldoc
perlop', "Auto-increment and Auto-decrement").
For example:
for ($i = 'a'; $i ne 'zzz'; ++$i) { print "$i\n"; }
Or
print "$_\n" for ('a'..'z);
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 LIFFE Holdings Plc or any of its subsidiary companies.
------------------------------------------------------------ -----------
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: counting differently
am 23.02.2004 17:05:52 von Ross Matt-QMR000
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Michael
Koehn
Sent: Monday, February 23, 2004 9:41 AM
To: activeperl@listserv.ActiveState.com
Subject: Re: counting differently
cliff@globalmagic.com wrote:
> Is there a way to force a variable to walk through the alphabet the
> way
> it can numbers?
>
> ie: for numbers: $k=0; $k=$k+1; would give you 1
>
> for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there any
> way of doing this that will?
>
>
> ------------------------------------------------------------ ----------
> --
$k = 'a';
$k = chr(ord($k)+1);
$k will now contain 'b'. This works for ASCII, and English. No
promises for Unicode or other languages. This actaully walks the ASCII
sequence of characters, so the character after 'z' will be '{'.
Michael Koehn
Bergen County Schools
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Another way that works,
$k = 'a';
$k++;
Later,
Matt
Matt Ross
Motorola
Configuration Management ePIMS
Wk: 817.245.6540
2 way pager: 888.468.0815
E-mail: Matt.Ross@motorola.com
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: counting differently
am 23.02.2004 17:55:09 von Tony.Anderson
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--===============1210204036==
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C3FA2D.CB99F8E6"
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C3FA2D.CB99F8E6
Content-Type: text/plain
I meant to type:
"Use the prefix ++ operator:"
(It won't work as a postfix operator)
$ perl -e '$x = "z"; print $x++, "\n";'
z
-----Original Message-----
From: Anderson, Tony [mailto:Tony.Anderson@travelexamericas.com]
Sent: Monday, February 23, 2004 9:48 AM
To: activeperl@listserv.ActiveState.com
Subject: RE: counting differently
Use the prefix operator:
$ perl -e '$x = "a"; print ++$x, "\n";'
b
-----Original Message-----
From: cliff@globalmagic.com [mailto:cliff@globalmagic.com]
Sent: Monday, February 23, 2004 8:52 AM
To: activeperl@listserv.ActiveState.com
Subject: counting differently
Is there a way to force a variable to walk through the alphabet the way it
can numbers?
ie: for numbers: $k=0; $k=$k+1; would give you 1
for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there any way
of doing this that will?
This electronic message contains information, which may be confidential,
privileged or otherwise protected from disclosure. The information is
intended to be used solely by the recipient(s) named. If you are not an
intended recipient, be aware that any review, disclosure, copying,
distribution or use of this message or its contents is prohibited. If you
have received this message in error, please notify the sender and delete
this message from your system. Employees of the company are prohibited from
making defamatory statements and from infringing copyright or any other
legal right. Any such communication or infringement is contrary to company
policy and outside the scope of employment.
This electronic message contains information, which may be confidential,
privileged or otherwise protected from disclosure. The information is
intended to be used solely by the recipient(s) named. If you are not an
intended recipient, be aware that any review, disclosure, copying,
distribution or use of this message or its contents is prohibited. If you
have received this message in error, please notify the sender and delete
this message from your system. Employees of the company are prohibited from
making defamatory statements and from infringing copyright or any other
legal right. Any such communication or infringement is contrary to company
policy and outside the scope of employment.
------_=_NextPart_001_01C3FA2D.CB99F8E6
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
charset=3Dus-ascii">
Message
I =
meant to=20
type:
class=3D736095116-23022004>
class=3D177214615-23022004>"Use the prefix =
++=20
operator:"
class=3D177214615-23022004>
class=3D177214615-23022004>(It won't work as a postfix=20
operator)
class=3D177214615-23022004>
class=3D177214615-23022004>$ perl -e '$x =3D "z"; print $x++,=20
"\n";'
z
align=3Dleft>
size=3D2>-----Original Message-----
From: Anderson, Tony=20
[mailto:Tony.Anderson@travelexamericas.com]
Sent: Monday, =
February=20
23, 2004 9:48 AM
To:=20
activeperl@listserv.ActiveState.com
Subject: RE: counting=20
differently
Use =
the prefix=20
operator:
size=3D2>
$ =
perl -e '$x =3D "a";=20
print ++$x, "\n";'
b
size=3D2>
size=3D2>
align=3Dleft>
size=3D2>-----Original Message-----
From: =
cliff@globalmagic.com=20
[mailto:cliff@globalmagic.com]
Sent: Monday, February 23, =
2004 8:52=20
AM
To: activeperl@listserv.ActiveState.com
Subject: =
counting=20
differently
Is there a way to force a variable to =
walk through=20
the alphabet the way it can numbers?
ie: for numbers: $k=3D0; =
$k=3D$k+1; would give=20
you 1
for letters $k=3D'a'; $k=3D$k+1; this =
won't give you=20
'b'; but is there any way of doing this that will?
This electronic message contains =
information,=20
which may be confidential, privileged or otherwise protected from =
disclosure.=20
The information is intended to be used solely by the recipient(s) =
named. If you=20
are not an intended recipient, be aware that any review, disclosure, =
copying,=20
distribution or use of this message or its contents is prohibited. If =
you have=20
received this message in error, please notify the sender and delete =
this message=20
from your system. Employees of the company are prohibited from making =
defamatory=20
statements and from infringing copyright or any other legal right. Any =
such=20
communication or infringement is contrary to company policy and outside =
the=20
scope of employment.
This electronic message contains =
information, which may be confidential, privileged or otherwise =
protected from disclosure. The information is intended to be used =
solely by the recipient(s) named. If you are not an intended =
recipient, be aware that any review, disclosure, copying, distribution =
or use of this message or its contents is prohibited. If you have =
received this message in error, please notify the sender and delete =
this message from your system. Employees of the company are prohibited =
from making defamatory statements and from infringing copyright or any =
other legal right. Any such communication or infringement is contrary =
to company policy and outside the scope of employment.
------_=_NextPart_001_01C3FA2D.CB99F8E6--
--===============1210204036==
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
--===============1210204036==--
Re: counting differently
am 23.02.2004 19:03:57 von Rob Dixon
wrote:
>
> Is there a way to force a variable to walk through the alphabet
> the way it can numbers?
No force required!
> ie: for numbers: $k=0; $k=$k+1; would give you 1
>
> for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there
> any way of doing this that will?
Hi Cliff.
There's a lesson to be learned here: that Perl is smart enough to
do what you usually want.
$k = 'a'; $k = $k + 1;
evaluates to 1 because 'a' is first evaluated numerically as zero before adding 1. But
$k = 'a'; $k++;
leaves $k set to 'b'.
Look at the following code, which shows that you must never underestimate what Perl will
do for you.
HTH,
Rob
print for 'a' .. 'f';
print "\n";
my $c = 'm';
print $c++ until $c eq 'q';
print "\n";
print join ' ', 'w' .. 'ac';
print "\n";
print join ' ', 'a5' .. 'b2';
print "\n";
**OUTPUT
abcdef
mnop
w x y z aa ab ac
a5 a6 a7 a8 a9 b0 b1 b2
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: counting differently
am 23.02.2004 19:08:03 von Brian Raven
Anderson, Tony wrote:
>
> I meant to type:
>
> "Use the prefix ++ operator:"
>
> (It won't work as a postfix operator)
>
> $ perl -e '$x = "z"; print $x++, "\n";'
> z
No, it works fine. It is just the way you used it that doesn't "work".
perl -e "$x='z'; $x++; print $x"
aa
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 LIFFE Holdings Plc or any of its subsidiary companies.
------------------------------------------------------------ -----------
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: counting differently
am 23.02.2004 19:34:49 von Cliff
very cool! thanks!
----- Original Message -----
From: "Rob Dixon"
To: ;
Sent: Monday, February 23, 2004 1:03 PM
Subject: Re: counting differently
> wrote:
> >
> > Is there a way to force a variable to walk through the alphabet
> > the way it can numbers?
>
> No force required!
>
> > ie: for numbers: $k=0; $k=$k+1; would give you 1
> >
> > for letters $k='a'; $k=$k+1; this won't give you 'b'; but is there
> > any way of doing this that will?
>
> Hi Cliff.
>
> There's a lesson to be learned here: that Perl is smart enough to
> do what you usually want.
>
> $k = 'a'; $k = $k + 1;
>
> evaluates to 1 because 'a' is first evaluated numerically as zero before
adding 1. But
>
> $k = 'a'; $k++;
>
> leaves $k set to 'b'.
>
> Look at the following code, which shows that you must never underestimate
what Perl will
> do for you.
>
> HTH,
>
> Rob
>
>
> print for 'a' .. 'f';
> print "\n";
>
> my $c = 'm';
> print $c++ until $c eq 'q';
> print "\n";
>
> print join ' ', 'w' .. 'ac';
> print "\n";
>
> print join ' ', 'a5' .. 'b2';
> print "\n";
>
> **OUTPUT
>
> abcdef
> mnop
> w x y z aa ab ac
> a5 a6 a7 a8 a9 b0 b1 b2
>
>
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Determine the OS
am 27.02.2008 20:50:58 von Rolando A Ampuero
I need to determine the type of OS/Architecture that a script is running on.
Whether is linux 32, linux 64, Windows 32, Windwows 64, etc. Is there a clever
way in Perl to find this out without doing a system call?
Thank you,
Rolando
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Determine the OS
am 27.02.2008 20:57:57 von Andrew Shitov
> I need to determine the type of OS/Architecture that a script is running on.
The question should be placed into FAQ :-)
If you need nothing extraordinary, use $^O variable:
perl -e"print $^O"
--
Andrew Shitov
____________________________________________________________ __________
andy@shitov.ru | http://www.shitov.ru
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Determine the OS
am 28.02.2008 11:02:45 von Brian Raven
Rolando A Ampuero <> wrote:
> I need to determine the type of OS/Architecture that a script is
> running on. =
> =
> Whether is linux 32, linux 64, Windows 32, Windwows 64, etc. Is there
> a clever way in Perl to find this out without doing a system call? =
The special variable $^O will probably not be suitable for that level of
detail, so see 'perldoc Config'.
HTH
-- =
Brian Raven =
==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================
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 immediat=
ely 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 Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =
Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.
L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
==================== =====3D=
================
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Determine the OS
am 28.02.2008 11:33:11 von Stuart Arnold
For windows, its quite a mess!
You can start by looking at 'Win32.pm' and the function
'Win32::GetOSVersion()'
But that will get you only so far.
You may want to look at how to get some of Windows internals by getting
'ScriptomaticV2.hta' from MS to see some internals.
Not sure of *NIX ways.
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Brian
Raven
Sent: Thursday, February 28, 2008 5:03 AM
To: activeperl@listserv.ActiveState.com
Subject: RE: Determine the OS
Rolando A Ampuero <> wrote:
> I need to determine the type of OS/Architecture that a script is =
> running on.
> =
> Whether is linux 32, linux 64, Windows 32, Windwows 64, etc. Is there =
> a clever way in Perl to find this out without doing a system call?
The special variable $^O will probably not be suitable for that level of
detail, so see 'perldoc Config'.
HTH
-- =
Brian Raven =
==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================
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 Limited - Registered in England & Wales
with registration no. 3962327. Registered office address at 25 Bank
Street London E14 5NQ United Kingdom. =
Atos Euronext Market Solutions SAS - Registered in France with
registration no. 425 100 294. Registered office address at 6/8
Boulevard Haussmann 75009 Paris France.
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. Atos Euronext Market Solutions
Limited Soci=E9t=E9 de droit anglais, enregistr=E9e au Royaume Uni sous le
num=E9ro 3962327, dont le si=E8ge social se situe 25 Bank Street E14 5NQ
Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e,
enregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro =
425
100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard
Haussmann 75009 Paris France. ===============3D=
==================== =====3D=
=3D
_______________________________________________
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: Determine the OS
am 28.02.2008 12:09:16 von Brian Raven
Stuart Arnold wrote:
>> From: activeperl-bounces@listserv.ActiveState.com
>> [mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
>> Brian Raven =
>> Sent: Thursday, February 28, 2008 5:03 AM
>> To: activeperl@listserv.ActiveState.com
>> Subject: RE: Determine the OS
>> =
>> =
>> Rolando A Ampuero <> wrote:
>>> I need to determine the type of OS/Architecture that a script is
>>> running on. =
>>> =
>>> Whether is linux 32, linux 64, Windows 32, Windwows 64, etc. Is
there
>>> a clever way in Perl to find this out without doing a system call?
>> =
>> The special variable $^O will probably not be suitable for that level
>> of detail, so see 'perldoc Config'. =
>> =
>> HTH> For windows, its quite a mess!
> You can start by looking at 'Win32.pm' and the function
> 'Win32::GetOSVersion()' =
> But that will get you only so far.
> =
> You may want to look at how to get some of Windows internals by
> getting 'ScriptomaticV2.hta' from MS to see some internals. =
> =
> Not sure of *NIX ways.
Hmmm... my original post missed the point that the OP was interested in
the platform that the script was running on (I blame lack of caffeine).
The Config module is created at build time, so its information may not
be accurate at run time (e.g. you could have a 32 bit build running
under a 64 bit OS). Getting detailed information about the platform on
which a script is actually running is going to be platform specific, and
it is almost certainly going to involve system calls, or running
external commands (e.g. the uname command on *nix).
I suppose that the 'clever' answer would be avoid write scripts that
need to know that (see 'perldoc perlport' perhaps)!
HTH
-- =
Brian Raven =
==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================
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 immediat=
ely 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 Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =
Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.
L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
==================== =====3D=
================
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Determine the OS
am 28.02.2008 21:07:29 von Joel Friedman
On windows I usually use:
if (exists($ENV{PROCESSOR_ARCHITEW6432})) {
print "64 bit!\n";
}
Combine that with $^O to determine if you are on Unix or Windows and you ar=
e 75% there.
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounce=
s@listserv.ActiveState.com] On Behalf Of Stuart Arnold
Sent: Thursday, February 28, 2008 5:33 AM
To: 'Brian Raven'; activeperl@listserv.ActiveState.com
Subject: RE: Determine the OS
For windows, its quite a mess!
You can start by looking at 'Win32.pm' and the function
'Win32::GetOSVersion()'
But that will get you only so far.
You may want to look at how to get some of Windows internals by getting
'ScriptomaticV2.hta' from MS to see some internals.
Not sure of *NIX ways.
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Brian
Raven
Sent: Thursday, February 28, 2008 5:03 AM
To: activeperl@listserv.ActiveState.com
Subject: RE: Determine the OS
Rolando A Ampuero <> wrote:
> I need to determine the type of OS/Architecture that a script is
> running on.
>
> Whether is linux 32, linux 64, Windows 32, Windwows 64, etc. Is there
> a clever way in Perl to find this out without doing a system call?
The special variable $^O will probably not be suitable for that level of
detail, so see 'perldoc Config'.
HTH
--
Brian Raven
==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================
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 Limited - Registered in England & Wales
with registration no. 3962327. Registered office address at 25 Bank
Street London E14 5NQ United Kingdom.
Atos Euronext Market Solutions SAS - Registered in France with
registration no. 425 100 294. Registered office address at 6/8
Boulevard Haussmann 75009 Paris France.
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. Atos Euronext Market Solutions
Limited Soci=E9t=E9 de droit anglais, enregistr=E9e au Royaume Uni sous le
num=E9ro 3962327, dont le si=E8ge social se situe 25 Bank Street E14 5NQ
Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e,
enregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro =
425
100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard
Haussmann 75009 Paris France. ===============3D=
==================== =====3D=
=3D
_______________________________________________
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
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Determine the OS
am 28.02.2008 21:14:51 von Joel Friedman
Correction - that's only if you are in a 32bit shell on a 64bit system. It=
would probably be more appropriate to check PROCESSOR_ARCHITECTURE to see =
if its x86 or not.
http://msdn.microsoft.com/library/default.asp?url=3D/library /en-us/win64/wi=
n64/wow64_implementation_details.asp
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounce=
s@listserv.ActiveState.com] On Behalf Of Joel Friedman
Sent: Thursday, February 28, 2008 3:07 PM
To: 'stuart.arnold@comcast.net'; 'Brian Raven'; activeperl@listserv.ActiveS=
tate.com
Subject: RE: Determine the OS
On windows I usually use:
if (exists($ENV{PROCESSOR_ARCHITEW6432})) {
print "64 bit!\n";
}
Combine that with $^O to determine if you are on Unix or Windows and you ar=
e 75% there.
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounce=
s@listserv.ActiveState.com] On Behalf Of Stuart Arnold
Sent: Thursday, February 28, 2008 5:33 AM
To: 'Brian Raven'; activeperl@listserv.ActiveState.com
Subject: RE: Determine the OS
For windows, its quite a mess!
You can start by looking at 'Win32.pm' and the function
'Win32::GetOSVersion()'
But that will get you only so far.
You may want to look at how to get some of Windows internals by getting
'ScriptomaticV2.hta' from MS to see some internals.
Not sure of *NIX ways.
-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Brian
Raven
Sent: Thursday, February 28, 2008 5:03 AM
To: activeperl@listserv.ActiveState.com
Subject: RE: Determine the OS
Rolando A Ampuero <> wrote:
> I need to determine the type of OS/Architecture that a script is
> running on.
>
> Whether is linux 32, linux 64, Windows 32, Windwows 64, etc. Is there
> a clever way in Perl to find this out without doing a system call?
The special variable $^O will probably not be suitable for that level of
detail, so see 'perldoc Config'.
HTH
--
Brian Raven
==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================
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 Limited - Registered in England & Wales
with registration no. 3962327. Registered office address at 25 Bank
Street London E14 5NQ United Kingdom.
Atos Euronext Market Solutions SAS - Registered in France with
registration no. 425 100 294. Registered office address at 6/8
Boulevard Haussmann 75009 Paris France.
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. Atos Euronext Market Solutions
Limited Soci=E9t=E9 de droit anglais, enregistr=E9e au Royaume Uni sous le
num=E9ro 3962327, dont le si=E8ge social se situe 25 Bank Street E14 5NQ
Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e,
enregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro =
425
100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard
Haussmann 75009 Paris France. ===============3D=
==================== =====3D=
=3D
_______________________________________________
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
_______________________________________________
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