[Israel.pm] Unlink v/s deletion

Oron Peled oron at actcom.co.il
Mon Feb 16 07:05:19 PST 2004


On Monday 16 February 2004 16:01, Srikanth Madani wrote:
> 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.

No, they are not! You simply don't have variable interpolation within
the single quotes, so your '$pipe' stays literally what it is.

While we are at it, when printing error messages from failed system calls
(e.g: unlink), you may want to put $! in the message string so you'll get
meaningfull message (e.g: "Permission denied", "No such file or directory").
If you 'use English;' than the previous variable may be named $ERRNO.

-- 
Oron Peled                             Voice/Fax: +972-4-8228492
oron at actcom.co.il                  http://www.actcom.co.il/~oron

"Linux: like the air you breathe, ubiquitous and free"




More information about the Perl mailing list