http://www.perlmonks.org?node_id=541826

War Started Between Unix and Perl

unix starts arrowing on perl, let us see how perl tackles that
find -> File::Find
cp -> File::Copy
grep -> File::Grep
df -> Filesys::DiskSpace
rm -> File::Remove
time -> Benchmark
bash -> Shell
set -> debug
ping -> Net::Ping
ftp -> Net::FTP
telnet -> Net::Telnet
sort -> sort
diff -> Text::Diff
unique -> Array::Unique
date -> Time
mail -> Net::SMTP
ssh -> Net::SSH
scp -> Net::SCP
.
.
.
.
.
It goes on


Judges are
-------------
Industiralists
Software Developers
Business men


Result :-
Healthy Competition

"Keep pouring your ideas"

Replies are listed 'Best First'.
Re: unix commands and perl modules war
by Tanktalus (Canon) on Apr 07, 2006 at 16:32 UTC

    du -> Filesys::DiskUsage

    (I think I've flogged this module more than its author has ;->)

    parv - File::Copy has a mv function that does what you want (according to its POD)

      Darn, yes that it seems; i have to try it. I must be remembring *rename()*. Sorry for the noise.

Re: unix commands and perl modules war
by spadacciniweb (Curate) on Apr 07, 2006 at 14:02 UTC
    I add:

    snmp -> Net::SNMP
Re: unix commands and perl modules war
by parv (Parson) on Apr 07, 2006 at 16:26 UTC

    I haven't noticed a module to do the work of *mv* across file system mount points. If anybody knows of one (besides issuing a call to *mv*), please let me know.

      Worse still, there's no flag you can give mv to stop it moving across file systems!
      "This is the Unix philosophy:
      
          Write programs that do one thing and do it well.
          Write programs to work together.
          Write programs to handle text streams, because that is a universal interface." 
      
      (my bolding)

      So mv is a wrapper around the rename() system call but it also includes cp -r and rm -r whether you want them or not. It wouldn't be so bad if it was a reversible operation but if any of your files were hard links then you're screwed.

Re: unix commands and perl modules war
by szabgab (Priest) on Apr 14, 2006 at 09:28 UTC
    Interestingly I have just started to work on File::Tools and Pipe that might be interesting for you.