| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Comments:
<0> perlmonkey: I think the main point is that you can call a subroutine at a point, you could create a separate chunk of code with the {} but without a label you won't be able to refer it later.. <1> this is the leap I've been needing then, subroutines are the way forward now <2> perlmonkey: welcome to procedural programming. soon you will encounter people who tell you about object-oriented programming ;-) <0> perlmonkey: but I'm pretty new to perl, it's just a common knowledge due to other languages <1> why do many programs use the defined/label like someSubroutine { } <1> is it necessary to use lowercase letters for the start of the name? <3> waiting: and functional programming <4> perlbot, it makes it easier to have a standard. <2> and extreme programming ;) <2> and intuitionistic programming <3> perlmonkey: no. that's up to you. <1> :) <4> it sometimes helps with readability though. <0> how do I print an array lenght ? <4> don't name your subs a b c and d. <5> perlmonkey: It is not needed, and many consider fooBar bad Perl style, and prefer foo_bar instead.
<1> i see <4> suppaman, print scalar(@array); <0> Pete_I: thanks <1> I have a perl book called Perl 5 by Example <5> perlmonkey: In Perl, it's common to have UPPER_CASE constants, CamelCase packages, and lower_case for everything else. <1> seems reasonable <5> In older Perl code, you may see global filehandles without sigil, and they were also written UPPER_CASE. <5> But modern Perl code has lexical filehandles with $ sigil, and they're typically lower_case. <1> thats interesting <6> modern perl is all about lowercase? <5> unbalancedCamelCase is a sign you're looking at a Java coder :) <3> Juerd: that works since what version? <5> sphex: 5.6 <3> ok <5> sphex: open my $fh, '<', $fn <7> zamolxes: i usually use HTML::Parser. works with bad code too, but you might've found code that's worse than the code i came across <3> Juerd: yeah. I guess most hosts have 5.8 by now. <5> sphex: The professional world doesn't work with "hosts", but with their own machines. <6> jink: thanks. i'm trying to categorize some websites, and i'm thinking I should ***ign different priorities on specific tags / atributes <5> People who make money with Perl are generally limited by company policies, not hosting providers. <7> for tag counting, HTML::Parser works well <0> Petebye <0> lol <3> Juerd: yeah, PHP took the rest. :p <0> just "bye" <5> sphex: That's a good thing. <5> Hehe <8> mmmm, PHP. <1> perl is infinitely superior <5> sphex: With all the PHP-minded people gone, you have no idea how much that improved the level of competence among people who ask questions on IRC. <1> i used php initially <9> hi <5> And PHP is, of course, a nice introduction to ugly code, after which Perl is acceptable practice. <10> hello. is it possible given a filename to read all lines from the file into an array using a single line of perl? <1> :-) <5> Few people start with Ruby and then go to Perl. Perl's too ugly for them to handle. <5> datrus: Yes. Do you have to pay for each line, or...? <9> if($ret=$self->foo) { return $ret } # if foo() return Apache::Const::OK, why isn't it evaluated true? <5> datrus: Perl itself doesn't care if you write something in one line, or fifteen. <10> Juerd: i mean one statement <1> I want to start work on a perl program to analyse commodities <5> janhaa: Are you sure it returned that? <3> Juerd: but some of us still have to do web monkey work. I kinda miss having Perl as the standard for that. :/ <9> Juerd, 99.99% ... <9> Juerd, i can't see what else it could return... <5> datrus: http://tnx.nl/File::Slurp <5> janhaa: Do you have warnings enabled? <9> Juerd, warnings and strict (always :)) <11> perlmonkey: it's not the best language for that ;) <1> why <11> depending on what you want to do exactly, i guess. <9> Juerd, ! it seems like Apache2::Const::OK is 0 ... <9> sorry. <9> i thought it was 200 :/ <9> Error message: P***word must be longer than four characters # is this a good error message? :/ <12> hi - i have some troubles with Net::Daemon::SSL - after client connects, it sigsegv - my $daemon = new SyncDaemon ({'proto' => 'tcp', 'localport' => 5439, 'Listen' => 1, 'pidfile' => 'none', SSL_use_cert => 1, SSL_verify_mode => 0, SSL_key_file => 'sync.key', SSL_cert_file => 'sync.crt' }, \@ARGV); <12> any ideas ? <1> the markets are heading for financial meltdown <3> oh noes! LET'S RAID THE TOYS'R'US'S while it's still time! <1> hehe <1> Vodafone is going to colapse
<1> the US dollar is losing its place in the world <1> times r a changing <13> The U.S. is losing its place in the world and doing what every empire does when it nears its collapse <1> what is the empire doing? <1> war? <1> conquest of new terrorities <3> that kinda ****s. I get payments from the states... and now it's almost worth the same in CAD. it used to be 1.6. now it's 1.07 DAMMIT, can't you do better than that FFS? <13> Making an *** of itself, war being one manifestation thereof <1> theres a time of change and economic shifting taking place <1> we live in uncertain times <3> avar: and don't forget women gaining more power. that's a good sign of an empire's fall. <1> US consumer confidence is very low <1> yes <3> avar: it happened in Rome, too. <1> Al Gore is on a mission <4> maybe it'll be different this time <1> the US will either emerge stronger and more independent, or will continue to decline <3> alright. OK. that's clear now. <1> Al Gore, the president who never was <9> i'm writing an external config-file to my mod_perl application - would it be a better idea to embed the config inside the apache config ? <14> depends on the role <5> Woooh <5> I already browsed through it a little, and hate that I have work to do first :) <9> Supaplex, my module can't run without the config... <1> Juerd: a book? <14> the config can be anywhere, as long as it knows where and how to get it. <14> it's really up to you. <9> Supaplex :) <1> my lungs are filling up with some kind of goo <5> perlmonkey: Yes <5> perlmonkey: In the O'Reilly Hacks Series. <1> cool <1> too much dust or something, maybe I should clean a little <1> cleaning just takes up valuable programming time tho <1> woohoo <1> sheesh I'm stuck <15> foreach my $key (sort {$a <=> $b} values %h) -- how can I get hash key? <16> lol <5> ml666: Your code is wrong <9> help keys ? :) <1> I need to do 3 db queries, I want to use one call for each query to one subroutine for the database query code which dynamically changes for each call <5> Well, not technically, but you are stuffing a *value* in a variable called *$key*. Something tells me that's not supposed to happen :) <5> ml666: Do you want to get the keys, but sorted by their values? <17> ml666, you want keys %h, and compare the values in the hash in the comparison block. <15> I want get key from hash "sorted" by value <1> how to make each request to the subroutine? <16> ml666: for my $key (sort {$h{$a} <=> $h{$b}} keys %h){} <5> ml666: sort { $h{$a} <=> $h{$b} } keys %h <16> I win <16> :P <5> dec: My code is better formatted. <11> perlmonkey: p*** it a string? <5> In Perl 6 it'd just be: %h.sort:{.key} <16> Juerd - because you have more spaces? some would differ. <1> jpeg: how do you p*** it tho? <11> foo($scalar) <5> Eh, no <5> In Perl 6 it'd just be: %h.sort:{.value} <1> phew <5> And they you get a list of pairs <1> jpeg: how does it link to the subroutine tho? <5> If you badly need only the keys, %h.sort:{.value}>>.key or map { .key }, %h.sort:{.value} <5> But to want that makes little sense. <11> perlmonkey: uh... 'link'? <17> %h.keys.sort:{ %h<$_> } <5> wolverian: No <5> wolverian: That's %h{'$_'} <1> jpeg: how do you push/send the string to the subroutine where the db query code resides <17> agh, yeah. <5> wolverian: Don't over-use <>.
Return to
#perl or Go to some related
logs:
gentoo gnome-powermanager xorg 7.0 and xdefaults php herdoc modem driver keygen linuxant ubuntu udevdb presence implies active udev gaim auto hide wp: alt-f2 firefox decompress pg_dump #centos #python
|
|