Difference between die and exit in Perl?
Answer:
The main differences:
- die can output a message, e.g. die("File not found"), exit cannot
- die is catchable using eval, exit just quit from the process anyway
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Difference between die and exit in Perl?
Answer:
The main differences:
How to find out whether reference is pointing to a scalar, array or hash in Perl?
Answer:
Use the ref() function
my $data = [1,2,3];
print ref($data); # print out ARRAY
How to remove HTML from text using PHP?
Answer:
strip_tags is useful to remove HTML from text .
<?php
$text = '<p>Test paragraph.</p>';
echo strip_tags($text);
How to unset an environment variable in bash
Answer:
To unset an environment variable in bash, you can use the unset command.
Example:
# export foo=bar
# echo $foo
bar
# unset foo
# echo $foo
Install Xdebug for PHP under Ubuntu
Answer:
Xdebug is a very useful debugging extension for PHP, to install under Ubuntu:
# sudo pecl install xdebug
# echo "extension=xdebug.so" > /etc/php.d/xdebug.ini
Restart Apache and that's all.