home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5753 < prev    next >
Encoding:
Text File  |  1992-09-08  |  969 b   |  33 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!uunet.ca!unilabs!chare
  3. From: chare@unilabs.uucp (Chris Hare)
  4. Subject: stupid questions : deleted ing leading spaces
  5. Message-ID: <1992Sep7.022351.1137@unilabs.uucp>
  6. Organization: None: Just Me, Chris Hare
  7. Date: Mon, 7 Sep 1992 02:23:51 GMT
  8. Lines: 23
  9.  
  10. This is stupid.
  11.  
  12. I am running 4.035 and I need to delete a single leading space at the
  13. beginning of a line.
  14.  
  15. I would have thought that 
  16.  
  17.          tr/^ //;
  18.  
  19. would have worked since the line is in $_.
  20.  
  21. But alas, it doesn't.  There are other spaces in the line, but I don't want
  22. them affected.
  23.  
  24. As a matter of ofact, if you can suggest a way to remove the leading
  25. spaces, and compact multiple spaces any where else on the line to be one
  26. space I'd appreciate it.
  27.  
  28. Thanks!
  29. -- 
  30. ????                --- It Always works for me! ---                           
  31. Chris Hare, UNIX Scientist                  Preferred : chare@unilabs.uucp
  32. Just a mild-mannered consultant by day ....
  33.