> >-----Original Message----- >From: Jay Savage [mailto:[EMAIL PROTECTED] >Sent: Tuesday, March 21, 2006 3:06 PM >To: Timothy Johnson >Subject: Re: regex one liner
<snip> >> >> >> And as for the issue of slightly varying regexes as arguments to a >> script (different email), it may seem easier to you, but not necessarily >> to the next guy that comes along. <snip> > >You're making some assumptions here that may not be valid. Quite possibly. >It's not >always woth my time--or anyone else's--to sit down and write a tool to >accomplish a relatively simple task, especially if it's a task that >needs to be performed a finite number of times. Or for that matter, a >task that needs to be performed an infinite number of times with >infinite variations. No one is talking about "scripts". At least I'm >not. Nothing that needs to be maintained. Nothing, for the most part, >that another human being is ever going to see. The stuff that we all >kepp hidden away in our .profiles and heads. The basic stuff that >makes a sysadmin or advanced user's day possible. > <snip > >As far as I'm concerned, thats what the command line switches are >there for. I look at it this way: if it's something I'd write a shell >script for, I'll probably write a Perl script and save it to a file. >If it's something I'd do on the cammand line with another tool, I'll >probably do it on the command line with Perl. > >It's partly a matter of translation, too. If I'm turning to perl to >clean up some variation on > > %sed -e 's/something/something/g' -e'something else' -e'something else' file > >the Perl replacement will probably end up being one line, too. > >-- jay Excellent points. I concede that there are times where it will save you effort. I'll still maintain my prejudice against trying to do complicated things in one-liners, but that's just because I'm stubborn like that. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>