Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]tlug: perl is better?
- To: tlug@example.com
- Subject: tlug: perl is better?
- From: Jim Schweizer <schweiz@example.com>
- Date: Sat, 04 Apr 1998 17:53:01 +0900 (JST)
- Content-Transfer-Encoding: 8bit
- Content-Type: text/plain; charset=us-ascii
- Organization: JPS Solutions
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
Hi all, When you request majordomo to send a tlug monthly archive file it arrives with a pesky >From line that MHonARC ignores (meaning it thinks there are no new files to read because the line starts with a >) Being lazy (and knowing sed better than perl) I got rid of them with $ cat tlug.9802 | sed 's/^>From/From/' > tlug.9802.s But later, I decided to try the same thing with perl and couldn't get it to work. So I put the sed script in a file and: schweiz:~$ s2p sed.test #!/usr/bin/perl eval 'exec perl -S $0 ${1+"$@"}' if $running_under_some_shell; while ($ARGV[0] =~ /^-/) { $_ = shift; last if /^--/; if (/^-n/) { $nflag++; next; } die "I don't recognize this switch: $_\\n"; } $printit++ unless $nflag; $\ = "\n"; # automatically add newline on print LINE: while (<>) { chop; s/^>From/From/; print if $printit; } which to me looks more like an entry in an obfuscated perl contest than a quick "let's get rid of a >" script. Is there a better (ie more understandable to a non-programmer) way to get perl to do this? Regards, Jim S. ---------------------------------- Jim Schweizer <schweiz@example.com> #include <disclaimer.h> My life is a patio of fun! http://www1.harenet.or.jp/~schweiz/ ---------------------------------- --------------------------------------------------------------- Next TLUG Meeting: 11 April Sat, Tokyo Station Yaesu gate 12:30 Featuring Tague Griffith of Netscape i18n talking on source code --------------------------------------------------------------- a word from the sponsor: TWICS - Japan's First Public-Access Internet System www.twics.com info@example.com Tel:03-3351-5977 Fax:03-3353-6096
- Follow-Ups:
- Re: tlug: perl is better?
- From: Scott Stone <sstone@example.com>
Home | Main Index | Thread Index
- Prev by Date: tlug: mew subject width
- Next by Date: Re: tlug: help on notebook purchase
- Prev by thread: Re: tlug: Linux on NPR.
- Next by thread: Re: tlug: perl is better?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links