Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

unix commands and perl modules war

by jesuashok (Curate)
on Apr 07, 2006 at 09:22 UTC ( #541826=perlmeditation: print w/ replies, xml ) Need Help??

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
Software Developers
Business men

Result :-
Healthy Competition

"Keep pouring your ideas"

Comment on unix commands and perl modules war
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 (Deacon) on Apr 07, 2006 at 14:02 UTC
    I add:

    snmp -> Net::SNMP
Re: unix commands and perl modules war
by parv (Priest) 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://541826]
Approved by ww
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2015-12-01 11:35 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (4 votes), past polls