[Israel.pm] Unlink v/s deletion
Yosef Meller
mellerf at netvision.net.il
Mon Feb 16 05:41:48 PST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Srikanth Madani wrote:
| Perfect; it works!
| I looked at the example from the man pages:
| $cnt = unlink 'a', 'b', 'c';
| and did not realize that the single quotes are only for single characters.
That's not it. single quotes return whatever's inside as-is, while
double quotes replace variables with their values (and other neat
stuff). So:
if $a = 1, $b = 2, $c = 3,
"$a $b $c" returns the string 1 2 3
'$a $b $b' returns the string $a $b $c
IIRC in C single quotes are for charachters, but it's not like that in Perl.
- --
perl -e'$b=unpack"b*",pack"H*","59dfce2d6b1664d3b26cd9969503";
for(;$a<length$b;$a+=9){print+pack"b8",substr$b,$a,8;}'
My public key:
http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0x3D2CA0A8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAMMicaElZPz0soKgRAhNbAJ9Bf6Go07rIegIDB+kA1f+vKnuD9ACbBBVY
jEm3u3KwVpZ9oeO5APr9AZM=
=CV3D
-----END PGP SIGNATURE-----
More information about the Perl
mailing list