Re: array like split of string

2011-01-26 Thread Peter K. Michie
On Jan 23, 2:55 am, jwkr...@shaw.ca ("John W. Krahn") wrote: > Peter K. Michie wrote: > > I have this regex expression in a script that appears to do an array > > like split of a string but I cannot figure out how it does so. Any > > help appreciated > > > $fname = ($0 =~ m[(.*/)?([^/]+)$])[1] ; >

Re: array like split of string

2011-01-23 Thread John W. Krahn
Peter K. Michie wrote: I have this regex expression in a script that appears to do an array like split of a string but I cannot figure out how it does so. Any help appreciated $fname = ($0 =~ m[(.*/)?([^/]+)$])[1] ; print "7 $errlog\n"; $fpath = ($0 =~ m[(.*/)?([^/]+)$])[0] ; print "8 $errlog\n

array like split of string

2011-01-23 Thread Peter K. Michie
I have this regex expression in a script that appears to do an array like split of a string but I cannot figure out how it does so. Any help appreciated $fname = ($0 =~ m[(.*/)?([^/]+)$])[1] ; print "7 $errlog\n"; $fpath = ($0 =~ m[(.*/)?([^/]+)$])[0] ; print "8 $errlog\n"; The array elements 0