Skip to Content
Perl by Example
book

Perl by Example

by Ellie Quigley
December 2014
Beginner
888 pages
25h 23m
English
Addison-Wesley Professional
Content preview from Perl by Example

Chapter 16. Interfacing with the System

Image

When you finish this chapter, you should understand the following program:

use Cwd;use File::Spec;print cwd, "\n";my $dir = File::Spec->rootdir;chdir $dir;opendir(DIR, $dir) or die $!;my @files=readdir DIR;@files = sort {$a cmp$b} @files;foreach my $file (@files){   print "$file\n" if -r $file;}closedir DIR;chdir $ENV{HOME};print cwd, "\n";

16.1 System Calls

Those migrating from shell (or batch) programming to Perl often expect that a Perl script is like a shell script—just a sequence of UNIX/Linux (or MS-DOS) commands. However, system utilities are not accessed directly in ...

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

Beginning Perl

Beginning Perl

Curtis Ovid Poe
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe
Mastering Perl

Mastering Perl

brian d foy
Learning Perl 6

Learning Perl 6

brian d foy

Publisher Resources

ISBN: 9780133593068Purchase book