@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
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



Comments:

<0> wow now my script isn't giving any errors
<1> clap
<0> http://pastebin.com/622329
<2> The paste 622329 has been moved to http://erxz.com/pb/823
<3> your script gave me a rash.
<1> cyberwarrior: what THE HELL are you trying to achieve?
<0> to read from a file
<0> but it isn't orking
<0> working*
<1> http://learn.perl.org/library/beginning_perl/ read the book :)
<0> the file hi contains some words i wanna print on the screen
<1> cyberwarrior: what happens if your terminal is not a screen?
<1> :)



<1> cyberwarrior: anyway, i COULD try to explain what is wrong, but that would be utterly useless. sincerely, please explain the 'while'
<0> explain my while statement?
<4> hey guys
<1> yep
<4> do nonblocking sockets work under win32?
<5> wow, that's one amazing script
<0> while my $file equals filehandle <read>
<0> print the $file
<0> which is /home/saad/Perl/ih
<5> cyberwarrior: you do realize that's totaly NOT what you're doing right?
<0> maybe
<0> how do i fix it
<1> cyberwarrior: PLEASE read the book. you don't even know the basic perl operators. I would tell you to read perlop but the confusion would be too much
<6> hi again... can anyone give me a few keywords how this can be done in the easiest way: I have a bunch of functions, and I want these functions to be available in two seperate perl programs... I guess it has to do with modules... but maybe there's an easier way, something like php's include() which just includes and evaluates the contents of another file...
<4> guys, nonblocking I/O, win32? yes/no?
<7> intrr - please don't ask questions in terms of PHP.
<7> intrr - perldoc -f do
<2> The perldoc for do - is at http://perldoc.perl.org/functions/do.html
<5> cyberwarrior: perldoc -f readline
<2> The perldoc for readline - is at http://perldoc.perl.org/functions/readline.html
<5> that would probably help to start
<6> ayrnieu: I didn't want to hurt your feelings. thanks for the help :-)
<5> might want to go back over perldoc perlinto again too
<7> intrr - you should have a command named 'perldoc' on your system; you don't need buubot's noise unless you lack a decent CLI.
<1> cyberwarrior: you want the '***ignment' operator. which is '=' . you are using the 'eq' operator. which is used for string equality testing
<6> ayrnieu: yes, that command doesn't understand my question from above though.
<1> cyberwarrior: also, you do realise that the @read array ALREADY contains all the lines in that file, and when the while starts, the file pointer it at the end
<1> cyberwarrior: also, don't use bare words as file handles, use scalar variables . open $file_handle , $file_name
<1> and a number of other ****ups
<7> intrr - commands don't understand things; people don't understand things. ex. do() can't do anything with your 'question from above'; I have no idea what you mean by what you just said.
<7> cyber - barewords as filehandles is not the end of the world, but it's also unnecessary and problematic.
<6> ayrnieu: ok, let me explain in simple terms :)
<1> ayrnieu: so you can understand :))
<6> ayrnieu: I seeked for help with an abstract problem. I looked for a probable solution for it. perldoc -f may be smart, but it doesn't understand human language. You understood my question and referred me to a possible solution, but then you said that I should have used perldoc instead of having asked in the channel, which I didn't understand, because perldoc is not like asking for a generic solution for a generic problem :)
<6> ayrnieu: unless I understood you wrong...
<7> intrr - my suggestion is in response to buubot's hateful propensity towards referring people to the web when it sees someone suggest a perldoc in the channel.
<6> ayrnieu: oh, then never mind, I'm sorry.
<1> intrr: most likely your design is terribly flawed if you need to "include" arbitrary code
<6> ayrnieu: I interpreted your 'you should have perldoc' answer as 'why do you ask stupid questions, use perldoc' :)
<6> I'm too prejudiced...
<8> is there anyway to update in the same fashion as insert with DBIx?
<7> intrr - *nod*, I didn't mean that at all.
<8> $StarMUD::Server->{'DBHandle'}->query('INSERT INTO Accounts (name, p***word, email, points) VALUES (??)',$acctname, $p***word, $email, 0);
<6> ayrnieu: yeah. sorry again ;) I just have too much bad experience with programmer's channels ;)
<9> my server admin won't instal xml::rss because he says it takes up too much CPU
<8> $StarMUD::Server->{'DBHandle'}->query('UPDATE Accounts ( p***word, email, points) VALUES (??) WHERE name = $acctname', $p***word, $email, 0);
<8> is that possible?
<0> zamolxes, it works now http://pastebin.com/622357
<2> The paste 622357 has been moved to http://erxz.com/pb/824
<1> cyberwarrior: why do use chomp?
<1> cyberwarrior: in that particular spot?
<7> see, more buubot obnoxiousness. This presumably an idealistic instance against omgphp pastebins.
<0> to remove newline
<10> where's the newline? :)
<1> cyberwarrior: from the scalar containing the file name? i clearly see it doesn't have any newline
<1> cyberwarrior: you most likely want to remove the newline from every line you read, right? you need to chomp every line, in the while
<8> anyone?
<1> also, please don't use implicit variabiles, you'll soon become confused. while (my $text = <$file_handle> ) { chomp $text; print "$text\n"; }
<1> cyberwarrior: new users always complain about perl being "hard" but they enjoy using $_ a lot :)
<8> wow... #perl is... quiet



