Skip to Main Content
Perl in a Nutshell, 2nd Edition
book

Perl in a Nutshell, 2nd Edition

by Nathan Patwardhan, Ellen Siever, Stephen Spainhour
June 2002
Beginner content levelBeginner
759 pages
80h 42m
English
O'Reilly Media, Inc.
Content preview from Perl in a Nutshell, 2nd Edition

Name

List

Synopsis

$FTP->List([pattern, listmode])
$FTP->Ls([pattern, listmode])
$FTP->Dir([pattern, listmode])

Returns a list containing the files found in the current directory, matching the given pattern, if specified. The content of the returned list depends on the listmodeparameter, which can have the following values:

1 (default)

The list contains the names of the files found.

2

The list contains seven values for each file:

  • The filename

  • The DOS short filename, a.k.a. 8.3

  • The size

  • The attributes

  • The creation time

  • The last access time

  • The last modified time

3

The list contains a reference to a hash for each found file. Each hash contains the following key/value pairs:

name => filename
altname => DOS short filename, a.k.a. 8.3
size => size
attr => attributes
ctime => creation time
atime => last access time
mtime => last modified time

All times are reported as strings of the following format: second, hour, minute, day, month, year. For example:

$file->{'mtime'} == "0,10,58,9,12,1996"
# Stands for 09 Dec 1996 at 10:58:00
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

Perl by Example, Fourth Edition

Perl by Example, Fourth Edition

Ellie Quigley
Perl Cookbook, 2nd Edition

Perl Cookbook, 2nd Edition

Tom Christiansen, Nathan Torkington
Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Learning Perl, 7th Edition

Learning Perl, 7th Edition

Randal L. Schwartz, brian d foy, Tom Phoenix

Publisher Resources

ISBN: 0596002416Errata Page