home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5797 < prev    next >
Encoding:
Text File  |  1992-09-09  |  2.5 KB  |  58 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!noc.near.net!meiko.com!mike
  3. From: mike@meiko.com (Mike Stok)
  4. Subject: Re: How to convice awk/sed users to use Perl ?
  5. Message-ID: <1992Sep9.163745.774@meiko.com>
  6. Sender: news@meiko.com
  7. Organization: Meiko Scientific Corp.
  8. References: <1992Sep9.143629.13571@cbfsb.cb.att.com>
  9. Date: Wed, 9 Sep 1992 16:37:45 GMT
  10. Lines: 46
  11.  
  12. In article <1992Sep9.143629.13571@cbfsb.cb.att.com> swu@att.com writes:
  13. >As a Perl beginner, I don't know how to answer the following question raised
  14. >by my colleagues:
  15. >   I  use ksh/awk/sed very well, why bother to spend a lot of time to learn
  16. >   Perl ?
  17. >   What's the real advantages of perl over ksh/awk/sed ?
  18. >
  19. >I will appreciate any help.
  20.  
  21. Personally speaking I like to have 1 set of regexp rules to remember
  22. which I can apply to arbitrary data (such as lines > 512 chars, binary
  23. files used by our Cobol (!) runtime) apart from maybe a file from
  24. emacs (or some similar program with Pascaloid notions of new lines as
  25. separators not terminators) with just the character 0 on the last line :-)
  26.  
  27. Perl at least reads & tokenises the script before executing it and
  28. doesn't just say "bailing out near line 1", so usually you can be
  29. *fairly* happy and confident once it's started to run.  The debugger's
  30. pretty useful sometimes too.
  31.  
  32. The thing which makes lots of non-programmers like it (and loads of
  33. programmers struggle at first) is the way data type is context
  34. sensitive (e.g. Q "...so, Mike is $x a number or a string?" A "It's a
  35. scalar, and how it's used determines how it's interpreted" type
  36. conversations happen a lot around here).  I like a language which has
  37. "until" and "unless" in it, as this makes it easier to write things
  38. like
  39.  
  40.   print $x unless $x eq "banana\n";
  41.  
  42. which reads pretty sensibly to an english speaking person who spends
  43. more time interacting with people than machines ;-)
  44.  
  45. The formatted output is pretty good for the guys who work at
  46. extracting data from our accounting system and combining it with adat
  47. extracted from a design system, then there's the ease with which I can
  48. fire off processes and do inter-process communication, and when I get
  49. stuck there are stacks of helpful people in comp.lang.perl who usually
  50. help out in the nicest possible way (they know who they are :-)....
  51.  
  52. Mike
  53. --
  54. The "usual disclaimers" apply.    | ... many were weak and confused, succumbing
  55. Mike Stok                         | to drink or drugs whenever possible ...
  56. mike@meiko.com                    |
  57. Meiko tel: (617) 890 7676         |                          Hunter S. Thompson
  58.