home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / perl / 8011 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.6 KB

  1. Path: sparky!uunet!lhdsy1!nntpserver.chevron.com!usho88.hou281.chevron.com!hdnea
  2. From: hdnea@usho88.hou281.chevron.com (David Neal)
  3. Newsgroups: comp.lang.perl
  4. Subject: multiplying text by a number
  5. Message-ID: <1993Jan26.203047.4396@nntpserver.chevron.com>
  6. Date: 26 Jan 93 20:30:47 GMT
  7. Sender: news@nntpserver.chevron.com (USENET News System)
  8. Organization: Chevron
  9. Lines: 56
  10.  
  11.  
  12. In playing with sybperl, I wondered what would happen
  13. if a string containing a sybase null (NULL) were multiplied
  14. with a number. Not having to check each field to see if
  15. it's NULL would save a little code...
  16.  
  17. #!/bin/perl
  18.  
  19. $a = "NULL";
  20.  
  21. $a *= 10;
  22.  
  23. print $a, "\n";
  24.  
  25.  
  26. On this version of perl....
  27. This is perl, version 4.0
  28.  
  29. $RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 14:50:39 $
  30. Patch level: 35
  31.  
  32. Copyright (c) 1989, 1990, 1991, Larry Wall
  33.  
  34. Perl may be copied only under the terms of either the Artistic License or the
  35. GNU General Public License, which may be found in the Perl 4.0 source kit.
  36.  
  37.  
  38. The program generates "0D\n"
  39.  
  40.  
  41.  
  42. But on THIS version of perl...
  43. This is perl, version 4.0
  44.  
  45. $RCSfile: perl.c,v $$Revision: 4.0.1.6 $$Date: 91/11/11 16:38:45 $
  46. Patch level: 19
  47.  
  48. Copyright (c) 1989, 1990, 1991, Larry Wall
  49.  
  50. Perl may be copied only under the terms of either the Artistic License or the
  51. GNU General Public License, which may be found in the Perl 4.0 source kit.
  52.  
  53.  
  54. It generates "0\n" as expected.
  55.  
  56. What gives?
  57.  
  58. P.S. Neither of the above versions have the sybperl patches
  59. applied.
  60.  
  61.  
  62. -- 
  63. David Neal -- hdnea@hou281.chevron.com 
  64.  
  65. My processes aren't dead! They're only resource impaired!
  66. Computationally challenged!
  67.