<0> zamolxes, :)
<8> who
<8> anyone here know DBIx?
<11> huhlig, nobody
<1> cyberwarrior: seriously, read an introductory book. The one from learn.perl.org is good, and you can download it. then come back with actual questions
<1> huhlig: DBIx owes me five bucks, bastard
<12> ayrnieu: If you don't like buubot, put it on ignore.
<1> huhlig: I don't know if we're talking about the _same_ DBIx though
<12> I, for one, can't stand pastebin.com; and therefore I welcome our pbot-formatting overlords.
<0> zamolxes, i am reading Learning Perl
<7> b0at - if you don't like me complaining about buubot, you can put me on ignore. You can, in fact, just like I can, hush about the issue, or go drive of a cliff. Of course, either of us doing any of these will have no effect on buubot's hateful participation in this channel.
<7> b0at - but thanks for reminding me in this perfectly useless manner.
<12> Huh?
<12> You were complaining. I offered a solution.
<8> zamolxes, DBIx the library
<7> You were offering 'solutions'. I offered a complaint.
<12> I found it useful for shorten, which I have little use for.
<8> zamolxes more specifically DBIx::Simple
<12> You've offered quite a few complaints.
<7> three, so far, although you should be most interested in my latest.
<12> Do I have to guess? I know: it's about cyberwarrior!
<7> You don't have to guess; you only have to remember.
<12> I'm terrible at riddles.
<1> huhlig: neah. I mostly use DBI directly. or DBIx::Cl*** for anything complex
<8> hmm
<8> foo
<8> I just need to update a row easily
<8> preferably with the same syntax as the insert
<1> huhlig: ok. $dbh->do()
<8> zamolxes is that on a DBIx object?
<1> i don't know, use DBIx::Simple if you like it, i just told you what I use
<8> ahh
<1> huhlig: no, DBI
<1> huhlig: perldoc DBI
<8> Im already using DBIx at someones suggestion
<8> I dont want to suddenly convert everything again
<1> huhlig: you're making a confusion
<1> huhlig: DBIx:: is a namespace for DBI extensions
<1> huhlig: DBIx:: isn't something you *use* . you use a DBI extension (in your case, DBIx::Simple)
<8> ahh
<12> use flubber; { no flubber; foo(); }
<1> huhlig: DBIx::Simple is apparently a clean way to handle your DBI stuff, go ahead and use it
<1> huhlig: what is your *actual* question though?
<8> really all I need is an update or insert
<8> update if exist, else insert
<8> something that I would think would be rather standard
<8> $StarMUD::Server->{'DBHandle'}->query('UPDATE OR INSERT Accounts (p***word, email, points) VALUES (??) WHERE name = $acctname', $p***word, $email, 0);
<8> or whatever the equivelent would be
<13> huhlig: mysql has replace into
<8> failing that just the update would work
<8> botje sqlite
<14> sqlite++
<15> pgsql++
<16> SQLite++
<8> mrrr
<1> is this rdbms envy?
<8> I take it people like sqlite
<1> http://www.sqlite.org/lang_replace.html
<8> im already there
<8> how do you add the where though
<8> so it compares to the right row
<1> oh nevermind
<8> because the unique factor is the name
<8> accountname in this case
<17> huhlig: skip ahead to the documentation on ON CONFLICT, which is the underlying method behind all of that
<8> ahh
<17> huhlig: says that the behavior of ON CONFLICT REPLACE is to remove any rows that have their UNIQUE constraints violated by your insert :)
<8> yes but how do you make a field unique in sqlite
<17> same way you do everywhere else, I believe
<8> there only seems to be the option for unique interger primary key
<1> huhlig: what you need to do is go ahead and ask yourself: "is this the right channel to ask these questions?"
<17> huhlig: that's not one thing, that's three.


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #perl
or
Go to some related logs:

ati ixp ac97 controller failed with error -13
#kde
xmms-timidity
iscompany database
#debian
gentoo not syncing: VFS: unable to mount root fs mythtv
SUSE linux resize impossible
#perl
alsa-headers distfiles
+fc5 +format +gnome-mount



Home  |  disclaimer  |  contact  |  submit quotes