http://qs321.pair.com?node_id=739904

irah has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: remove function
by moritz (Cardinal) on Jan 29, 2009 at 13:55 UTC
    What should it remove? Hash items can be deleted, files can be unlinked, and scalars can be undefed.
Re: remove function
by Corion (Patriarch) on Jan 29, 2009 at 13:56 UTC

    Because we don't know what you mean. Maybe you want the unlink function? Or the delete function? Or maybe the undef keyword/function/value?

    If you can't find it yourself, maybe you can describe to us what kind of function you are searching for.

Re: remove function
by Bloodnok (Vicar) on Jan 29, 2009 at 14:02 UTC
    Your question undoubtedly has the benefit of brevity but, because of that, suffers from being extremely ambiguous - see How do I post a question effectively?.

    A user level that continues to overstate my experience :-))
Re: remove function
by borisz (Canon) on Jan 29, 2009 at 14:01 UTC
    Because perl do not need another name for an already existing function.
    Boris
Re: remove function
by BrowserUk (Patriarch) on Jan 29, 2009 at 14:01 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: remove function
by cdarke (Prior) on Jan 29, 2009 at 15:41 UTC
    At an attempt to take your question seriously, you probably mean the remove program as used by cmd.exe on Microsoft Windows. I suspect that your experience is limited to just that one operating system and just that one shell (cmd.exe, that is). Other operating systems and environments have other names for that. unlink is the name of the UNIX kernel function to delete a file, it is called DeleteFile by the Windows kernel, but 'remove' at the Windows command line and 'rm' at the UNIX command line. I have no idea what it is called on MAC, IBM Mainframe, VMS, or mumble-mumble.

    So, whatever Perl had called it, someone would have complained that it was not the same as they are used to. Update: OK, I'm wrong again, the remove function is part of the ISO C library not cmd.exe, and Mr. Google tells me it is used in other places, like DB2, but I think my point still stands.

      'remove' at the Windows command line and 'rm' at the UNIX command line.

      cmd doesn't have a REMOVE command. The functionality of rm and rm -r is provided by DEL (aka ERASE) and RD (aka RMDIR).

Re: remove function
by leocharre (Priest) on Jan 29, 2009 at 21:14 UTC

    Just because a language does not have a function of the name you are seeking, it does not mean that you can't do what you want to do- just as easily.

    Different (programming) languages have different names for functions, because the people who created the languages- were different people, who had their own idea of what the 'remove' function should be named.

    You're invited to read about perl and find what you are seeking. You can also search for something like 'remove' on that site.

Re: remove function
by swampyankee (Parson) on Jan 30, 2009 at 00:11 UTC

    You mean "Why doesn't Perl have a function named 'remove'?" Because it doesn't. This is exactly the same reason why Perl doesn't have a function named "insert." It may be obvious to you what a remove function would do, but it does beg the question "remove what?"

    A lot of functions that interact with the file system are derived from Unix system calls, and unlink is one of them.

    Incidentally, your node title is not terribly informative. It could easily mean "what is the remove function," "how does one remove a function," or "where is the function named remove?" Indeed, my first interpretation was the second, whereas your meaning seems to be closer to the third.


    Information about American English usage here and here. Floating point issues? Please read this before posting. — emc