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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Untar in perl
by Fletch (Bishop) on May 16, 2007 at 14:37 UTC

    Because you named your variable $tar_obj then you try and call a method on $tar. You mistyped the variable names which is exactly what those warnings and errors are telling you if you'd bother to read them.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Untar in perl
by syphilis (Archbishop) on May 16, 2007 at 14:50 UTC
    Name "main::tar" used only once: possible typo at u.pl line 4

    That's not an error - it's a warning to alert you to the fact that the variable "$tar" appears only once in the script. That's worthy of a warning because, generally, there's no point in mentioning a variable only once in a script. If you had been on the ball (so to speak) you would then have realised that the Archive::Tar object you created was called $tar_obj, not $tar. (If you had coded in a 'use strict;' you would not have needed to be "on the ball".)

    Anyway ... as I'm sure you now realise, you can only call the get_files method on Archive::Tar objects, and whereas $tar_obj is one such Archive::Tar object, $tar is not :-)

    Cheers,
    Rob