Perl

From Code Trash
Jump to: navigation, search
Here are some little notes i wished to take while i browser the tutorials of perl. 
The contents will change in due course of time

Array Indexing

The array indexing in perl. use (-index number) to access the nth element or n-1th element.

For example
@coin=('1','2','3')
you can use
@coin[-1]
to fetch 3 and -2 to fetch 2.

Array without quotes using qw subroutine

@coins = qw(Quarter Dime Nickel);
print "@coins";

How to's

Run perl in xampp windows


Postby jayapalchandran » 21. October 2009 17:41
Hi,
This is my cgi-bin folder
D:\www\xampp\cgi-bin

the shebang is like this
#!"D:/www/xampp/perl/bin/perl.exe"

and perl is in the folder like in the above path of shebang

here is my script alias entry in httpd.conf

ScriptAlias /cgi-bin/ "D:/www/xampp/cgi-bin/"

and the directory entry is as follows

<Directory "D:/www/xampp/cgi-bin">
AllowOverride All
Options Indexes FollowSymLinks ExecCGI
Order allow,deny
Allow from all
</Directory>

my file is printenv.pl and is saved in cgi-bin folder

but still i couldn't make the file run

i call it like localhost/printenv.pl

i get 404 error.

what shall i do?