#perl
13 October 2007
Total 39 pages. You are browsing page 1/39.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Sat Oct 13 00:00:11 2007
--- Day changed Sat Oct 13 2007
00:00 <****> I can always change my time logging bash script to say, for example, VAC | VAC_OUT
00:00 <****> or whatever
00:00 <****> while you're at it, you can fix the presumption of lunch too
00:00 <****> ?
00:01 <****> "cfedde" at 38.97.200.230 pasted "get ya staretd" (12 lines, 163B) at http://sial.org/pbot/28032
00:01 <****> How do you mean, 'presumption of lunch'?
00:01 <****> that "lunch" is the out of office windowin the middle of a day.
00:01 <****> teknopagan: IN OUT IN OUT, you presume that the first OUT there is lunch.
00:01 <****> assuming that the person left for lunch
00:02 <****> That's my own personal timelog
00:02 <****> and from that global, this looks like a bad time to be asking questions
00:02 <****> Yup - I'm over time now
00:02 <****> too
00:03 <****> I was going to throw a huristic into my template. if it had four elements in the day then the middle one is lunch.
00:03 <****> Anyway, I appreciate the help - I'll be back on Monday to actually start learnin'
00:03 <****> I wrote a little shell script once to do something like this
00:04 <****> cfedde: hashref would probably be easier to work with :)
00:04 <****> It was called thusly: punch [in|out] [reason]
00:04 <****> Khisanth: that was just a quickie first pass
00:04 <****> I like my shell script - basically, I issue a command that says "I'm out" and the script logs the time to a file, fires up xlock, waits for xlock to terminate, then logs that time the the file
00:04 <****> punch GumbyGumby "for not being there"
00:04 <****> hahaha, PerlJam
00:05 <****> mine is punch [out|lunch]
00:05 <****> punch in $coworker's nose
00:05 <****> I aliased it to pout|plunch
00:05 <****> Anyway, I'd love to stay and talk, but I really gotta run
00:06 <****> thanks again, folks!
00:06 <****> punch out teknopagan
00:06 <****> :)
00:06 <****> :) as we speak!
00:08 <****> hello.
00:08 <****> is there a way to split() and specify a throw away and keep patterN
00:08 <****> ?
00:09 <****> convivial: the thing you're splitting on is throw away, the rest is kept.
00:09 <****> s/throw/thrown/
00:09 <****> for instance, split(/.*\d+/, $line); where $line = "aaaa:1345"
00:09 <****> actually that is not correct
00:09 <****> good because it looks terrible
00:10 <****> convivial: show us some input and what you want the output to look like
00:10 <****> my input is like this: aaa:1111,bbbb:2222,ccc:3333, what I want to do is create an arrary of @names filled with {aaa, bbb, ccc} and @values {111,222,333}
00:11 <****> why not build a hash?
00:11 <****> that would be too easy
00:11 <****> and that would be split /:/
00:11 <****> pain is fun
00:11 <****> I guess I could build a has, but how do I build it?
00:12 <****> convivial: %hash = split /[:,]/, $string;
00:12 <****> ok, i'll give it a try
00:12 <****> (one way)
00:12 <****> %h = map /([^:]*):(.*)/s, split /,/, $input
00:12 <****> map would be my suggestion
00:12 <****> and once I like the split. Simple and fast.
00:15 <****> speaking of split
00:20 <****> hi. I'm brand new to perl. how can I rescue failure if a "Use" statement fails due to a missing library? for example, "if (! Use Term::ANSIColor) { $have_color = false; }"
00:20 <****> there is no Use statement
00:20 <****> what is it called?
00:20 <****> use
00:20 <****> use . note lower case
00:20 <****> oh. thanks
00:20 <****> it's "use", piojo, and it's time you learned to use cpan shell
00:21 <****> and you can't use "use" inside expressions
00:21 <****> core: Term::ANSIColor
00:21 <****> wouldn't make sense anyway
00:21 <****> eval: eval { use Term::ANSIColor}; $@
00:21 <****> cfedde: no
00:21 <****> Hm. That's not a bot command here. But anyways, Term::ANSIColor is core since 5.6.
00:21 <****> how do I do something like, my (, $name) = split(/:/, $line);
00:21 <****> enobuubot
00:22 <****> mauke: hear about eyeball jewelry? http://www.nytimes.com/2004/12/12/magazine/13EYEBALL.html?_r=1&pagewanted=all&position=&oref=slogin
00:22 <****> dkr's url is at http://xrl.us/7cch
00:22 <****> eval { require Term::ANSIColor };
00:22 <****> i'm trying to modify git (version control system), so i would like to make it work for people with old perl versions
00:22 <****> mauke: and that gives a return value indicating success?
00:22 <****> yes
00:23 <****> thanks, i'll try that
00:23 <****> generaly I'd say that checking to see if a library is available is not a very good idea.
00:23 <****> at least not great at runtime.
00:24 <****> but isn't the only alternative to make users install it?
00:24 <****> you could bundle it.
00:24 <****> oh, good idea. i'll suggest that, if the developers are interested in merging my modifications
00:25 <****> thanks
00:25 <****> hello everybody! :)
00:25 <****> hey!
00:26 <****> in fact, i get a little shut-eye hehe
00:26 <****> how does one specify null in perl?
00:26 <****> undef maybe?
00:27 <****> convivial, undef?
00:27 <****> perlbot false
00:27 <****> undef, 0, "", "0"
00:27 <****> so I can say, undef $array[$i];
00:28 <****> Pacman promotes consumption of undead.
00:28 <****> depends, do you want to set it to undef or do you want to delete it?
00:28 <****> $array[$i] = "";
00:28 <****> convivial, you wanna set undef value ?
00:28 <****> Chris62vw, the empty string is not undef ;)
00:28 * CPAN upload: Text-Iconv-1.6 (+++++) by MPIOTR
00:28 <****> I just want to delete an entry in an array
00:28 <****> wow, I am mentioned by name on the TPF blog for some minor help I provided
00:28 <****> convivial, delete
Total 39 pages. You are browsing page 1/39.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
