UpMaBigKilt has asked for the wisdom of the Perl Monks concerning the following question:
Please be gentle, I am new to Perl having picked up some scripts from a former colleague, however I am banging my head against the wall from something I feel should be rather simple.
So, I have a directory with a number of files, only one of those files have the letters '_CF_' in the filename in that order. I need to set a variable $ScontrolFile as the filename containing '_CF_'.I thought the way to go was via an Array, I managed to read the files in from the Directory, and grep the entries to confirm the file I want is there, I can't seem to set the variable though.
Am I heading in the right direction or over complicating it?
Any hints, tricks or solutions will be greatly received.Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Setting a Variable from filename
by haukex (Archbishop) on Apr 29, 2018 at 12:40 UTC | |
by UpMaBigKilt (Initiate) on Apr 29, 2018 at 14:26 UTC | |
by haukex (Archbishop) on Apr 29, 2018 at 22:00 UTC | |
by Laurent_R (Canon) on Apr 29, 2018 at 17:43 UTC | |
by AnomalousMonk (Archbishop) on Apr 30, 2018 at 03:06 UTC | |
|
Re: Setting a Variable from filename
by Corion (Patriarch) on Apr 29, 2018 at 12:21 UTC |