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

Text Indexes and Modifiers

In a Text widget, several indexes are defined to identify positions in the text. These are used by the methods that retrieve and manipulate text.

n.m

Numbers representing character m on line n

@ x,y

The character closest to the x,y coordinate

end

The end of the text

insert

The character after the insert cursor

current

The position closest to the mouse cursor

mark

Other marks defined for the widget (see discussion of text marks later in this section)

sel.first

The first selected character

sel.last

The character just after the last selected character

tag.first

The first character in the widget of the specified tag type

tag.last

The character just after the last character of the specified tag type

widget

The location of an embedded widget

There are also several modifiers to use with text indexes. They are:

- n lines+ n lines

n lines before or after the index

- n chars+ n chars

n characters before or after the index

linestart

The first character on the line

lineend

The last character on the line (often a newline)

wordstart

The first character in the word

wordend

The character after the last character in the word

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