Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: REGEXP in perl questiion



On Wed, May 23, 2001 at 11:02:40AM +0100, Simon Cozens wrote:
> On Wed, May 23, 2001 at 06:54:49PM +0900, Viktor Pavlenko wrote:
> > perl -ne '/^Subject: Cron <.*?> (\S+)/ && print "$1\n"' < file
why not:
 perl -ne '/^Subject: Cron <.*?> (\S+)/ && print (split(/\//,$1))[-1] . "\n"' < file
> 
> That doesn't get the base name of the program, but it can be done trivially
> with File::Basename.
> 
> -- 
> Um. There is no David conspiracy. Definitely not. No Kate conspiracy either.
> No. No, there is definitely not any sort of David conspiracy, and we are
> definitely *not* in league with the Kate conspiracy. Who doesn't exist. And
> nor does the David conspiracy. No. No conspiracies here. - Thorfinn, ASR
> 
> -----------------------------------------------------------------------
> Next Technical Meeting:  Sat, May 12 13:30- 
> Next Nomikai Meeting:    Fri, June (TBA) 19:30- Tengu Tokyo Eki Mae
> -----------------------------------------------------------------------
> more info: http://www.tlug.gr.jp           Sponsor: Global Online Japan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links