I'm trying to run basic functions on Perl (Mac) but I get the same error message all the time. I managed to run programs like the simple 'hello, world' example. They work fine:
$ perl -w hello.pl
Hello World
But when I try different things, such as assigning a value to a variable, it gives me a message such as:
$number = 13*2;
-bash: =: command not found
Commands such as list seem to work, but I get the bash error all the time. I read that it can be related to the path but not sure how to exactly verify this and what's the bash doing here.
number = 13*2;
to thebash
prompt? If yes, remove the spaces around the=
sign.$
symbolizes thebash
prompt or you typed it literally? If the later, thenbash
expanded it to nothing then tried to execute the resulted command:=13*2
. You can not just mixbash
andperl
syntax like that.