|
SL Newsletter
|
| Recieve bi-weekly updates on news, new articles, and more |
|
|
|
|

07-25-01, 12:31 PM
|
 |
Developer
|
|
Join Date: Dec 2000
Location: Port Angeles, WA
Posts: 230
|
|
Perl & such..
Anyone have any thoughts on shell programming languages of choice? I've recently been diving into perl.. (for shell only.. I would never use it for web..  ).. any thoughts? (You can see an article on my first Perl attempt at http://www.devnut.com.. it's the current featured article. Btw.. I know there's an error in the code.. (as per the error I recieved last night.. I messed up the virtualhost entry... I'll get it fixed once I get home.)
Thoughts (on shell programming.. not the article..  )..
Ryan
|

07-25-01, 12:41 PM
|
 |
SLCentral.com Staff
|
|
Join Date: Dec 2000
Location: New York, USA
Posts: 354
|
|
well perl is pretty good depending on what you want to do. It's pretty versatile and easy to learn. But you're still talking about a shell script here so there's only so much you can deal with. It makes it easy to do complicated tasks, and you can even set up cron jobs that run automatically if you need to. Again it's still a scripting language so it's going to be slower than something compiled if you want to do more low level stuff.
__________________
SystemLogic.net - Editor
2 Pentium III 1 Ghz 2 Alpha HeatSinks with 38 CFM Delta Fan | Abit VP6 | 512 MB PC-166 | Antec SX1030B with 4 High Output 80mm Sunon Fans | 2 30 GB IBm 75 Drives in RAID 0 | Plextor PlexWriter 16/10/40A | Mitsumi 40x CD-ROM | Generic 3.5" Floppy Drive | VisionTek Geforce 2 GTS 32 MB | Sound Blaster Live! Value | 3com NIC | Diamond Supra Modem | 19" Sony Monitor | Klipsch Promedia V.2-400 Speakers | PcMods.com Sound Sensitive Blue
"No more yankie my wankie. The Donger need food!"
More people are killed annually by donkeys than die in air crashes.
|

07-25-01, 12:47 PM
|
 |
