Bala Murugan wrote:
Hi All,
While running the following temp.pl script, it throws the following error
message.
$ perl temp.pl
HELLO
Compilation failed in require at temp.pl line 2.
$
$ cat temp.pl
#!/usr/bin/perl
require "/home/bala/hello.pl";
$ cat hello.pl
#!/usr/bin/perl
die "HELLO\n";
If anyone knows, could you please let me know the reason and solution to
this issue?
Regards,
Bala.
Hello Bala,
Please go through the perldoc for "require" and "die"
perldoc -f require
The file must return true as the last statement to indicate successful
execution of any initialization code, so it's customary to end such a
file with "1;" unless you're sure it'll return true otherwise. But it's
better just to put the "1;", in case you add more statements.
perldoc -f die
Outside an "eval", prints the value of LIST to "STDERR" and exits with
the current value of $! (errno). If $! is 0, exits with the value of
"($? >> 8)" (backtick `command` status). If "($? >> 8)" is 0, exits
with 255.
Thanks,
Ranish
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>