home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5582 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.7 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!elroy.jpl.nasa.gov!usc!news.bbn.com!noc.near.net!wpi.WPI.EDU!bigboote.wpi.edu!john
  2. From: john@sekrit.WPI.EDU (John Stoffel)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: easy question?: substrings
  5. Message-ID: <JOHN.92Aug28131603@sekrit.WPI.EDU>
  6. Date: 28 Aug 92 18:16:03 GMT
  7. References: <1992Aug26.213516.22813@cbnewse.cb.att.com>
  8.     <1992Aug26.222821.28341@news.eng.convex.com>
  9. Sender: news@wpi.WPI.EDU (USENET News System)
  10. Distribution: usa
  11. Organization: Worcester Polytechnic Institute
  12. Lines: 28
  13. In-Reply-To: tchrist@convex.COM's message of 26 Aug 92 22:28:21 GMT
  14. Nntp-Posting-Host: sekrit.wpi.edu
  15.  
  16. >>>>> On 26 Aug 92 22:28:21 GMT, tchrist@convex.COM (Tom Christiansen) said:
  17. Tom> Originator: tchrist@pixel.convex.com
  18. Tom> Nntp-Posting-Host: pixel.convex.com
  19.  
  20. Tom> From the keyboard of budnick@cbnewse.cb.att.com (Mary Jo Budnick):
  21. Tom> :Hi!  I just started to use Perl and can't find the info in the
  22. Tom> :Wall/Schwartz book very easily to solve my problem.  Help me out?
  23. Tom> :
  24. Tom> :All I want to do is to change a string in the format of either
  25. Tom> :    0xffffff00 or ffffff00 into the format
  26. Tom> :    of 255.255.255.0 
  27.  
  28. Tom> Try:
  29.  
  30. Tom>     $n = "ffffff00";
  31. Tom>     print join(".", unpack(C4, pack(L, hex($n)))), "\n";
  32.                      ^    
  33.                                          |
  34.  
  35. Don't you mean you want a 'N' instead of the 'L' in the pack?
  36.  
  37. At least this is what is needed with perl 4.035 on a DECstation 3100.
  38.  
  39. --
  40. Youth of today!  Join me in a mass rally for traditional mental attitudes!
  41. -------------------------------------------------------------------------------
  42. john@wpi.wpi.edu | Work Station Specialist | Worcester Polytechnic Institute
  43. John Stoffel     | 508-831-5512 (work)     | Worcester, MA  01609
  44.