3.16.130.155 |    

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.001 seconds at 99.78 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 6 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)