| wongon | To get the last index of an array @a, it's $#a. If I've got a scalar, $ar, that is a reference to an array @a, how do I get the last index through $ar? What is the syntax? |
| icke | rule 2 |
| Action: GumbyPAN CPAN Upload: UMLS-Interface-0.31 by BTMCINNES |
| Action: GumbyPAN CPAN Upload: App-ClusterSSH-4.00_01 by DUNCS |
| icke | $#$ar |
| wongon | thanks |
| icke | $ar->[-1] if you just want the last element |
| icke | learn the ref ropes |
| Khisanth | ScHAmPi: for firefox you would need to install the activex plugin at the very least |
| ScHAmPi | Khisanth I see |
| ScHAmPi | well I'm not gonna bother, it makes no sense, and I can only study this perl stuff tonight |
| ScHAmPi | tomorrow I gotta start studying my theoretic part |
| ScHAmPi | it's gonna be a hell of a three days |
| Sp0oKeR | Khisanth, icke Net::DNS will work for me ... thanks a lot...just need to study that module =) |
| Action: GumbyPAN CPAN Upload: Log-Syslog-DangaSocket-1.04 by ATHOMASON |
| Action: GumbyPAN CPAN Upload: Form-Sensible-0.10000 by JAYK |
| spectre^ | I'm invoking a perl script from another perl script via system(), and, in the invoked script I'm using exit 1; to return a 1 to the invoking script, but I keep getting a 255 in $? >> 8, when I expect a 1 |
| spectre^ | I think I'm doing something wrong |
| spectre^ | What can I do to get the exit status to return a 1? |
| PerlJam | spectre^: perldoc -f system # it tells you in the docs |
| PerlJam | oh. /me should have read up a few lines. |
| PerlJam | spectre^: show your code somewhere. |
| spectre^ | I think that exit must return 255 to the shell on error, as indicated by 1 |
| spectre^ | I guess? |
| icke | looks like it was killed |
| spectre^ | http://pastebin.com/m1e803053 |
| buubot | spectre^: The 19 line paste m1e803053 has been copied to http://erxz.com/pb/22638 . |
| spectre^ | Nice bot |
| spectre^ | I think that's enough to show you what I'm doing |
| spectre^ | printf("NOTICE gsum returned: %d\n", $?>>8); always shows the value as 255 |
| icke | does it even execute? check $? for -1 before |
| spectre^ | While I can certainly work with that if it's behaving as intended |
| Action: GumbyPAN CPAN Upload: Log-Syslog-Fast-0.26 by ATHOMASON |
| Action: GumbyPAN CPAN Upload: Text-vCard-2.05 by LLAP |
| spectre^ | Yeah |
| spectre^ | I get the error |
| icke | what error? |
| spectre^ | The printed error from the calleee |
| spectre^ | I didnt bother checking for -1 because I saw the error |
| spectre^ | Make sense? |
| DrForr | spectre^: $? may have been set before your operation ran. |
| icke | hmm? it isn't $! |
| PerlJam | spectre^: you need to check for -1 to see if it failed to execute, and check $? & 127 to see if it died, and if neither of those things are true, then you can use $?>>8 to find the exit value. |
| spectre^ | As I was saying ... I can work with the return being 255 if that's what's supposed to be happening, but I dont understand why and I dont want to proceed until I do |
| spectre^ | print ("Invalid begin date specified: " . $options{'b'}); |
| icke | it's supposed to always contain the exit value (as described) |
| spectre^ | I see that printed |
| spectre^ | er |
| go|dfish | eval [ 1 - 1.2, 15 - 15.2 ] |
| spectre^ | $? reports the exit status from the last system() command |
| spectre^ | http://perldoc.perl.org/perlvar.html#$CHILD_ERROR |
| buubot | go|dfish: ["-0.2","-0.199999999999999"] |
| spectre^ | PerlJam: I'll check |
| go|dfish | why does that return 2 different results ^^ ? |
| PerlJam | go|dfish: floating point representation error. |
| DrForr | go|dfish: Because 1/5 can't be exactly represented in binary. In the first case you just get lucky. |
|
|
| PerlJam | go|dfish: either use fixed point (if you can) or always be sure to specify the precision of your floating point numbers on output |
| PerlJam | go|dfish: (unless you want more precision than the floating point error, you'll be fine) |
| spectre^ | http://pastebin.com/m27595d |
| buubot | spectre^: The 25 line paste m27595d has been copied to http://erxz.com/pb/22640 . |
| spectre^ | Still getting a 255 |
| go|dfish | PerlJam: ah |
| spectre^ | With those checks in |
| go|dfish | DrForr, PerlJam, thanks! |
| spectre^ | And neither of the if statements were true |
| PerlJam | spectre^: you always see "NOTICE gcum returned 255" just before it dies? |
| PerlJam | er, s/gcum/gsum/ even |
| PerlJam | (*NOT* a freudian slip :) |
| spectre^ | Yes, sir |
| spectre^ | I do |
| spectre^ | WAIT |
| LeoNerd | A freudian slip is when you say one thing but mean your mother |
| spectre^ | Let me make sure tehre's not an END defined |
| spectre^ | In the callee |
| spectre^ | That changes my exit status |
| spectre^ | Nope |
| spectre^ | That's not it |
| PerlJam | spectre^: have you tried changing "exit(1)" to "exit(42)" or something? |
| spectre^ | I'll try it |
| icke | spectre^: take the literal code from perldoc -f system to interpret $?. works for me |
| spectre^ | I see what's wrong |
| PerlJam | It's that exit(255) that you forgot about? |
| PerlJam | :) |
| spectre^ | Someone else is working on the callee and installed their version of it to /usr/local |
| spectre^ | Fucker |
| spectre^ | His version uses die() |
| spectre^ | No |
| spectre^ | :) |
| spectre^ | die() returns 255 |
| spectre^ | And his version uses die() |
| spectre^ | When I changed it to exit(69) and there was no effect I knew something was wrong :P |
| spectre^ | Awesome thanks for the help |
| spectre^ | Now I need help beating that guy down |
| Action: GumbyPAN CPAN Upload: Devel-PartialDump-0.13 by FLORA |
| Action: GumbyPAN CPAN Upload: Parse-Method-Signatures-1.003013 by FLORA |
| Action: GumbyPAN CPAN Upload: BerkeleyDB-0.41 by PMQS |
| Mantususus | hiiiiiiiii |
| pwrcycle | mst: i remember now, using "ssh -l user example.com" hides the user@ from "ps aux". that was the advantage. |
| Khisanth | doesn't look terribly useful at least on linux ... |
| cmihai | cmihai 434268 504020 0 01:56:30 pts/4 0:00 ssh -l cmihai localhost |
| chee | :) |
| shadowpaste0 | "paull" at 119.10.140.36 pasted "Help! Why this snippet is not working, @_ is a count of traffic in octets passed in. It's bitching about $custtraffic not being defined and returns 0" (20 lines) at http://scsys.co.uk:8002/37956 |
| paull | Thanks in advance for any help with my above paste |
| DrForr | paull: Maybe you're not aware that @_ is a list, not a variable. |
| paull | I'm only squirting in one value... Would I use $_ instead then? |
| Khisanth | Number::Bytes::Human |
| Khisanth | @_ < 1000000000 compares the number of args passed in |
| Khisanth | if you passed in only one value then @_ == 1 |
| DrForr | sub FormatTraffic { my $count = shift; ... } |
| paull | Ahhh OK |
| paull | I'll give that a go.. Thanks so much! |
| paull | DrForr: happy to help further? Still returns 0! |
| DrForr | Well, kind of hard to tell what's going on without seeing sample input. |
| DrForr | And the rewritten version. |
| paull | OK |
| paull | I'll plug away at it |
| paull | Cheers! |
| awnstudio | anyone figure out a way to filter rss feed by language? |
| awnstudio | ^^github |
| f00li5h[HireMe] | well, how do you know which language the posts are in, awnstudio |
| awnstudio | uh? |
| Khisanth | ask google to guess :) |
| awnstudio | me and google arent speaking atm |
| f00li5h[HireMe] | awnstudio: I mean, are there attributes for the languages |
| awnstudio | in the regular search yes, try using those params with the feed link, no dice :( |
| f00li5h[HireMe] | paw at it! |
| Action: GumbyPAN CPAN Upload: Test-BinaryData-0.009 by RJBS |
| Action: GumbyPAN CPAN Upload: JavaScript-V8x-TestMoreish-0.010 by RKRIMEN |
| awnstudio | Perl, Python and Ruby comparison apps with similar functionality. Why? Because I can - http://github.com/zoozed/comparisons |
| kawinija | guys, what is the differences between %yo = (yo => 'yo') and %yo = ('yo' => 'yo) |
| kawinija | what are |
| f00li5h[HireMe] | => quotes the thing to the left of it... and is a comma. |
| f00li5h[HireMe] | it is different when the thing to the left is not a "bareword" |
| pkrumins | tehe |
| pkrumins | this kit knows the difference |
| Action: f00li5h[HireMe] paws at pkrumins |
| awnstudio | this is just a fucking disgrace, http://www.cpantesters.org/distro/W/WWW-Mechanize-Pluggable.html#WWW-Mechanize-Pluggable-1.05 |
| shorten | awnstudio's url is at http://xrl.us/bgscci |
| kawinija | guys, what are the differences between %yo = (yo => 'yo') and %yo = ('yo' => 'yo) |
| kawinija | guys, what are the differences between %yo = (yo => 'yo') and %yo = ('yo' => 'yo') |
| kawinija | sorry |
| icke | already answered |
| icke | no difference |
| ew73 | Two ' characters. |
| kawinija | ok |
| kawinija | thanks |
| SpiceMan | kawinija: perldoc -q "semicolons and commas" |
| dumbtroll | cause i took no exam but i still want to |
| dumbtroll | but i don't know to where i can find it |
| dumbtroll | help please |
| dumbtroll | > |
| dumbtroll | ? |
| dumbtroll | you know? |
| Khisanth | go troll somewhere else |
| dumbtroll | yeah he said that the other one i was there |
| dumbtroll | but i still felt to so i came here |
| dumbtroll | yo |
| dumbtroll | i saw another one was like more dynamic |
| dumbtroll | but no stupid syntax |
| dumbtroll | you know? |
| Action: GumbyPAN CPAN Upload: Log-Syslog-Fast-0.27 by ATHOMASON |
| atomiku | surprisingly enough, its dead in here |
| pkrumins | no it's not. yes it is. no it's not. yes it is. |
| go|dfish | Perl is dead after all. |
| f00li5h[HireMe] | paw paw paw |
| pkrumins | f00li5h[HireMe], kit kit |
| pkrumins | what are you doing? |
| f00li5h[HireMe] | going to roleplaing |
| f00li5h[HireMe] | and getting clawed at va SMS |
| pkrumins | SMS is so web 1.0 |
| Action: GumbyPAN CPAN Upload: Log-Syslog-DangaSocket-1.05 by ATHOMASON |
| Khisanth | hmm |
| Khisanth | gather-take would be convenient right now ... |
| mst | Khisanth: Language::Keyword::Gather |
| Khisanth | I think you mean Syntax::Keyword::Gather |
| mst | yes |
| bennymack | anyone have experience embedding functions into SQLite? I have a list of zip codes in a csv file and I'd like to be able to get a list of other zipcodes in a N mile radius with one round-trip.. |
| Khisanth | this is probably a very silly use of it :) |
| bennymack | I'm having a look at SQLite::VirtualTable now. Looks promising |
| bennymack | there's something like over 500 results for SQLite on CPAN thouhg |
| Khisanth | my $my_nick = '...'; my $me; @users = gather { for(@users) { if($_->{nick} eq $my_nick) { $me = $_ } else { take $_ } } |
| Khisanth | bennymack: do you need a virtual table or do you need a function? because DBD::SQLite has a sqlite_create_function method |
| bennymack | Khisanth: well, I thought the sqlite_create_function stuff happened on the DBI side of things? |
| waltman | bennymack: I've given a talk at a few yapcs on writing sqlite functions :) |
| bennymack | i've been to those talks ;) |
| waltman | yay! |
| waltman | my impression is that there's not really a "round trip", since you're making library calls |
| waltman | I think you can only return a scalar from a function, so I'm not sure how you could return a list. Maybe as a comma-separated string? |
| bennymack | well, I need to fetch the zip in question, calculate a x and y min and max and select zips that fall within that range. |
| bennymack | I have code to do all that. but i'd prefer to just be able to send the zip and distance and get back a list of zip codes. |
| icke | that's an n-mile square, not radius |
| bennymack | icke: yes, thanks ;0 |
| waltman | I don't see any way to have an sqlite function return more than one column, let alone multiple rows |
| waltman | I think the best you could do is return a string like "90210,90211,31459" and then have the caller split it |
| Thuryn | what? |
| Thuryn | waltman, are you new/ |
| Thuryn | return() *always* returns a list |
| Thuryn | return('foo', 'bar', 'baz'); |
| Thuryn | returning a single value is just a special case |
| awnstudio | un huh |
Popular searches: