in reply to Re: No such file or directory at R_loop2.pl line 19.
in thread No such file or directory at R_loop2.pl line 19.

Thank you very much you really understood my problem and i really want to perform the task you just said. But problem is that i am working on platform where i have no access to download Modern::Perl module so i want to ask if there is any other way to perform this job. Thanks for your help

  • Comment on Re^2: No such file or directory at R_loop2.pl line 19.

Replies are listed 'Best First'.
Re^3: No such file or directory at R_loop2.pl line 19.
by Corion (Patriarch) on Aug 28, 2012 at 09:09 UTC

      you may be right , but even i changed the say to print but there are compilation error at line 1 indicating Modern::Perl . i will be so thankful if you guide me in any alternative way. THANKS

        Have you tried removing that line?

        Also read perlsyn and use, maybe.

        A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: No such file or directory at R_loop2.pl line 19.
by Kenosis (Priest) on Aug 28, 2012 at 14:44 UTC

    I notice you've been advised (multiple times) to just remove the offending line. I suspect, though, that you may get similar messages with the other two modules.

    When there's a task like yours, it's good to first see if there's a module for it (or some components of it), as modules can help avoid 'reinventing the wheel,' are often mature and well-tested, and can reduce development time and programmatic errors. Some, however, may have to work with the Perl environment as is, with no option to install modules.

    Given the above, see the modified script below (that's not a subroutine):

    use strict; use warnings; my ( $file, $loop, %seen ) = 'junk.txt'; open my $fh1, '<', $file or die "Unable to open $file: $!"; while ( my $fileName = <$fh1> ) { chomp $fileName; print "The packet traversed this path in $fileName:\n"; open my $fh2, '<', $fileName or die "Unable to open $fileName: $!" +; while ( my $fileLine = <$fh2> ) { $fileLine =~ /(\d+\.\d+\.\d+\.\d+)/ or next; $loop++ if ++$seen{$1} > 1; print "$1\n"; } close $fh2; print "\n"; } close $fh1; print "** Routing Loop Detected **\n" if $loop;