R
Ricky
Hi,
Quite new to perl so this is probably easy.....I'm trying to carry out
a command which lists some unix files (number of which are unknown) and
return only the pattern matched....
i.e,
my @files = (`ls $user1\_\*`) ;
and then apply the following pattern to the above:
/$user1\_(\S+)/
to grab the string which is on the right hand side of the underscore.
So, with
ricky_testpage.data
ricky_testpage2.data
@files would end up with
testpage.data
testpage2.data
How can I do this?
Thank you!
Quite new to perl so this is probably easy.....I'm trying to carry out
a command which lists some unix files (number of which are unknown) and
return only the pattern matched....
i.e,
my @files = (`ls $user1\_\*`) ;
and then apply the following pattern to the above:
/$user1\_(\S+)/
to grab the string which is on the right hand side of the underscore.
So, with
ricky_testpage.data
ricky_testpage2.data
@files would end up with
testpage.data
testpage2.data
How can I do this?
Thank you!