Author Topic: perl...  (Read 7842 times)

0 Members and 2 Guests are viewing this topic.

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
perl...
« on: June 10, 2008, 01:54:16 pm »
so, i'm having to learn perl while at work, right now. good fun.
http://www.chyea.org/ - web based markup debugger

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: perl...
« Reply #1 on: June 10, 2008, 02:10:47 pm »
Nice, I like perl, even if it does feel somewhat hackish in some places. But it's far less hackish than C#, so what can I say? :)

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: perl...
« Reply #2 on: June 10, 2008, 10:21:29 pm »
Perl is fun, although I'm having some issues with mutlidimensional arrays :\

Offline Ender

  • x86
  • Hero Member
  • *****
  • Posts: 2390
    • View Profile
Re: perl...
« Reply #3 on: June 11, 2008, 04:56:33 am »
If you're interested, you can make a perl AIM bot in practically three lines of code using Net::Oscar from CPAN. It's a nice project for learning the language.

Offline abc

  • Hero Member
  • *****
  • Posts: 576
    • View Profile
Re: perl...
« Reply #4 on: June 11, 2008, 03:30:21 pm »
I don't want to start a flame war, or giant discussion, but Perl vs PHP? Pros, Cons?

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: perl...
« Reply #5 on: June 11, 2008, 03:36:56 pm »
I find Perl better for processing text, and for writing quick and dirty scripts. It has a lot of modules built, distributed by CPAN, which are generally quite powerful.

I find PHP better small-to-medium-sized Web sites. It tends to be cleaner, but could also take awhile to write. It also has modules, via PEAR, but I've never used those.

Offline abc

  • Hero Member
  • *****
  • Posts: 576
    • View Profile
Re: perl...
« Reply #6 on: June 11, 2008, 03:42:45 pm »
I find Perl better for processing text, and for writing quick and dirty scripts. It has a lot of modules built, distributed by CPAN, which are generally quite powerful.

I find PHP better small-to-medium-sized Web sites. It tends to be cleaner, but could also take awhile to write. It also has modules, via PEAR, but I've never used those.


Thanks!

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: perl...
« Reply #7 on: June 11, 2008, 05:09:01 pm »
if you're asking in regards to web apps, i've never initially thought of perl when choosing a language. although, i don't see why not - it's similar to python, which is what i use.
http://www.chyea.org/ - web based markup debugger

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: perl...
« Reply #8 on: June 11, 2008, 05:40:28 pm »
Perl isn't really designed for doing Web apps, but Web app stuff is available as libraries. I'd stick with PHP, since that's its purpose in life.

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: perl...
« Reply #9 on: June 11, 2008, 09:14:25 pm »
Perl is slick. :)
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: perl...
« Reply #10 on: June 12, 2008, 05:45:15 pm »
it does feel 100% hackish 100% of the time.

Fixed.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: perl...
« Reply #11 on: June 12, 2008, 06:36:44 pm »
it does feel 100% hackish 100% of the time.

Fixed.

Lol.  Whenever I do a project in perl, I always find myself saying "Fucking perl... I hate it."

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: perl...
« Reply #12 on: June 12, 2008, 11:33:23 pm »
I've always thought that it was strange that, since it's among the most efficient of interpreted languages, it should have had time to mature in to a language that isn't cryptic.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: perl...
« Reply #13 on: June 13, 2008, 12:50:58 am »
I've always thought that it was strange that, since it's among the most efficient of interpreted languages, it should have had time to mature in to a language that isn't cryptic.

haha, yea, if you use the features perl provides, it makes the code almost unreadable.
http://www.chyea.org/ - web based markup debugger

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: perl...
« Reply #14 on: June 13, 2008, 01:23:45 am »
What an understatement! If you're not an experienced, you can't be decipher even the simplest perl commands.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: perl...
« Reply #15 on: June 13, 2008, 12:44:45 pm »
That's not true at all. My Perl code doesn't look significantly different from my C or PHP code.

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: perl...
« Reply #16 on: June 13, 2008, 12:59:38 pm »
Either you're not making use of all the nifty Perl features, or you're just used to reading Perl. :P
http://www.chyea.org/ - web based markup debugger

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: perl...
« Reply #17 on: June 13, 2008, 02:04:55 pm »
Of course I'm not making use of the "nifty" features, they tend to make the code ugly/unreadable. I program it in the cleanest way I can.

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: perl...
« Reply #18 on: June 13, 2008, 03:12:25 pm »
Of course I'm not making use of the "nifty" features, they tend to make the code ugly/unreadable. I program it in the cleanest way I can.

Ugly and unreadable to the untrained eye! They can speed things up if everyone knows what they means. But, there's always the English module if you don't like the whacky unreadable variable names.
http://www.chyea.org/ - web based markup debugger

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: perl...
« Reply #19 on: June 13, 2008, 04:12:15 pm »
Even if everyone is familiar with the shortcuts, there's still a fair amount of extra tracing overhead involved when it's used excessively.

Offline zorm

  • Hero Member
  • *****
  • Posts: 591
    • View Profile
    • Zorm's Page
Re: perl...
« Reply #20 on: June 14, 2008, 02:40:28 pm »
Of course I'm not making use of the "nifty" features, they tend to make the code ugly/unreadable. I program it in the cleanest way I can.


I do much the same, since it makes life easy when someone else wants to glance at my code and see what I did. English readable code for the win.
"Frustra fit per plura quod potest fieri per pauciora"
- William of Ockham

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: perl...
« Reply #21 on: June 16, 2008, 03:23:51 pm »
wtf...

Code: [Select]
    sub wanted {
        /^\.nfs.*\z/s &&
        (($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_)) &&
        int(-M _) > 7 &&
        unlink($_)
        ||
        ($nlink || (($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_))) &&
        $dev < 0 &&
        ($File::Find::prune = 1);
    }

=X
* warz head spins
http://www.chyea.org/ - web based markup debugger

Offline zorm

  • Hero Member
  • *****
  • Posts: 591
    • View Profile
    • Zorm's Page
Re: perl...
« Reply #22 on: June 17, 2008, 11:27:37 pm »
Thats a pretty good example of why writing *readable* code is a good thing, no matter what language you are using...
"Frustra fit per plura quod potest fieri per pauciora"
- William of Ockham

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: perl...
« Reply #23 on: June 18, 2008, 02:51:57 am »
hehe yeah, it's just the new lines that make that tough to read. it's essentially just a return statement.
« Last Edit: June 18, 2008, 12:59:31 pm by warz »
http://www.chyea.org/ - web based markup debugger

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: perl...
« Reply #24 on: June 18, 2008, 05:18:47 am »
It would be a lot less ugly as a try/catch block.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!