Re: Can not get reliable output [WAS: Reg. Directory listing program]
[email protected] (Michelle Konzack)
| Newsgroups | perl.beginners |
|---|---|
| Message-ID | <[email protected]> |
Hello John,
Am 2008-06-06 11:06:09, schrieb John W. Krahn:
> $ perl -le'printf "%o\n", 33279'
> 100777
>
>
> 33279 is the decimal representation of a number, and 0777 is the octal
> representation of a number. If a number has a leading zero it is
> usually displayed in octal representation.
>
> $ perl -le'print for 0777, 777'
> 511
> 777
>
> So 0777 is the octal representation of the decimal number 511.
>
>
> Perl can display numbers in either decimal, hexadecimal, octal or binary
> formats:
>
> $ perl -le'printf "%1\$#d %1\$#x %1\$#o %1\$#b\n", 777'
> 777 0x309 01411 0b1100001001
>
> Perl can also use literal numbers represented in either decimal,
> hexadecimal, octal or binary formats:
>
> $ perl -le'printf "%s %s %s %s\n", 777, 0x309, 01411, 0b1100001001'
> 777 777 777 777
Realy nice features... Now I understand it!
Such conversions are realy helpful...
Unfortunately I am learning perl 10 years to late!
Thanks, Greetings and nice Day
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
+49/177/9351947 50, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
signature.pgp
(application/pgp-signature, 189 B) - not displayed