Prev: FAQ 9.14 How do I make sure users can't enter values into a form that cause my CGI script to do bad things?
Next: FAQ 9.17 How do I check a valid mail address?
From: Willem on 31 Mar 2010 16:47 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 31 Mar 2010 16:51 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 31 Mar 2010 16:54 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 31 Mar 2010 17:36 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 31 Mar 2010 17:37
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-- |