develooper Front page | perl.beginners | Postings from September 2019

symlink to "pack"

Thread Next
From:
Jorge Almeida
Date:
September 7, 2019 20:25
Subject:
symlink to "pack"
Message ID:
CAKpSnpLxnsBvHuj5qqfzTnbFUfzWjG2Hw3ckfdsV93A_ArXCBA@mail.gmail.com
Sorry about the title, it's the best I can do...

#!/usr/bin/perl
use strict;
use warnings;
my $num=12;
my $target=pack('n', $num);
symlink($target, "foo") || die $!;

It dies with "No such file or directory"
No symlink is created. What I want is a symlink named "foo" pointing
to a 2-byte string. Yes, it would be a broken symlink. (Yes, this is
how I want it).

Symlink() can create broken links, the problem is the target. What to
do? (And why doesn't it work?)

TIA

Jorge Almeida

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About