Text or Number

Scott Penrose scottp at dd.com.au
Sun Mar 28 18:13:14 CST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 29/03/2004, at 6:51 AM, Sisyphus wrote:

> Joshua Goodall wrote:
>
>> Scott is writing parallel port driver, and some API users confuse
>> ascii '1' (binary 0001111) with the actual value 00000001.  This can
>> result in more parallel lines being set than expected :).  By 
>> detecting
>> that the API user actually used a literal 1, you can implement a
>> DWIM handler internally e.g. using pack().
>
> But normally perl does this "DWIM" stuff for you.
> If I write:
>
> $x = "1";
> $y = $x * 3;
>
> then $y always holds the value 3, not 45.
>
> How does perl's own DWIM handler come to fail for Scott ?

Yes, but here we are dealing with hardware. A Parallel port does not 
DWIM :-)

Scooter
- -- 
Scott Penrose
Welcome to the Digital Dimension
http://www.dd.com.au/
scottp at dd.com.au

Dismaimer: Contents of this mail and signature are bound to change 
randomly. Whilst every attempt has been made to control said 
randomness, the author wishes to remain blameless for the number of 
eggs that damn chicken laid. Oh and I don't want to hear about 
butterflies either.

Please do not send me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFAZ2obDCFCcmAm26YRAqLTAJ9E6jSjRhfCcG/CC8bjFtiI8FRHuQCbBfi3
j6ZdQ+eMWwxYJnlQifnyMh8=
=04l4
-----END PGP SIGNATURE-----




More information about the Melbourne-pm mailing list