I'm learning perl now. By using whereis command, I found out where perl command is.
$whereis perl
I make a program and tried to execute it. But I got error message like this one.
$perl yahoo_search.pl #!/usr/bin/perl
-bash: !/usr/bin/perl: event not found
Can somebody tell me what I should do to solve this problem?

Re: /usr/bin/perl event not found 80 80

The ! character is the default history modifier used by the bash shell (and nothing to do with perl). ! followed by all sorts of things, does all sorts of things.


ls file.pl
cat !$

!$ refers to the last parameter of the previous command, so this would be in effect the same as typing cat file.pl If you really want a ! on the command line, you need to escape it with \ $perl yahoo_search.pl #\!/usr/bin/perl Also, # is regarded as a comment by bash.

The #!/usr/bin/perl is usually the first line of whatever prog.pl file you're creating. More specifically, I go with #!/bin/perl -w

Re: /usr/bin/perl event not found 80 80

just use perl yahoo_search.pl . Also remember to include #!/usr/bin/perl as first line in source code, will help later if you want to make the file executable.


Re: /usr/bin/perl event not found 80 80

Hi, This post is very informative, however I would like some specific information. If someone can help me then please send me a private message. Best Regards,

Re: /usr/bin/perl event not found 80 80

Actually, can anyone who is able to help not send a PM but answer the question here, in forum, so that all DaniWeb members can benefit.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.