Developer
|
|
Join Date: Dec 2000
Location: Port Angeles, WA
Posts: 230
|
|
Yeah.. well all I want to use it for is simple sysadmin tasks. If you take a look at the article ( http://devnut.com/view.php?x=article&id=perl1 ).. it's extremely simple (my first of course.. hehe..) but saves 3-4 minutes of work by doing it all at once... (any language could do this.. I've just chosen Perl..) (Btw, the scripts purpose, for those that don't wanna read the article, is to simplify virtualhost/user creation (management coming soon)..
Wait and see Part two of the series.. (coming out in the next couple days..) I actually dive into subroutines and stuff.. supplying you with a much more complicated version of the same script
Ryan
|

07-25-01, 02:34 PM
|
 |
Dancing Hero
|
|
Join Date: Feb 2001
Location: Over there
Posts: 1,163
|
|
The thing that scares me about Perl is that some of the code I've seen (Like the DeCSS conversion to Perl) looked like a big block of hexcode with punctuation randomly tossed about here and there. The code just didn't make any sense. I haven't looked at any since, so I'd be welcome if someone would prove me wrong here.
__________________
"And knowing is half the battle!"
|

07-25-01, 02:41 PM
|
 |
Developer
|
|
Join Date: Dec 2000
Location: Port Angeles, WA
Posts: 230
|
|
Take a look at the link above .. the code is extremely straightforward and simple..
Ryan
|

07-25-01, 02:47 PM
|
 |
Dancing Hero
|
|
Join Date: Feb 2001
Location: Over there
Posts: 1,163
|
|
Well, I WOULD take a look at your article if your URL was working...
Wow...looks like DOS Batch processing meets C...interesting...I'll have to look into this some more. 
__________________
"And knowing is half the battle!"
|

07-25-01, 03:35 PM
|
 |
Student-for-life
|
|
Join Date: Dec 2000
Location: College Park, Maryland
Posts: 1,294
|
|
Haha, pearl easy.....lmao. I don't know perl. But I know some students here at Maryland, who aced a course which requires you get every single character for output 100% correct in C++ (the course is known to fail well over 1/3 the class every time). While I'm straying from subject, they passed that course, and passed the course with Perl. The difference is that they hated pearl for large projects, because the syntax is deadly.
I actually prefer C versus C++ (call me crazy), and C has really terse styling and syntax. From what I've seen of Pearl, it can get REALLY nasty, really fast.
Okay, now that I've had my rant, let me conclude by saying I don't actually know perl, so i should probably be ignored 
__________________
paul@pleaseohpleasedontspamme.slcentral.com
A mathematician is a device for turning coffee into theorems -- P. Erdos
|

07-25-01, 05:40 PM
|
 |
Free agent
|
|
Join Date: Jun 2001
Location: Surrounded by frickin' idiots.
Posts: 600
|
|
Quote:
|
Well, I WOULD take a look at your article if your URL was working...
|
The URL works if you get a little creative. It should read http://www.devnut.com without the extra periods.
|

07-25-01, 07:28 PM
|
 |
Dancing Hero
|
|
Join Date: Feb 2001
Location: Over there
Posts: 1,163
|
|
Quote:
Originally posted by Rob
The URL works if you get a little creative. It should read http://www.devnut.com without the extra periods.
|
Yeah, I noticed, but I forgot to put down that I had noticed. I read his article, hence my comments about the code.  Besides, I even have him bookmarked. 
__________________
"And knowing is half the battle!"
|

07-25-01, 07:30 PM
|
 |
Dancing Hero
|
|
Join Date: Feb 2001
Location: Over there
Posts: 1,163
|
|
Quote:
Originally posted by Paul
Haha, pearl easy.....lmao. I don't know perl. But I know some students here at Maryland, who aced a course which requires you get every single character for output 100% correct in C++ (the course is known to fail well over 1/3 the class every time). While I'm straying from subject, they passed that course, and passed the course with Perl. The difference is that they hated pearl for large projects, because the syntax is deadly.
|
I'll bet it doesn't suck as much as ASM. I'll be learning that again in the fall. Trouble is, as much as I hate ASM, I really need to be paying more attention to it for some little side projects I've had up my sleeve for ages...[/B][/QUOTE]
__________________
"And knowing is half the battle!"
|

07-25-01, 07:43 PM
|
 |
Developer
|
|
Join Date: Dec 2000
Location: Port Angeles, WA
Posts: 230
|
|
Yeah.. (that's a hella simple program though.. I mean, I made use of variables + the system() functions.. hardly programming. The next article is actually somewhat more worth reading.. I promise.. (sometime this weekend it will probably see the frontpage..
Ryan
|

07-25-01, 07:45 PM
|
 |
Developer
|
|
Join Date: Dec 2000
Location: Port Angeles, WA
Posts: 230
|
|
I could definitely see what you're saying in terms of using it for large projects.. the code could get pretty ugly.. and somewhat unmanageable.. however for my uses it's perfect
Ryan
|

07-26-01, 02:18 PM
|
 |
SLCentral.com Staff
|
|
Join Date: Dec 2000
Location: New York, USA
Posts: 354
|
|
well it's not just the code that can get unmanageable, remember the language is interpreted. Large, complex perl code can really run slow. For small scripts it's definitely good, but that's pretty mcuh what it is designed to do. I don't think you'd want to develop an application in perl though, especially since anyone can just read your code and change it hehehe
Assembly is far far far worse than perl but then again it's much faster. I'm glad I'm not taking that course hehehe We did some MIPS assembly programming in my computer architectures class and i hated it.
btw, i got a little assembly question for ya... how do you swap 2 memory spaces without using any extra storage? My professor in operating systems class told us this as a side thing but my friend had it as a bonus on his Assembly class final hehehe good thing I mentioned it to him the night before... It was pretty cool too, I'm like oh yea you might want to know this little thing and it ended up saving his arse hehehe. 
__________________
SystemLogic.net - Editor
2 Pentium III 1 Ghz 2 Alpha HeatSinks with 38 CFM Delta Fan | Abit VP6 | 512 MB PC-166 | Antec SX1030B with 4 High Output 80mm Sunon Fans | 2 30 GB IBm 75 Drives in RAID 0 | Plextor PlexWriter 16/10/40A | Mitsumi 40x CD-ROM | Generic 3.5" Floppy Drive | VisionTek Geforce 2 GTS 32 MB | Sound Blaster Live! Value | 3com NIC | Diamond Supra Modem | 19" Sony Monitor | Klipsch Promedia V.2-400 Speakers | PcMods.com Sound Sensitive Blue
"No more yankie my wankie. The Donger need food!"
More people are killed annually by donkeys than die in air crashes.
|

07-26-01, 02:21 PM
|
 |
Dancing Hero
|
|
Join Date: Feb 2001
Location: Over there
Posts: 1,163
|
|
Quote:
Originally posted by Tom
btw, i got a little assembly question for ya... how do you swap 2 memory spaces without using any extra storage?
|
Umm...you mean without writing to any extra memory, or without using any registers to do it? And I'm sure whatever method of doing it probably just involves using the registers to move the data anyway. You could just move it a word at a time, holding the swap value in AX, the current position/offset of each location in BX and DX, and then use CX as a counter to go as long as you need it.
__________________
"And knowing is half the battle!"
|

07-26-01, 02:27 PM
|
 |
SLCentral.com Staff
|
|
Join Date: Dec 2000
Location: New York, USA
Posts: 354
|
|
no I mean not using any extra registers or anything... so let's just say you have data in locations AX and BX... swap them without any extra storage.... come on, this is simple 
__________________
SystemLogic.net - Editor
2 Pentium III 1 Ghz 2 Alpha HeatSinks with 38 CFM Delta Fan | Abit VP6 | 512 MB PC-166 | Antec SX1030B with 4 High Output 80mm Sunon Fans | 2 30 GB IBm 75 Drives in RAID 0 | Plextor PlexWriter 16/10/40A | Mitsumi 40x CD-ROM | Generic 3.5" Floppy Drive | VisionTek Geforce 2 GTS 32 MB | Sound Blaster Live! Value | 3com NIC | Diamond Supra Modem | 19" Sony Monitor | Klipsch Promedia V.2-400 Speakers | PcMods.com Sound Sensitive Blue
"No more yankie my wankie. The Donger need food!"
More people are killed annually by donkeys than die in air crashes.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 07:34 PM.
Hardware
Reviews, Articles, News, All Reviews...
|
Gaming
Reviews, Articles, News...
|
 |
|
|
Regular Sections
A Guru's World, CPU/Memory Watch, SLDeals...
|
 |
SLBoards
Forums, Register(Free), Todays Discussions...
|
Site Info
Search, About Us, Advertise...
|
 |
|