> At one point in my script, I still use ls to get a line of data for
> files, what I'm trying for is a regexp that'll pull the filename
> out--including soft links. What I have right now--while it works--is
> rather, um, long: 
> 
> $line =~ /^[-l][-rswx]{9}\s+\d+\s+\w+\s+\w+\s+\d+\s+\w+\s+\d+\s+
> (?:\d{4}|\d\d:\d\d)\s+(.*)$/; 
> 
> I had a shorter regexp, actually *much* shorter: 
> 
> $line =~ /^.+(?:\d{4}|\d\d:\d\d)\s+(.*)$/; 
> 
> but it ran into a problem with the following file line: 
> 
> lrwxrwxrwx ... Sep 10 15:15 1614 -> /opt/K/SCO/...1614 

Deane,

Just taking a quick look, and ignoring a whole host of assumptions, it seems
like you're looking for everything after the date:

$line = 'lrwxrwxrwx ... Sep 10 15:15 1614 -> /opt/K/SCO/...1614';
$line =~ /\w{3} \d+ \d+:\d+ (.*)$/;
print $1;

Chris


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. 
It is intended for the addressee(s) only. Access to this E-mail by anyone else is 
unauthorized. If you are not an addressee, any disclosure or copying of the contents 
of this E-mail or any action taken (or not taken) in reliance on it is unauthorized 
and may be unlawful. If you are not an addressee, please inform the sender immediately.
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to