free blog   apache   shopping directory   php powered
wongonTo 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?
ickerule 2
Action: GumbyPAN CPAN Upload: UMLS-Interface-0.31 by BTMCINNES
Action: GumbyPAN CPAN Upload: App-ClusterSSH-4.00_01 by DUNCS
icke$#$ar
wongonthanks
icke$ar->[-1] if you just want the last element
ickelearn the ref ropes
KhisanthScHAmPi: for firefox you would need to install the activex plugin at the very least
ScHAmPiKhisanth I see
ScHAmPiwell I'm not gonna bother, it makes no sense, and I can only study this perl stuff tonight
ScHAmPitomorrow I gotta start studying my theoretic part
ScHAmPiit's gonna be a hell of a three days
Sp0oKeRKhisanth, 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?
PerlJamspectre^: perldoc -f system  # it tells you in the docs
PerlJamoh.  /me should have read up a few lines.
PerlJamspectre^: show your code somewhere.
spectre^I think that exit must return 255 to the shell on error, as indicated by 1
spectre^I guess?
ickelooks like it was killed
spectre^http://pastebin.com/m1e803053
buubotspectre^:  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
ickedoes 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
ickewhat error?
spectre^The printed error from the calleee
spectre^I didnt bother checking for -1 because I saw the error
spectre^Make sense?
DrForrspectre^: $? may have been set before your operation ran.
ickehmm? it isn't $!
PerlJamspectre^: 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'});
ickeit's supposed to always contain the exit value (as described)
spectre^I see that printed
spectre^er
go|dfisheval [ 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
buubotgo|dfish: ["-0.2","-0.199999999999999"]
spectre^PerlJam: I'll check
go|dfishwhy does that return 2 different results ^^ ?
PerlJamgo|dfish: floating point representation error.
DrForrgo|dfish: Because 1/5 can't be exactly represented in binary. In the first case you just get lucky.
PerlJamgo|dfish: either use fixed point (if you can) or always be sure to specify the precision of your floating point numbers on output
PerlJamgo|dfish: (unless you want more precision than the floating point error, you'll be fine)
spectre^http://pastebin.com/m27595d
buubotspectre^:  The 25 line paste m27595d has been copied to http://erxz.com/pb/22640  .
spectre^Still getting a 255
go|dfishPerlJam: ah
spectre^With those checks in
go|dfishDrForr, PerlJam, thanks!
spectre^And neither of the if statements were true
PerlJamspectre^: you always see "NOTICE gcum returned 255" just before it dies?
PerlJamer, s/gcum/gsum/ even
PerlJam(*NOT* a freudian slip  :)
spectre^Yes, sir
spectre^I do
spectre^WAIT
LeoNerdA 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
PerlJamspectre^: have you tried changing "exit(1)" to "exit(42)" or something?
spectre^I'll try it
ickespectre^: take the literal code from perldoc -f system to interpret $?. works for me
spectre^I see what's wrong
PerlJamIt'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
Mantususushiiiiiiiii
pwrcyclemst: i remember now, using "ssh -l user example.com" hides the user@ from "ps aux". that was the advantage.
Khisanthdoesn't look terribly useful at least on linux ...
cmihaicmihai 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
paullThanks in advance for any help with my above paste
DrForrpaull: Maybe you're not aware that @_ is a list, not a variable.
paullI'm only squirting in one value... Would I use $_ instead then?
KhisanthNumber::Bytes::Human
Khisanth@_ < 1000000000 compares the number of args passed in
Khisanthif you passed in only one value then @_ == 1
DrForrsub FormatTraffic { my $count = shift; ... }
paullAhhh OK
paullI'll give that a go.. Thanks so much!
paullDrForr: happy to help further? Still returns 0!
DrForrWell, kind of hard to tell what's going on without seeing sample input.
DrForrAnd the rewritten version.
paullOK
paullI'll plug away at it
paullCheers!
awnstudioanyone 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
awnstudiouh?
Khisanthask google to guess :)
awnstudiome and google arent speaking atm
f00li5h[HireMe]awnstudio: I mean, are there attributes for the languages
awnstudioin 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
awnstudioPerl, Python and Ruby comparison apps with similar functionality. Why? Because I can - http://github.com/zoozed/comparisons
kawinijaguys, what is the differences between %yo = (yo => 'yo') and %yo = ('yo' => 'yo)
kawinijawhat 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"
pkruminstehe
pkruminsthis kit knows the difference
Action: f00li5h[HireMe] paws at pkrumins
awnstudiothis is just a fucking disgrace, http://www.cpantesters.org/distro/W/WWW-Mechanize-Pluggable.html#WWW-Mechanize-Pluggable-1.05
shortenawnstudio's url is at http://xrl.us/bgscci
kawinijaguys, what are the differences between %yo = (yo => 'yo') and %yo = ('yo' => 'yo)
kawinijaguys, what are the differences between %yo = (yo => 'yo') and %yo = ('yo' => 'yo')
kawinijasorry
ickealready answered
ickeno difference
ew73Two ' characters.
kawinijaok
kawinijathanks
SpiceMankawinija: perldoc -q "semicolons and commas"
dumbtrollcause i took no exam but i still want to
dumbtrollbut i don't know to where i can find it
dumbtrollhelp please
dumbtroll>
dumbtroll?
dumbtrollyou know?
Khisanthgo troll somewhere else
dumbtrollyeah he said that the other one i was there
dumbtrollbut i still felt to so i came here
dumbtrollyo
dumbtrolli saw another one was like more dynamic
dumbtrollbut no stupid syntax
dumbtrollyou know?
Action: GumbyPAN CPAN Upload: Log-Syslog-Fast-0.27 by ATHOMASON
atomikusurprisingly enough, its dead in here
pkruminsno it's not. yes it is. no it's not. yes it is.
go|dfishPerl is dead after all.
f00li5h[HireMe]paw paw paw
pkruminsf00li5h[HireMe], kit kit
pkruminswhat are you doing?
f00li5h[HireMe]going to roleplaing
f00li5h[HireMe]and getting clawed at va SMS
pkruminsSMS is so web 1.0
Action: GumbyPAN CPAN Upload: Log-Syslog-DangaSocket-1.05 by ATHOMASON
Khisanthhmm
Khisanthgather-take would be convenient right now ...
mstKhisanth: Language::Keyword::Gather
KhisanthI think you mean Syntax::Keyword::Gather
mstyes
bennymackanyone 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..
Khisanththis is probably a very silly use of it :)
bennymackI'm having a look at SQLite::VirtualTable now. Looks promising
bennymackthere's something like over 500 results for SQLite on CPAN thouhg
Khisanthmy $my_nick = '...'; my $me; @users = gather { for(@users) { if($_->{nick} eq $my_nick) { $me = $_ } else { take $_ } }
Khisanthbennymack: do you need a virtual table or do you need a function? because DBD::SQLite has a sqlite_create_function method
bennymackKhisanth: well, I thought the sqlite_create_function stuff happened on the DBI side of things?
waltmanbennymack: I've given a talk at a few yapcs on writing sqlite functions :)
bennymacki've been to those talks ;)
waltmanyay!
waltmanmy impression is that there's not really a "round trip", since you're making library calls
waltmanI 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?
bennymackwell, I need to fetch the zip in question, calculate a x and y min and max and select zips that fall within that range.
bennymackI 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.
ickethat's an n-mile square, not radius
bennymackicke: yes, thanks ;0
waltmanI don't see any way to have an sqlite function return more than one column, let alone multiple rows
waltmanI think the best you could do is return a string like "90210,90211,31459" and then have the caller split it
Thurynwhat?
Thurynwaltman, are you new/
Thurynreturn() *always* returns a list
Thurynreturn('foo', 'bar', 'baz');
Thurynreturning a single value is just a special case
awnstudioun huh
Popular searches: gvfs-open   subTabbed xmonad   

Generated by irclog2html.pl 2.1mg by Jeff Waugh - return