Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Hacking a source filter into the #! line

by ikegami (Patriarch)
on Jul 24, 2014 at 16:59 UTC ( [id://1094939]=note: print w/replies, xml ) Need Help??


in reply to Hacking a source filter into the #! line

The filter only gets the source that follows the use statement (whether inserted by -M or present in the source), so you can simply use
#!/usr/bin/perl use yX; ...

For example,

$ cat yX.pm package yX; use Filter::Simple sub { tr/n-za-mN-ZA-M/a-zA-Z/; }; 1;
$ cat a.pl #!/usr/bin/perl use yX; cevag("Uryyb, Jbeyq!\a");
$ a.pl Hello, World!

Replies are listed 'Best First'.
Re^2: Hacking a source filter into the #! line
by dcmertens (Scribe) on Jul 24, 2014 at 17:23 UTC
    For some reason my reply didn't post. The problem with this approach is that LyX expects the very first non-hash-commented line to be "\lyxformat 474" (or some other number). The only lines that I can modify without breaking LyX's ability to load the document are the #-comment lines, so I need some way to instruct Perl to do something within that line. Thus, #! fun. :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1094939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 03:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found