Perl: nothing happens when I run "perl" from the command line

If I run on my perlown from the linux command line, nothing happens. I see that the cursor moves along the line, and if I enter print "Hello, world";, nothing happens anyway. Is there anything I can enter from the command line? I know that you can run perl -e 'print "Hello, world"';and how to create a perl script. Just wondering why the launch perlitself does nothing.

+3
source share
5 answers

Enter the following:

$ perl
print "Hello World\n";
Ctrl-D
Hello World
$

In the last line, you hold down the control key and press D. Without typing Ctrl-D.

stty -a, , Ctrl-D - EOF. Perl STDIN. , ?

+6

(Windows, cmd shell), perl, STDIN, Ctrl-Z, . :

C:\perl>perl
$a = "asd";
print "\$a = '$a'";
^Z
$a = 'asd'
C:\perl>perl
use Data::Dumper;
print Dumper [ 3.14 ];
^Z
$VAR1 = [
          '3.14'
        ];

, cmd .

+4

perl Linux, perl , @david-w

Perl, perl perl -d -e 42 Perl Shell (psh).

perldoc perlrun perldoc perldebug .

+3

Try:

perl -e "print 'Hello World';"

perl . ( , , )

0

I think you are looking for perl shell .. aka PSH

https://metacpan.org/pod/distribution/psh/doc/psh.pod

0
source

All Articles