[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [texlive-new] Creating rules file from a single template



On Friday 22 December 2006 02:00, Norbert Preining wrote:
> ----- b.pl --------
> use aaa;
>
> myopen(FOO,"aaa.pm");
>
> my @bar = <FOO>;
> print "bar=@bar...\n";
> -------------------

FOO is passed like a string to myopen.  Perl's open treats
the string somewhat like interning in Lisp to create a
symbol.  The net result is that the filehandle "aaa::FOO"
is used.

A workaround is "myopen(main::FOO ..." although you'll
still get the "used only once" warning.

Alternatively you could change the design to have myopen
return a new file handle.  This makes it easier if you
later need to implement recursion such as nested includes.

I use Perl a lot but I can't say I like it.

--Mike Bird



Reply to: