O'Reilly logo

Mastering Perl/Tk by Nancy Walsh, Stephen Lidie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving Text

The get function is one you’ll use a lot. It returns the text located from index1 to index2 . If index2 isn’t specified, only the character located at index1 is returned. The usage of get is as follows:

$t = $text->get(index1 [ , index2 ]);

As with any index ranges, index1 must be less than or equal toindex2, or an empty string will be returned.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required