Printf not working
"FRASER, JACK B" <[email protected]> Tue, 16 Oct 2012 23:32:28 +0000
| Newsgroups | gmane.comp.lang.perl.active-perl |
|---|---|
| Message-ID | <E606F23191C99146A000E0A56832ADDF254F88@CAFRFD1MSGUSR9A.ITServices.sbc.com> |
--===============1688752911==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_E606F23191C99146A000E0A56832ADDF254F88CAFRFD1MSGUSR9AIT_"
--_000_E606F23191C99146A000E0A56832ADDF254F88CAFRFD1MSGUSR9AIT_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
All -
I'm running ActivePerl 5.8.8 for MSWin32-x86-multi-thread. I cannot get t=
he Printf function to work in my code. The Compiler does not recognize the=
function... which is normally part of the standard Perl functions. Can yo=
u help resolve this issue? I've included the code that does not work....
#!/usr/local/bin/perl
print " Starting program to print out decimal to hex chart \n";
@HexD =3D ('0','1','2','3','4','5,','6','7','8','9','A','B','C','D','E','F'=
);
for ($i =3D 0;$i < 255;$i =3D $i++) {
printf("%3S=3D$HexD[INT($i / 16)]$HexD[$i % 16] ", $i);
if (($i % 8) =3D=3D 7) { print"\n" }
}
Jack B. Fraser
Senior Technical Architect
1E500 C
San Ramon, California
925 824-8209
--_000_E606F23191C99146A000E0A56832ADDF254F88CAFRFD1MSGUSR9AIT_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">All –<o:p>=
</o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">I’m running Acti=
vePerl 5.8.8 for MSWin32-x86-multi-thread. I cannot get the Pri=
ntf function to work in my code. The Compiler does not recognize the =
function… which is normally part of the standard Perl functions. =
;
Can you help resolve this issue? I’ve included the code that d=
oes not work….<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">#!/usr/local/bin/perl<=
o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">print " Starting =
program to print out decimal to hex chart \n";<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">@HexD =3D ('0','1','2'=
,'3','4','5,','6','7','8','9','A','B','C','D','E','F');<o:p></o:p></span></=
p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">for ($i =3D 0;$i < =
255;$i =3D $i++) {<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p> </o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"> &nbs=
p; printf=
("%3S=3D$HexD[INT($i / 16)]$HexD[$i % 16] ", $i);<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"> &nbs=
p; if (($=
i % 8) =3D=3D 7) { print"\n" }<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">}<o:p></o:p></span></p=
>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Jack B. Fraser<o:p></o:p></p>
<p class=3D"MsoNormal">Senior Technical Architect<o:p></o:p></p>
<p class=3D"MsoNormal">1E500 C<o:p></o:p></p>
<p class=3D"MsoNormal">San Ramon, California<o:p></o:p></p>
<p class=3D"MsoNormal">925 824-8209<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>
--_000_E606F23191C99146A000E0A56832ADDF254F88CAFRFD1MSGUSR9AIT_--
--===============1688752911==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1688752911==--