Perl Tutorial : Perl data types
Perl Tutorial : Perl Operators
Perl Tutorial : Perl loops
Perl Tutorial : Perl Conditionals
Perl Tutorial : Perl Subroutines
Perl Tutorial : Perl regex
Perl Tutorial : Perl Files
Perl Tutorial : Perl & Databases
Perl Tutorial : Perl OOPs
Perl Tutorial : Perl signals
Perl Tutorial : Perl threads
Perl Tutorial : Perl Debugging

Introcution to Perl CGI

Introduction to modperl
Home >> perldatatypes >>

@ARGV and %ENV

The built-in array @ARGV contains the command line arguments for a Perl program. The following run of the Perl program critic.pl will have the ARGV array ("-poetry", "poem.txt"). unix% perl critic.pl -poetry poem.txt

%ENV contains the environment variables of the context that launched the Perl program.

@ARGV and %ENV make the most sense in a Unix environment. So for example you have a script like test.pl
#!/usr/bin/perl
use strict;
my $column=$ARGV[0];
my $database=$ARGV[1];
------run the program now---
$./test.pl ssn employees
in above example we are passing two values as commandline arguments. so $column will have "ssn" and $database will have "employees".
Note: Pass values in quoutes if values have spaces.

Perl functions

scalars and strings

lc
ord

regex (regular expressions)

arrays

shift
split

More..

eval
Share |

Perl Arrays
Perl Data Types
Perl Hash
Perl list
Perl references
Perl Scalar data types
Perl Special Variables

Perl examples

  • How to use Data::Dumper?
  • How to parse config file?
  • Include external module in perl..
  • Download perl

    download stable version of perl
    Perl 5.10.1
    Perl interview Questions
    sed tutorial
    awk tutorial

    Join us on Google Groups

    Subscribe to perl
    Email:
    Visit this group
    Perl Jobs


    privacy | sitemap | disclaim | contact us
    © 2009 perlhome.com