tchrist@convex.COM (Tom Christiansen) (03/08/91)
1c1 < [Last changed: $Date: 91/02/02 15:39:48 $ by $Author: tchrist $] --- > [Last changed: $Date: 91/03/07 20:44:34 $ by $Author: tchrist $] 49a50 > 28) Why doesn't Perl interpret my octal data octally? 92c93 < uunet.uu.net 192.48.96.2 --- > ftp.uu.net 192.48.96.2 96a98,113 > If you are in Europe, you might using the following site. This > information thanks to "Henk P. Penning" <henkp@cs.ruu.nl>: > > FTP: Perl stuff is in the UNIX directory on archive.cs.ruu.nl (131.211.80.5) > > Email: Send a message to 'mail-server@cs.ruu.nl' containing: > begin > path your_email_address > send help > send UNIX/INDEX > end > The path-line may be omitted if your message contains a normal From:-line. > You will receive a help-file and an index of the directory that contains > the Perl stuff. > > 130a148,149 > Another possiblity is to use UUNET, although they charge you > for it. You have been duly warned. Here's the advert: 131a151,188 > Anonymous Access to UUNET's Source Archives > > 1-900-GOT-SRCS > > UUNET now provides access to its extensive collection of UNIX > related sources to non- subscribers. By calling 1-900-468-7727 > and using the login "uucp" with no password, anyone may uucp any > of UUNET's on line source collection. Callers will be charged 40 > cents per minute. The charges will appear on their next tele- > phone bill. > > The file uunet!~/help contains instructions. The file > uunet!~/ls-lR.Z contains a complete list of the files available > and is updated daily. Files ending in Z need to be uncompressed > before being used. The file uunet!~/compress.tar is a tar > archive containing the C sources for the uncompress program. > > This service provides a cost effective way of obtaining > current releases of sources without having to maintain accounts > with UUNET or some other service. All modems connected to the > 900 number are Telebit T2500 modems. These modems support all > standard modem speeds including PEP, V.32 (9600), V.22bis (2400), > Bell 212a (1200), and Bell 103 (300). Using PEP or V.32, a 1.5 > megabyte file such as the GNU C compiler would cost $10 in con- > nect charges. The entire 55 megabyte X Window system V11 R4 > would cost only $370 in connect time. These costs are less than > the official tape distribution fees and they are available now > via modem. > > UUNET Communications Services > 3110 Fairview Park Drive, Suite 570 > Falls Church, VA 22042 > +1 703 876 5050 (voice) > +1 703 876 5059 (fax) > info@uunet.uu.net > > > 138,139c195,196 < as a reference guide for Perl, it also contains a some tutorial material < and is a great source of examples and cookbook procedures, as well as wit --- > as a reference guide for Perl, it also contains tutorial material, > is a great source of examples and cookbook procedures, as well as wit 147c204 < information@techbook.com. Cost is ~25$US for the regular version, 35$US --- > info@techbook.com. Cost is ~25$US for the regular version, 35$US 180,183c237,240 < Not at the moment; however, if someone on the Internet should volunteer < the disk space, something might be able to be arranged, as archives have < been kept. [It looks like something may be brewing in this area; watch < this space for announcements.] --- > Yes, although they're poorly organized. You can get them from > the host betwixt.cs.caltech.edu (131.215.128.4) in the directory > /pub/comp.lang.perl. Perhaps by next month you'll be able to > get them from uunet as well. It contains these things: 184a242,244 > comp.lang.perl.tar.Z -- the 5M tarchive in MH/news format > archives/ -- the unpacked 5M tarchive > unviewed/ -- new comp.lang.perl messages since 4-Feb or 5-Feb. 185a246,262 > These are currently stored in news- or MH-style format; there are > subdirectories named things like "arrays", "programs", "taint", and > "emacs". Unfortunately, only the first ~1600 or so messages have been > so categorized, and we're now up to almost 5000. Furthermore, even > this categorization was haphazardly done and contains errors. > > A more sophisticated query and retrieval mechanism is desirable. > Preferably one that allows you to retrieve article using a fast-access > indices, keyed on at least author, date, subject, thread (as in "trn") > and probably keywords. Right now, the MH pick command works for this, > but it is very slow to select on 5000 articles. > > If you're serious about this, your best bet is probably to retrieve > the compressed tarchive and play with what you get. Any suggestions > how to better sort this all out are extremely welcome. > > 454c531 < you probably have a working undump. If you don't, and you can't get one, --- > you may have a working undump. If you don't, and you can't get one, 981a1059,1088 > > > 28) Why doesn't Perl interpret my octal data octally? > > Perl only understands octal and hex numbers as such when they occur > as constants in your program. If they are read in from somewhere > and assigned, then no automatic conversion takes place. You must > explicitly use oct() or hex() if you want this kind of thing to happen. > Actually, oct() knows to interpret both hex and octal numbers, while > hex only converts hexadecimal ones. For example: > > { > print "What mode would you like? "; > $mode = <STDIN>; > $mode = oct($mode); > unless ($mode) { > print "You can't really want mode 0!\n"; > redo; > } > chmod $mode, $file; > } > > Without the octal conversion, a requested mode of 755 would turn > into 01363, yielding bizarre file permissions of --wxrw--wt. > > If you want something that handles decimal, octal and hex input, > you could follow the suggestion in the man page and use: > > $val = oct($val) if $val =~ /^0/; > -- I get so tired of utilities with arbitrary, undocumented, compiled-in limits. Don't you? Tom Christiansen tchrist@convex.com convex!tchrist