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

Perl 5.18 Darwin -bash: use: command not found How can I get use to work? Reloaded module multiple times with no luck

Replies are listed 'Best First'.
Re: -bash: use
by Discipulus (Canon) on Jul 01, 2017 at 13:16 UTC
    Hello KW7 and welcome to the monastery and to wonderful world of Perl!

    ..but.. what are you asking about? to have the best from perlmonks you must learn to show some effort, asking clear questions with more information as you can: see How do I post a question effectively? and How (Not) To Ask A Question.

    If you have code or commandline question see Short, Self-Contained, Correct Example

    At glance it seems you have a problem calling Perl: in Linux like environments perl is called or via shebang #!/path/to/perl at the top of the script, or directly in bash like perl /path/to/script.pl

    What I see is bash complaing the use command is not found. use is Perl stuff. To use module in the command line, let's say a perl oneliner you: perl -MModule::To::Use  -e '..oneliner..'

    PS cross posting it is not prohibited here at BUT it is considered polite to mention that your question is a crosspost. Be kind if you want kind replies!

    Anyway, is your first post; many things to learn! welcome!

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: -bash: use
by haukex (Archbishop) on Jul 01, 2017 at 13:10 UTC

    Could you give us enough information to reproduce the issue, like what the top of your script looks like and how you're running it? See also SSCCE and How do I post a question effectively?

    Just a guess: Does your script start with #!/usr/bin/perl or similar, or not? Are you running your script via perl scriptname.pl, ./scriptname.pl, or maybe even . scriptname.pl?

      This is a module - not a script I am using Darwin 5.18.

        Are you trying to run your module?

        That's not how modules work.

        Maybe show us what you are actually doing?

Re: -bash: use
by kcott (Archbishop) on Jul 02, 2017 at 05:43 UTC

    G'day KW7,

    Welcome to the Monastery.

    I can replicate your output exactly, on the same platform, using the same Perl version:

    $ perl -v | head -2 | tail -1 This is perl 5, version 18, subversion 0 (v5.18.0) built for darwin-th +read-multi-2level $ use whatever -bash: use: command not found $

    Now you need to do the same thing, showing us how you generate this output.

    Show us exactly what you're typing at the command line, and exactly what output you're getting back. Post this within <code>...</code> tags.

    Do not post vague, prosaic descriptions of what you're doing or what you're getting back. We need to see this verbatim.

    Do not just mention some unspecified CPAN source. Provide a link. See "What shortcuts can I use for linking to other information?" if you don't know how to do that.

    Do follow the links already provided ("How do I post a question effectively?" and "Short, Self-Contained, Correct Example"). Read their contents and follow the guidelines therein.

    We're happy to help; you need to provide us with the information to do so.

    — Ken

Re: -bash: use (cpan-module "use")
by LanX (Saint) on Jul 01, 2017 at 21:51 UTC
    you seem to be talking about a cpan-module called "use" !

    (which is a very "peculiar" name for a module, because we have a built-in called use )

    * SYNOPSIS # Use several modules in command line: % perl -Muse=CGI,DBI,PPI -e '...' # Import several modules at once use use qw[ strict warnings methods invoker ]; # Pass options as array refs use use 'strict', 'warnings', 'HTTP::Status' => [':constants']; # Pass required versions after module names use use '5.12.0', 'HTTP::Status' => '6.00' => [':constants']; # ...or in your own module, importing on behalf of its caller: package MY::Macro; sub import { use use; local @_ = qw[ Module1 Module2 ]; goto &use::use; }

    please learn how to use <code>..</code> tags next time °

    Questions:

    • did you already install that module?
    • what is the result of perldoc use
    • what is the result of perldoc -l use

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    °) for more tips, please see

  • Markup in the Monastery
  • How do I post a question effectively?
Re: -bash: use
by karlgoethebier (Abbot) on Jul 01, 2017 at 14:40 UTC

    Just show the module and the script. Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help