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

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";

Replies are listed 'Best First'.
Re^11: To read files from two dir
by hippo (Archbishop) on Apr 26, 2022 at 15:17 UTC

    Yes. You don't need the is line if you aren't testing and you will need a $ before VMinst in the last line, of course.


    🦛

      Hi,

      A slight change. The VMs are numbered as 0 to 99 and not 00 to 99 as I wrongly assumed :( How to modify your code so that it can identify 0,1,2 ...99?

        That's a very simple change. Have a read through perlre and see if you can work it out.


        🦛