cramdorgi has asked for the wisdom of the Perl Monks concerning the following question:

I am using a ClearCase::Argv module on a routine basis, and it loads and works without glitches.
Now, I start using it from an other module, ClearCase::Wrapper, which offers user customization from a script in the user home directory. It runs this one as follows:
if (-r "$ENV{HOME}/.clearcase_profile.pl" && ! -e "$libdir/NO_OVERRIDES") { require "$ENV{HOME}/.clearcase_profile.pl"; }
I set such a script, and need within it to do a:
require ClearCase::Argv;
I run the same setup on Solaris perl 5.8.8, and on Cygwin perl 5.10.0.

On Solaris, no problem. On Cygwin, everything is fine, apart for one spurious warning for every run of my 'wrapper' (aliased to ct):

$ ct des -fmt "\n" . Name "ClearCase::Argv" used only once: possible typo at \ /usr/lib/perl5/site_perl/5.10/Argv.pm line 308.
This second Argv module is used exactly in the same way on both platforms. The line mentioned doesn't look particularly suspicious to me:
$ cat -n /usr/lib/perl5/site_perl/5.10/Argv.pm | sed -n 304,311p 304 $self = {}; 305 if ($proto ne __PACKAGE__) { 306 # Inherit class attributes from subclass class attributes. 307 no strict 'refs'; 308 for (keys %$proto) { 309 $self->{$_} = $proto->{$_}; 310 } 311 }
Any clue to help me to debug and understand this?
Thanks!
Marc

P.S. The modules are available from CPAN, but work only around a proprietary tool: IBM/ClearCase.

Replies are listed 'Best First'.
Re: Spurious warning from require'd package
by AnomalousMonk (Archbishop) on May 06, 2009 at 19:31 UTC
    Please Update your original post so as to use  <code> ... </code> or  <c> ... </c> tags around code and output sections rather than using  <pre> ... </pre> tags, which screw up site rendering. Please see Writeup Formatting Tips, in particular recommendation 2.
Re: Spurious warning from require'd package
by cramdorgi (Acolyte) on May 06, 2009 at 16:01 UTC
    I still don't fully understand, but I got rid of my warning...
    Writing helps reading as usual.
    I noticed that the line I needed my require for was the definition of an object which was itself not used.
    So, I could remove both, and the warning went away.

    I am still interested in explanations and advices, though.

    Marc

      splain
      echo Name "ClearCase::Argv" used only once: possible typo at /usr/lib/ +perl5/site_perl/5.10/Argv.pm line 308. |splain Name "ClearCase::Argv" used only once: possible typo at /usr/lib/perl5/site_perl/5.10/Argv.pm line 308. (#1) (W once) Typographical errors often show up as unique variable nam +es. If you had a good reason for having a unique name, then just menti +on it again somehow to suppress the message. The our declaration is provided for this purpose. NOTE: This warning detects symbols that have been used only once s +o $c, @c, %c, *c, &c, sub c{}, c(), and c (the filehandle or format) are con +sidered the same; if a program uses $c only once but also uses any of the +others it will not trigger this warning.
        Thanks.
        Somehow, the name that was reported as used only once should not have been "ClearCase::Argv" (the class name), but rather this of the object of that type, which was created and then not used anymore (after I had removed some code).

        But otherwise, the warning was useful and spotted a real, if minor, issue.

        Marc