advantages of Perl ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting advantages of Perl ?
# 1  
Old 07-25-2007
Power advantages of Perl ?

What is the advantages of Perl in Unix environnement.
Is it for scripts ? Text manipulation ?
Have you a Concrete exemple of perl utilisation.
Thanks you
# 2  
Old 07-25-2007
The main advantage is the CPAN, http://www.cpan.org/
# 3  
Old 07-26-2007
There are tasks that are very hard or impossible even with a powerful shell like ksh. Example: unix keeps time internally in seconds since the epoch. What date and time would 1164876000 correspond to? That would be a complex shell script if you had only a Posix shell and Posix utilities to work with. Perl solution:

perl -e 'print scalar localtime(shift),"\n"' 1164876000

Perl can manipulate text quite adroitly but so can Posix shells. I switch to perl when my requirements exceed the power of a shell. Often I use perl to write one-liners as above to assist the shell. While I doubt that you could write a device driver in perl, perl approaches c in power.
# 4  
Old 07-26-2007
make a substitution in a list of files
and
make a backup copy of each:


Code:
perl -i.bak -pe 's/THIS/THAT/g' *

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Solaris 10 Failsafe mode advantages and disadvantages

Hi Guys, Have you tried running Solaris 10 on Failsafe mode? What are their advantages and disadvantages? What would you recommend for a roll-back plan in case something happens after failsafe mode? I need to run on failsafe mode to be able to execute fsck. Appreciate your kind... (1 Reply)
Discussion started by: bocha
1 Replies

2. Programming

C++ - 'try, throw, catch' compare to regular C-style 'if' - advantages?

(I have long gap to communicate with C++ and do not recall if I have used 'try-catch' at all; so, looking for advice...) I am trying to understand what the benefits of using that C++ error handling style compare to regular C-style 'if-then'? Still in the try{} block need to do some 'if()' to... (4 Replies)
Discussion started by: alex_5161
4 Replies

3. UNIX for Dummies Questions & Answers

What are some advantages of Unix?

What are some advantage's of Unix (3 Replies)
Discussion started by: alvin2132
3 Replies

4. Shell Programming and Scripting

BASH vs PERL Advantages & Disadvantages

Hi Anyone can compare and contrast differences, Advantages & Disadvantages between BASH vs PERL just a need few points on both Thanks (4 Replies)
Discussion started by: karthikn7974
4 Replies

5. UNIX for Dummies Questions & Answers

advantages of cpio command?

hi, can any body tell me the advantages of having cpio command over tar command (7 Replies)
Discussion started by: prasannak
7 Replies

6. What is on Your Mind?

Advantages and Disadvanted of being able to modify UNIX?

Does anyone know what are the Advantages and Disadvanted of being able to modify UNIX? I'm am stuck on this .. Anyone help would be greatly appericated. :) (1 Reply)
Discussion started by: MTVALDEZ
1 Replies

7. UNIX for Dummies Questions & Answers

Advantages of Groups

What are the advantages of putting users into groups? I understand that in a corporate environment, you should create a group for each department. ie: putting finance employees into a finance group. But are there any system advantages for doing that? How would it make it easier on the system... (3 Replies)
Discussion started by: kurtmc
3 Replies

8. UNIX for Dummies Questions & Answers

Linux advantages?

Hello to help me with my studying of unix/linux outside of work I was thinking of installing Linux at home aswell as using Windows XP. Im pretty new to Linux and Unix, could someone tell me the possible benifits or even negatives of running Linux at home as an opperating system as opposed to... (2 Replies)
Discussion started by: Loaded Gun
2 Replies
Login or Register to Ask a Question