http://www.perlmonks.org?node_id=1185394

finddata has asked for the wisdom of the Perl Monks concerning the following question:

I have the project.txt files at following directory (/home/data/check_ +data). project.txt contins following contents: <code> PROJECT { NAME:DCMS_DEMO BLOCKS:test,de_top,new_block2 DENY_USERS: WELCOME: REVISION_LOCATION:../setup/projects/DCMS_DEMO/project_space CHECKLISTS:Synthesis_L2_checklist,Block_Physical_design_checklist,ICC_ +L2_Checklist,Overall_DV,Formality_DCT_Vs_ICC,Fullchip_Physical_design +_checklist,Formality_RTL_Vs_DCT,synthesis,Timing_analysis_checklist,c +hecklist_tmp,Power_analysis_checklist,Block_DV,DFT,ICC_Top_level_Chec +klist,test_copy_checklist,ICC_DPMHV_Checklist,CAD_checklist,FrontEnd_ +Design_Checklist DESCRIPTION:Demonstration project OWNER:sanandak ALLOWED_UNIX_GROUPS: }
Now i like to read the directory whereever the line starts with (REVISION_LOCATION:) from the project.txt files.And those directories should be consider as my input directory from the command line arguments.How can i do it. code which i had tried are as follows:
#! /usr/bin/env perl use strict; use warnings; use Getopt::Long qw( GetOptions ); GetOptions( 'root=s' => \my $input_dir, 'outdir=s' => \my $output_dir, 'file=s' => \my $mapfile, ) In the above i called the directory straightly from the location but m +y question is first i should read the project.txt file from one locat +ion and from that project.txt file i should read the directory(i.e t +he line starts with REVISION_LOCATION).How can i script it using perl +?