in reply to Re: Cisco to Juniper - parser help
in thread Cisco to Juniper - parser help

Thanks, I will definitely be looking into doing something like that once I can get the filter to align correctly to the unit.

Replies are listed 'Best First'.
Re^3: Cisco to Juniper - parser help
by Fletch (Bishop) on May 24, 2021 at 13:06 UTC

    Aah another thing just noticed (after caffeine has put the mind in motion a bit) you've got an outer while loop reading your input FH handle as well as a nested foreach reading the same handle. You look to be effectively reading the first line and discarding it (after printing it to STDOUT), then reading the rest of the file. That's . . . probably not what you want and may be why you're out of sync.

    As I mentioned, if you change things to do record reads (see perlvar for $/) and then have a single while reading input records once that may help keep things straight(er).

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      Thanks again for pointing that out. I fixed it, and when I debug printing $cos to the CLI, it prints out perfectly, but then below when it should print to the file, it is empty(it prints everything to the file perfectly, except the line with $cos(both the debug line, and the actual print to file are empty here)). So trying to figure out why that is happening since logically I can't explain to myself what would be clearing my variable(I am probably missing something simple, but after working on this for over a week, I can barely think straight).