Clan x86

Technical (Development, Security, etc.) => General Programming => Topic started by: warz on June 10, 2008, 01:54:16 pm

Title: perl...
Post by: warz on June 10, 2008, 01:54:16 pm
so, i'm having to learn perl while at work, right now. good fun.
Title: Re: perl...
Post by: iago 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? :)
Title: Re: perl...
Post by: rabbit on June 10, 2008, 10:21:29 pm
Perl is fun, although I'm having some issues with mutlidimensional arrays :\
Title: Re: perl...
Post by: Ender 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.
Title: Re: perl...
Post by: abc 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?
Title: Re: perl...
Post by: iago 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.
Title: Re: perl...
Post by: abc 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!
Title: Re: perl...
Post by: warz 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.
Title: Re: perl...
Post by: iago 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.
Title: Re: perl...
Post by: Newby on June 11, 2008, 09:14:25 pm
Perl is slick. :)
Title: Re: perl...
Post by: Camel on June 12, 2008, 05:45:15 pm
it does feel 100% hackish 100% of the time.

Fixed.
Title: Re: perl...
Post by: Sidoh 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."
Title: Re: perl...
Post by: Camel 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.
Title: Re: perl...
Post by: warz 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.
Title: Re: perl...
Post by: Camel 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.
Title: Re: perl...
Post by: iago 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.
Title: Re: perl...
Post by: warz 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
Title: Re: perl...
Post by: iago 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.
Title: Re: perl...
Post by: warz 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.
Title: Re: perl...
Post by: Sidoh 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.
Title: Re: perl...
Post by: zorm 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.
Title: Re: perl...
Post by: warz 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
/me head spins
Title: Re: perl...
Post by: zorm 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...
Title: Re: perl...
Post by: warz 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.
Title: Re: perl...
Post by: Camel on June 18, 2008, 05:18:47 am
It would be a lot less ugly as a try/catch block.