Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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 +?

In reply to How to read the input directory from command line arguments using perl? by finddata

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (5)
    As of 2020-02-24 03:31 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?










      Results (104 votes). Check out past polls.

      Notices?