Natürlich geht das
Ja? Wie?
also nochmal zur Ausgangsfrage:
Ich möchte dieses Modul nur solange in ein CGI-Skript einbinden ein, wie ich daran arbeite. Bin ich mit testen durch, so will ich es wieder entfernen.
Doch leider funktioniert es dies nicht wie gewünscht: Weder use strict noch fatalsToBrowser werden auf das einbindende Skript angewandt. Ich versuchte das Skript per use oder per require einzubinden, und auch das Entfernen des package-Statements brachte keinen Erfolg. Hat jemand einen Hinweis?
WebDebug.pm
package WebDebug;
use CGI::Carp qw/fatalsToBrowser/;
print "Content-type: text/html\n\n";
1;
test.pl
#!/usr/bin/perl -w
# Aufruf der Funktionen
use strict;
use WebDebug;
$xx =
Ausgabe:
Content-type: text/html
[Mon Nov 27 13:15:27 2006] test.pl: Global symbol "$xx" requires explicit package n
ame at x.pl line 7.
[Mon Nov 27 13:15:27 2006] test.pl: syntax error at test.pl line 7, at EOF
Content-type: text/html
<h1>Software error:</h1>
<pre>Execution of test.pl aborted due to compilation errors.
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
</p>
[Mon Nov 27 13:15:27 2006] x.pl: Execution of x.pl aborted due to compilation errors.
zumindest CGI::Carp wird bei mir ausgeführt, use strict wirkt immer nur in dem package in dem es eingebunden wird.
Struppi.
Javascript ist toll (Perl auch!)