Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: How to read the input directory from command line arguments using perl?

by finddata (Sexton)
on Mar 22, 2017 at 05:16 UTC ( [id://1185403]=note: print w/replies, xml ) Need Help??


in reply to Re: How to read the input directory from command line arguments using perl?
in thread How to read the input directory from command line arguments using perl?

How can i run the above file in terminal?.I had used as follows
./html.pl --root=/home/data/check_data/project.txt --outdir=/home/data +/generate --mapfile=/home/data/check_data/mapfile.txt

Replies are listed 'Best First'.
Re^3: How to read the input directory from command line arguments using perl?
by haukex (Archbishop) on Mar 22, 2017 at 08:01 UTC

    You already have all the pieces that you need:

    1. In your root node you show how you get the command line arguments.
    2. bart showed you how to
      1. get the pathname of the project.txt file using File::Basename,
      2. parse the value out of the REVISION_LOCATION: line, and
      3. turn that filename from relative to absolute using File::Spec's rel2abs, using the pathname of project.txt as the base.

    If you're unsure on how to open the project.txt file instead of using the magic while(<>) that bart used, please see "Files and I/O" in perlintro.

    Updated wording slightly.

      The thing which he added i understood .But the problem is am not geeting how to run the file in terminal by passing input file
        But the problem is am not geeting how to run the file in terminal by passing input file

        Sorry, I don't understand what you are asking. Could you show the problem using a short, runnable piece of code so that others can see the same problem on their computers?

        In the last 14 days you have posted a total of 77 nodes so far, 19 of which are root nodes (questions), and as far as I can tell, in many cases the responses to your questions have probably been unsatisfactory. If you take the time to read the following three pages, and use the suggestions from those pages when you ask questions, I think you will find that you will get much better and faster answers to your questions.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1185403]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found