home *** CD-ROM | disk | FTP | other *** search
- 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
- From: john@sekrit.WPI.EDU (John Stoffel)
- Newsgroups: comp.lang.perl
- Subject: Re: easy question?: substrings
- Message-ID: <JOHN.92Aug28131603@sekrit.WPI.EDU>
- Date: 28 Aug 92 18:16:03 GMT
- References: <1992Aug26.213516.22813@cbnewse.cb.att.com>
- <1992Aug26.222821.28341@news.eng.convex.com>
- Sender: news@wpi.WPI.EDU (USENET News System)
- Distribution: usa
- Organization: Worcester Polytechnic Institute
- Lines: 28
- In-Reply-To: tchrist@convex.COM's message of 26 Aug 92 22:28:21 GMT
- Nntp-Posting-Host: sekrit.wpi.edu
-
- >>>>> On 26 Aug 92 22:28:21 GMT, tchrist@convex.COM (Tom Christiansen) said:
- Tom> Originator: tchrist@pixel.convex.com
- Tom> Nntp-Posting-Host: pixel.convex.com
-
- Tom> From the keyboard of budnick@cbnewse.cb.att.com (Mary Jo Budnick):
- Tom> :Hi! I just started to use Perl and can't find the info in the
- Tom> :Wall/Schwartz book very easily to solve my problem. Help me out?
- Tom> :
- Tom> :All I want to do is to change a string in the format of either
- Tom> : 0xffffff00 or ffffff00 into the format
- Tom> : of 255.255.255.0
-
- Tom> Try:
-
- Tom> $n = "ffffff00";
- Tom> print join(".", unpack(C4, pack(L, hex($n)))), "\n";
- ^
- |
-
- Don't you mean you want a 'N' instead of the 'L' in the pack?
-
- At least this is what is needed with perl 4.035 on a DECstation 3100.
-
- --
- Youth of today! Join me in a mass rally for traditional mental attitudes!
- -------------------------------------------------------------------------------
- john@wpi.wpi.edu | Work Station Specialist | Worcester Polytechnic Institute
- John Stoffel | 508-831-5512 (work) | Worcester, MA 01609
-