Notice: Undefined variable: elink in /var/www/tuxnet24.de/codebase-1.03/include/function-main.inc.php on line 1956

Notice: Undefined variable: dlink in /var/www/tuxnet24.de/codebase-1.03/include/function-main.inc.php on line 1956

Notice: Undefined variable: elink in /var/www/tuxnet24.de/codebase-1.03/include/function-main.inc.php on line 1956

Notice: Undefined variable: dlink in /var/www/tuxnet24.de/codebase-1.03/include/function-main.inc.php on line 1956
Perl - env.pl
38.107.191.114 |    

Navigation

Google Advertisement

Diese Skript macht das gleiche wie in der Bash der Befehl env und zeigt die Umgebungsvariablen an.

env.pl
  1. #!/usr/bin/perl
  2.  
  3. print $_." => ".$ENV{$_}."n" foreach ( sort ( keys %ENV ) );
Parsed in 0.009 seconds at 8.96 KB/s

Diesen Befehl kann man in der Commend Line wie folgt ausühren, ohne es erst in einem Skript zu speichern:
tux@earth:~$ perl -e 'print $_." = ".$ENV{$_}."\n" foreach ( sort ( keys %ENV ) );'
Posted by Marko Schulz at 2009-01-03 02:26:02
 

Will man das Skript als CGI Skript und die Ausgabe in HTML haben, kann man folgendes verwenden:
#!/usr/bin/perl
# file: env.cgi
print "Content-Type: text/html\n\n";
print "<b>".$_."</b> = <i>".$ENV{$_}."</i><br/>\n" foreach ( sort ( keys %ENV ) );
Posted by Marko Schulz at 2009-01-03 02:26:26
 

Search
 
Full text search by name and content of a snippet.

User online
There are 5 users online.

Tags Cloud

Latest snippets
urlencode
(Perl::Function)
gethostbyaddr
(Perl::Function)
create_function
(JavaScript::Snippets)
function_exists
(JavaScript::Snippets)
listing
(PHP::Function)
runPhpCode
(PHP::Function)
md5
(Bash::Function)
rtrim
(Bash::Function)
ltrim
(Bash::Function)
function_exists
(Bash::Function)