SLCentral - Your logical choice for computing and technology
Latest Deals   
Navigation
  • Home
  • Search
  • Forums
  • Hardware
  • Games
  • Tech News
  • Deals
  • Prices
  • A Guru's World
  • CPU/Memory Watch
  • Site Info
  • SL Newsletter
    Recieve bi-weekly updates on news, new articles, and more


    Forum home My SLBoards (Control Panel)View the calendar View the members list Read the FAQ Search the forums

    Go Back   SLCentral Forum > Technology > Software / Operating Systems
    User Name
    Password


    Reply
     
    Thread Tools Search this Thread Display Modes
      #1  
    Old 07-25-01, 11:31 AM
    Devnut's Avatar
    Devnut Devnut is offline
    Developer
     
    Join Date: Dec 2000
    Location: Port Angeles, WA
    Posts: 230
    Devnut is off the scale
    Send a message via ICQ to Devnut
    Default 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
    Reply With Quote
      #2  
    Old 07-25-01, 11:41 AM
    Tom's Avatar
    Tom Tom is offline
    SLCentral.com Staff
     
    Join Date: Dec 2000
    Location: New York, USA
    Posts: 354
    Tom is off the scale
    Send a message via ICQ to Tom Send a message via AIM to Tom Send a message via Yahoo to Tom
    Default

    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.
    Reply With Quote
      #3  
    Old 07-25-01, 11:47 AM
    Devnut's Avatar
    Devnut Devnut is offline
    Developer
     
    Join Date: Dec 2000
    Location: Port Angeles, WA
    Posts: 230
    Devnut is off the scale
    Send a message via ICQ to Devnut
    Default

    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
    Reply With Quote
      #4  
    Old 07-25-01, 01:34 PM
    Cutriss's Avatar
    Cutriss Cutriss is offline
    Dancing Hero
     
    Join Date: Feb 2001
    Location: Over there
    Posts: 1,163
    Cutriss is off the scale
    Default

    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!"
    Reply With Quote
      #5  
    Old 07-25-01, 01:41 PM
    Devnut's Avatar
    Devnut Devnut is offline
    Developer
     
    Join Date: Dec 2000
    Location: Port Angeles, WA
    Posts: 230
    Devnut is off the scale
    Send a message via ICQ to Devnut
    Default

    Take a look at the link above .. the code is extremely straightforward and simple..

    Ryan
    Reply With Quote
      #6  
    Old 07-25-01, 01:47 PM
    Cutriss's Avatar
    Cutriss Cutriss is offline
    Dancing Hero
     
    Join Date: Feb 2001
    Location: Over there
    Posts: 1,163
    Cutriss is off the scale
    Default

    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!"
    Reply With Quote
      #7  
    Old 07-25-01, 02:35 PM
    Paul's Avatar
    Paul Paul is offline
    Student-for-life
     
    Join Date: Dec 2000
    Location: College Park, Maryland
    Posts: 1,294
    Paul is off the scale
    Send a message via ICQ to Paul Send a message via AIM to Paul
    Default

    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
    Reply With Quote
      #8  
    Old 07-25-01, 04:40 PM
    Rob's Avatar
    Rob Rob is offline
    Free agent
     
    Join Date: Jun 2001
    Location: Surrounded by frickin' idiots.
    Posts: 600
    Rob is off the scale
    Send a message via AIM to Rob Send a message via Yahoo to Rob
    Default

    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.
    Reply With Quote
      #9  
    Old 07-25-01, 06:28 PM
    Cutriss's Avatar
    Cutriss Cutriss is offline
    Dancing Hero
     
    Join Date: Feb 2001
    Location: Over there
    Posts: 1,163
    Cutriss is off the scale
    Default

    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!"
    Reply With Quote
      #10  
    Old 07-25-01, 06:30 PM
    Cutriss's Avatar
    Cutriss Cutriss is offline
    Dancing Hero
     
    Join Date: Feb 2001
    Location: Over there
    Posts: 1,163
    Cutriss is off the scale
    Default

    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!"
    Reply With Quote
      #11  
    Old 07-25-01, 06:43 PM
    Devnut's Avatar
    Devnut Devnut is offline
    Developer
     
    Join Date: Dec 2000
    Location: Port Angeles, WA
    Posts: 230
    Devnut is off the scale
    Send a message via ICQ to Devnut
    Default

    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
    Reply With Quote
      #12  
    Old 07-25-01, 06:45 PM
    Devnut's Avatar
    Devnut Devnut is offline
    Developer
     
    Join Date: Dec 2000
    Location: Port Angeles, WA
    Posts: 230
    Devnut is off the scale
    Send a message via ICQ to Devnut
    Default

    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
    Reply With Quote
      #13  
    Old 07-26-01, 01:18 PM
    Tom's Avatar
    Tom Tom is offline
    SLCentral.com Staff
     
    Join Date: Dec 2000
    Location: New York, USA
    Posts: 354
    Tom is off the scale
    Send a message via ICQ to Tom Send a message via AIM to Tom Send a message via Yahoo to Tom
    Default

    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.
    Reply With Quote
      #14  
    Old 07-26-01, 01:21 PM
    Cutriss's Avatar
    Cutriss Cutriss is offline
    Dancing Hero
     
    Join Date: Feb 2001
    Location: Over there
    Posts: 1,163
    Cutriss is off the scale
    Default

    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!"
    Reply With Quote
      #15  
    Old 07-26-01, 01:27 PM
    Tom's Avatar
    Tom Tom is offline
    SLCentral.com Staff
     
    Join Date: Dec 2000
    Location: New York, USA
    Posts: 354
    Tom is off the scale
    Send a message via ICQ to Tom Send a message via AIM to Tom Send a message via Yahoo to Tom
    Default

    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.
    Reply With Quote
    Reply


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    vB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump



    All times are GMT -8. The time now is 09:22 PM.

    Archive - Search Engine Friendly URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc. Top
    Browse the various sections of the site
    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...
    Search Engine Friendly URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc. Legal | Advertising | Site Info