in reply to use 5.005 with perl v5.16.3

What happens if you run this program
use JSON;

Replies are listed 'Best First'.
Re^2: use 5.005 with perl v5.16.3
by AnomalousMonk (Archbishop) on Aug 05, 2021 at 18:39 UTC

    use JSON; is a statement, not a program. What happens if you provide a program to run?

    Win8 Strawberry 5.8.9.5 (32) Thu 08/05/2021 14:31:49 C:\@Work\Perl\monks >perl -MJSON -e print(1) 1 Win8 Strawberry 5.8.9.5 (32) Thu 08/05/2021 14:33:13 C:\@Work\Perl\monks >perl -e "use JSON; print(1)" 1 Win8 Strawberry 5.8.9.5 (32) Thu 08/05/2021 14:33:41 C:\@Work\Perl\monks >perl -e "use strict; use warnings; use JSON; print(1)" 1


    Give a man a fish:  <%-{-{-{-<

      I suppose it's a matter of semantics ("what constitutes a program?") but I disagree with you. A program consisting of just use JSON; executes a whole bunch of code, any of which could fail for various reasons. That's why the other AM asked.

        ... "what constitutes a program?" .... A program consisting of just use JSON; ...

        It was to answer your question that I gave examples of very simple programs incorporating the use JSON; statement (or possibly other, similar statements) that could actually be run as programs and that might provide useful insight into the root problem.


        Give a man a fish:  <%-{-{-{-<