A hack highly depending on the OS, in other words: It works on my Linux x86_64 computer. Your mileage may vary.
> perl -E 'open my $f,"<","/etc/hosts"; system "/bin/ls","-lF",qq[/pro
+c/$$/fd]' < /etc/passwd
total 0
lr-x------ 1 alex users 64 Apr 4 20:17 0 -> /etc/passwd
lrwx------ 1 alex users 64 Apr 4 20:17 1 -> /dev/pts/0
lrwx------ 1 alex users 64 Apr 4 20:17 2 -> /dev/pts/0
lr-x------ 1 alex users 64 Apr 4 20:17 3 -> /etc/hosts
lr-x------ 1 alex users 64 Apr 4 20:17 4 -> pipe:[2099383]
>
See also:
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|