Skip to Content
Programming PERL in the .NET Environment
book

Programming PERL in the .NET Environment

by Yevgeny Menaker, Michael Saltzman, Robert J. Oberg
September 2002
Intermediate to advanced content levelIntermediate to advanced
496 pages
10h
English
Addison-Wesley Professional
Content preview from Programming PERL in the .NET Environment

Built-in Arrays and Hashes

We have introduced a few special Perl variables, such as $. and $_. Perl also has a few built-in arrays.

@ARGV

One special array in Perl is the @ARGV array. This array is the collection of strings passed in on the command line. For example, if you execute your Perl program as

% perl program.pl these are a few pieces of data

then the array @ARGV contains the strings

these are a few pieces of data

Here is a program that will familiarize you with some common uses of the @ARGV array. The program raises the first argument to the second argument power. The first part of the program is error checking. See the folder Power.

 % type power.pl # # power.pl # die "usage: perl power.pl base power\n" unless $#ARGV == 1; die "first ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Sams Teach Yourself Perl in 21 Days, Second Edition

Sams Teach Yourself Perl in 21 Days, Second Edition

Laura Lemay, Rafe Colburn
Pro Perl

Pro Perl

Peter Wainwright

Publisher Resources

ISBN: 0130652067Purchase book