From: Willem on
Phred Phungus wrote:
) $ perl1.pl
) bash: perl1.pl: command not found
) $
)
) I thought the idea for the shebang line was that my OS was going to
) interpret the script with perl. I do have a /usr/bin/perl, so I thought
) that typing perl1.pl at the prompt would be the same as typing perl
) perl1.pl, but manifestly, it is not. What gives?

chmod +x perl1.pl

For more detail, ask in a unix froup.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
From: Ben Morrow on

Quoth Phred Phungus <Phred(a)example.invalid>:
>
> $ perl perl1.pl
> Placido P. Octopus
> Polypacido P. Octopus
> Placido P. Octopus
> Placido P. Octopus
> $ cat perl1.pl
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my $string = "Placido P. Octopus\n";
> my $regex = "P.";
> print $string;
> $string =~ s/$regex/Polyp/;
> print $string;
>
> my $string2 = "Placido P. Octopus\n";
> print $string2;
> $string =~ s/$regex/Polyp/g;
^^^^^^^
> print $string2;
^^^^^^^^

One of these things is not like the other.

Ben

From: Ben Morrow on

Quoth Willem <willem(a)turtle.stack.nl>:
> Phred Phungus wrote:
> ) $ perl1.pl
> ) bash: perl1.pl: command not found
> ) $
> )
> ) I thought the idea for the shebang line was that my OS was going to
> ) interpret the script with perl. I do have a /usr/bin/perl, so I thought
> ) that typing perl1.pl at the prompt would be the same as typing perl
> ) perl1.pl, but manifestly, it is not. What gives?
>
> chmod +x perl1.pl

$ ./perl1.pl

> For more detail, ask in a unix froup.

Indeed.

Ben

From: Sherm Pendley on
Phred Phungus <Phred(a)example.invalid> writes:

> $ perl1.pl
> bash: perl1.pl: command not found
> $
>
> I thought the idea for the shebang line was that my OS was going to
> interpret the script with perl.

Yes, that's the idea.

> I do have a /usr/bin/perl

So? The error message doesn't say "/usr/bin/perl: command not found".

> What gives?

The "perl1.pl" command was not found in your command search path. You
need to specify the full path to it:

$ ./perl1.pl

sherm--
From: Sherm Pendley on
Willem <willem(a)turtle.stack.nl> writes:

> Phred Phungus wrote:
> ) $ perl1.pl
> ) bash: perl1.pl: command not found
>
> chmod +x perl1.pl

That's not the error being reported above.

sherm--