Assuming that I didn't miss a smiley face, the '-M' option
is a way do a "use" on a Module before executing your
program and the '-e' option allows you to specify the program
text directly on the command line.

Quoting from the "perlrun" FAQ:

  -m[-]module
  -M[-]module
  -M[-]'module ...'
  -[mM][-]module=arg[,arg]...
      -mmodule executes use module (); before executing your program. 

      -Mmodule executes use module ; before executing your program. 
      You can use quotes to add extra code after the module name, 
      e.g., '-Mmodule qw(foo bar)'.

      If the first character after the -M or -m is a dash (-) then 
      the 'use' is replaced with 'no'.

      A little builtin syntactic sugar means you can also say 
      -mmodule=foo,bar or -Mmodule=foo,bar as a shortcut for 
      '-Mmodule qw(foo bar)'. This avoids the need to use quotes 
      when importing symbols. The actual code generated by 
      -Mmodule=foo,bar is use module split(/,/,q{foo,bar}). Note 
      that the = form removes the distinction between -m and -M.

  -e commandline
      may be used to enter one line of program. If -e is given, 
      Perl will not look for a filename in the argument list. 
      Multiple -e commands may be given to build up a multi-line script.

      Make sure to use semicolons where you would in a normal program.

And as Rob (Sisyphus) said, you have to use different quoting
mechanisms under Unix versus Win32 shells. Examples:

  > perl -MLWP -e 'print "$LWP::VERSION\n"'
       this works under Unix shells as the single quotes suppress
       the shell from trying to treat $LWP as an Environment variable
       substitution

  > perl -MLWP -e "print qq($LWP::VERSION\n)"
       this works under the Win32 CMD shell as you can only use
       double quotes around a command line argument. The qq()
       construct is a alternative Perl way of specifying a
       string that allows variable interpolation.

Anyway, hope this helps.

--
Mike Arms


-----Original Message-----
From: Jerry Kassebaum [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 09, 2006 6:04 PM
To: Arms, Mike
Cc: perl-win32-users@listserv.ActiveState.com
Subject: RE: Which LWP?

Mike,

First, thanks!

Second, what was my book doing with telling me to enter

perl -MLWP -e 'print "$LWP::VERSION\n" '

from the command line??????????

Jerry


***************************************

It's just the "LWP" module in "libwww-perl".

Try doing this.

use LWP;
print "version=", $LWP::VERSION, "\n";

- Mike


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jerry Kassebaum
Sent: Thursday, February 09, 2006 10:34 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Which LWP?

Tutors,

I am to the LWP chapter in Suehring's "Beginning Perl Web Development".
I know I need to use PPM to install LWP, but which one??? Here's what I
tried:

ppm> search LWP
Searching in Active Repositories
   1. LWP-attic                      [1.00] LWP-attic
   2. LWP-Authen-Wsse                [0.05] LWP-Authen-Wsse
   3. LWP-Charset                    [0.06] LWP-Charset
   4. LWP-LastURI                    [0.03] LWP-LastURI
   5. LWP-Protocol-http-SocksChain    [1.2] LWP-Protocol-http-SocksChain
   6. LWP-Protocol-http-SocksChain10  [1.3]
LWP-Protocol-http-SocksChain10
   7. LWP-Protocol-sftp              [0.01] LWP-Protocol-sftp
   8. LWP-Protocol-virtual           [0.02] LWP-Protocol-virtual
   9. LWP-Simple-Cookies             [0.01] LWP-Simple-Cookies
  10. LWP-Simple-Post                [0.04] LWP-Simple-Post
  11. LWP-UserAgent-Determined       [1.03] LWP-UserAgent-Determined
  12. LWP-UserAgent-iTMS_Client      [0.15] LWP-UserAgent-iTMS_Client
  13. LWP-UserAgent-TWiki-TWikiGuest [0.01]
LWP-UserAgent-TWiki-TWikiGuest
  14. LWP-UserAgent-WithCache        [0.03] LWP-UserAgent-WithCache
ppm> install libwww-perl
Note: Package 'libwww-perl' is already installed.

Man, it is great to know a clear answer is on the way. Seriously, this
group is great!

Jerry

P.S. My guess is #12. My second guess is #14. #10?





_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to