ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.8 by root, Mon Jan 2 20:35:39 2006 UTC vs.
Revision 1.10 by root, Mon Jan 2 20:47:52 2006 UTC

2 2
3rxvtperl - rxvt-unicode's embedded perl interpreter 3rxvtperl - rxvt-unicode's embedded perl interpreter
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7* Put your scripts into F<@@RXVT_LIBDIR@@/urxvt/perl-ext/>, they will be loaded automatically. 7 # create a file grab_test in $HOME:
8
9* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and
10thus must be encoded as UTF-8.
11 8
12 sub on_sel_grab { 9 sub on_sel_grab {
13 warn "you selected ", $_[0]->selection; 10 warn "you selected ", $_[0]->selection;
14 () 11 ()
15 } 12 }
16 13
17 1 14 # start a @@RXVT_NAME@@ using it:
15
16 @@RXVT_NAME@@ --perl-lib $HOME -pe grab_test
18 17
19=head1 DESCRIPTION 18=head1 DESCRIPTION
20 19
21Everytime a terminal object gets created, scripts specified via the 20Everytime a terminal object gets created, scripts specified via the
22C<perl> resource are associated with it. 21C<perl> resource are loaded and associated with it.
22
23Scripts are compiled in a 'use strict' and 'use utf8' environment, and
24thus must be encoded as UTF-8.
23 25
24Each script will only ever be loaded once, even in @@RXVT_NAME@@d, where 26Each script will only ever be loaded once, even in @@RXVT_NAME@@d, where
25scripts will be shared (But not enabled) for all terminals. 27scripts will be shared (But not enabled) for all terminals.
26 28
27=head2 General API Considerations 29=head2 General API Considerations
226sub invoke { 228sub invoke {
227 local $term = shift; 229 local $term = shift;
228 my $htype = shift; 230 my $htype = shift;
229 231
230 if ($htype == 0) { # INIT 232 if ($htype == 0) { # INIT
231 my @dirs = ((split /:/, $term->resource ("perl_lib")), $LIBDIR); 233 my @dirs = ((split /:/, $term->resource ("perl_lib")), "$LIBDIR/perl");
232 234
233 for my $ext (split /:/, $term->resource ("perl_ext")) { 235 for my $ext (split /:/, $term->resource ("perl_ext")) {
234 my @files = grep -f $_, map "$_/$ext", @dirs; 236 my @files = grep -f $_, map "$_/$ext", @dirs;
235 237
236 if (@files) { 238 if (@files) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines