Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^7: To read files from two dir

by graff (Chancellor)
on Apr 23, 2022 at 00:37 UTC ( [id://11143224]=note: print w/replies, xml ) Need Help??


in reply to Re^6: To read files from two dir
in thread To read files from two dir

It seems that you are not aware of the fact that we have been asking you questions and offering suggestions. You have not answered any of our questions, and you have not mentioned anything about our suggestions (like: whether you understood them, or tried them out, or ran into new problems after trying them out).

So... that would be the sort of "details" we would "need" if you really expect to make any progress based on help from us.

Here's another suggestion: PLEASE -- PLEASE -- PLEASE: Edit that terribly long post of yours above -- the one with nearly 1200 lines of code in it -- and put a <readmore> tag above the beginning of the code, and a </readmore> tag at the end of the code. I'm SERIOUS!! DO IT!!! Because it is an awful PAIN IN THE A$$ to have to scroll over all 1200 lines every time I look at this thread. Thanks in advance.

Replies are listed 'Best First'.
Re^8: To read files from two dir
by pragovnj (Acolyte) on Apr 25, 2022 at 20:38 UTC
    Hi,

    I was able to fix the issue to read from two directories. I added a variable for the second directory and used that throughout my code. That simplified the effort. I have another issue. Currently, I have this directory as

    my $TOP_DIR = "$VTIERBASE/pvc/ohdr/instance-00

    where the 00 in front of instance is derived from the hostname of the VM (zldcdabcdef14-vos-fxohr-correlator-00). digits after correlator- for example, the VMs may start from 00 to 99 I need to pass this value , /instance-xx dynamically How to do this?

    Thanks,

      The problem statement is a little vague. Perhaps see How to ask better questions using Test::More and sample data? Anyway here might be what you want.

      use strict; use warnings; use Test::More tests => 1; my $vmstr = 'zldcdabcdef14-vos-fxohr-correlator-00'; my ($digits) = $vmstr =~ /-(\d\d)$/; my $instance = "/instance-$digits"; is $instance, '/instance-00';

      🦛

        Can I use it as below?p/code>

        my $vmstr = "zldcdyh1bdce2d14-vcc-voipohdr-correlator-00"; my ($digits) = $vmstr =~ /-(\d\d)$/; my $VMinst = "/instance-$digits"; is $instance, '/instance-00'; my $SRC_DIR = "$VTIERBASE/pvc/ohdr/topology"; #my $TOP_DIR = "$VTIERBASE/pvc/ohdr/instance-0/preprocess" +; my $TOP_DIR = "$VTIERBASE/pvc/ohdr/VMinst/preprocess";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-26 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found