in reply to Re: "require MIME::Base64" vs "use..."
in thread "require MIME::Base64" vs. "use..."

Yes, that works thanks stevieb!

So "require" was insufficient by itself because I was trying to access one of the functions of MIME::Base64, but that function hadn't been imported, right?

  • Comment on Re^2: "require MIME::Base64" vs "use..."

Replies are listed 'Best First'.
Re^3: "require MIME::Base64" vs "use..."
by 1nickt (Canon) on Jul 07, 2015 at 03:33 UTC

    Yes, and you could have used it anyway if you called it by its full package name:

    #!/usr/bin/env perl use strict; use warnings; use 5.010; require MIME::Base64; my $x = MIME::Base64::encode_base64('abc'); say $x;
    $ perl 1133493.pl $ YWJj $

    Note the extra new line ... you will probably want to chomp what you get back from encode_base64 ....

    Remember: Ne dederis in spiritu molere illegitimi!
      Well said, 1nickt!
      That's working for me, too.
      Thanks very much.
      chomp noted.