On Jun 4, 2009, at 8:10 PM, Raymond Wan wrote:

Chap Harrison wrote:
I've read perldoc perlrun but find it pretty confusing. Things I've tried unsuccessfully are:
#!/usr/bin/perl /dev/clipboard
#!/usr/bin/perl < /dev/clipboard
#!/usr/bin/perl -- /dev/clipboard
The body of the script always begins

I'm not sure if that is what you want. Suppose these lines are in a file "foo.pl". Then you want foo.pl to run and for it to read in / dev/clipboard. In the above, it seems like you want Perl to run / dev/clipboard instead -- which is perhaps not what you are looking for.

You can avoid opening the file by taking it as STDIN:

foo.pl </dev/clipboard

Isn't that what you want?

Hi Ray,

That's what I want, yes. Was just hoping that, since "/dev/clipboard" is a constant and I'd be executing the command frequently, I could somehow avoid having to type into the command line.

Looks as if there's no way to specify it in the shebang line. No matter; I can just hard-code the 'open' inside the script itself. Or, for that matter, just invoke 'foo.pl </dev/clipboard' with an alias!

TMTOWTDI, as they say.

(Actually I dropped the whole idea when I decided to have the script write the filtered results back into the clipboard -- which necessitated hard-coding the path into the script anyway. Moreover, the whole thing is so non-portable to begin with, there's no point in all this effort!)

Thanks,
Chap


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to