Package file details: ---------------------
package Vm; use warnings; use strict; sub latest { my $late = `ssh root\@10.10.21.15 'cat /usr/local/LATEST_VULN'` +; chomp($late); print "$late\n"; } 1; ====================================================== perl script using above package called "Vm" #!/usr/bin/perl use warnings; #use strict; use Vm; my $lat = Vm::latest(); print $lat; sub RedHat { my $path; $path = `ssh root\@10.10.21.15 'cat /usr/local/$lat/qscheme/redhat_com +p.qsv'`; chomp($path); open(FILE,'>redhat.txt'); print FILE $path; close FILE; open(REDHAT,'<redhat.txt'); while (<REDHAT>) { chomp; if (/$ARGV[0]/) { print "$ARGV[0] exists in Redhat_comp.qsv\n"; } } } RedHat($ARGV[0]);
===================================================

Question: When I run my perl script it says: VULN-1.24.80-1 1 cat: /usr/local/1/qscheme/redhat_comp.qsv: No such file or directory

It basically does not take "VULN-1.24.80-1" in path, but instead it takes 1, what changes should I make to script or package that it starts taking "VULN-1.24.80-1" in path ?

Thanks!!!

In reply to Calling package function returns 1, not data from function by kapoor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.