Home Page   #c  #javascript  #openmoko  #php  #apache  #mysql  #ruby-lang  #cisco  #java  #perl   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#perl

13 November 2007


Total 35 pages. You are browsing page 1/35.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last

--- Log opened Tue Nov 13 00:00:39 2007
00:01 <****> sendro, in perl there is always more than one way == TMTOWTDI
00:01 <****> frankg, so that way should work then?
00:01 <****> cause its not..
00:01 <****> try
00:02 <****> perl -Ipath ...
00:02 <****> perl -I/home/d314043/ Tonic-1.04/bin/tonic
00:02 <****> or
00:02 <****> perl -Ipath /home/d314043/ Tonic-1.04/bin/tonic -c -c telstra.conf -po ITCS
00:02 <****> oops
00:03 <****> which one?
00:03 <****> what's the name of the script you are running?
00:03 <****> tonic
00:04 <****> what's the name of the module it's using
00:04 <****> whats wrong in this syntax? for ($var (@array)) && ($arraycount<10)
00:04 <****> for(false)
00:04 <****> frankg, a custom written module.
00:04 <****> ?
00:04 <****> sendro, onic use --- use Module.pm;
00:05 <****> sendro, inside tonic --- use Module.pm;
00:06 <****> riaal, your expression can be interpreted as TREU or FALSE
00:06 <****> err TRUE
00:06 <****> is there a date module i can use?
00:06 <****> dogmeat, There are many
00:06 <****> dogmeat, http://search.cpan.org/
00:07 <****> dogmeat: http://www.perl.com/pub/a/2003/03/13/datetime.html
00:07 <****> thanks
00:08 <****> frankg, you have a sugestion on how to loop an array but not more then 10 values?
00:08 <****> ./Tonic-1.04/bin/tonic ---use Test/module.pm
00:08 <****> riaal, for (1..10) {...
00:09 <****> frankg, still no go
00:11 <****> frankg, that won't work if the array has less then 10 values
00:11 <****> that why I wanted the &&
00:12 <****> for (my $i = 0; $i < 10 && $i < @array; $i++){ $array[$i] .. }
00:13 <****> 10; }
00:14 <****> sendro: http://world.std.com/~swmcd/steven/perl/module_mechanics.html
00:14 <****> no need for print "$_" Just print; will do
00:14 <****> ology, good point
00:15 <****> Woosta, works great! thanks!
00:15 <****> thanks frankg
00:15 <****> np
00:17 <****> foreach my $i ( 0 .. $#array ) { last if $i == 10; ...}
00:17 <****> I prefer mine .. I like to keep all loop logic in the one place
00:23 <****> is there a date/time calculator module that comes with perl? looks like DateTime and Date::Calc aren't in the default install
00:23 <****> using 5.8.5 btw
00:24 <****> the default calculator is getting the epoch time and using arithmetic, :)
00:24 <****> and converting back to a date. :)
00:25 <****> DOH DOH DOH
00:25 <****> perl comes with math operators
00:26 <****> you do the math
00:26 <****> perl comes with extra padding.
00:26 <****> mm, pudding
00:26 <****> it's troublesome dealing with leap seconds and the like, though
00:27 <****> Use DateTime
00:27 <****> It's the most accurate and complete
00:28 <****> HIPPOS ARE EATING MY NEUROTRANSMITTERS
00:32 <****> Greetings, Perl gurus! I am laid low by this problem, and I wonder if someone could remove the cloud that's keeping me from seeing what to do... I have a scalar that contains four hexidecimal digits, and I want unpack to give me a list of two integer values... But unpack("h2h2", "f00f") isn't doing it... I'm missing something, despite looking hard at perldoc -f pack
00:33 <****> ChibaPet: why quote f00f in string? try 0xf00f
00:34 <****> well
00:34 <****> I'm getting the data from another program.
00:34 <****> "f00f" are 4 ascii characters, not 4 hex digits
00:34 <****> Right, whichever. I'm getting the data externally, and I need to convert it.
00:34 <****> I'm doing this now:
00:34 <****> map { hex($_) } unpack("a2a2", $chunk)
00:35 <****> but I can't help but think unpack has to be able to do that without the map and the hex
00:36 <****> or am I thinking about unpack() the wrong way?
00:37 <****> I got this error: what does it mean, please? Can't use string ("QueryBlocker v1.0 loaded\n") as an ARRAY ref while "strict refs" in use at (eval 14) line 359.
00:37 <****> I am trying to get the passed string in my subroutine as this: my $msg = $_[0][1];
00:37 <****> you tried to use a string as an arrayref
00:38 <****> GionnyBoss: $_[0] is that string. not an arrayref
00:38 <****> Someone called me lazy, and I felt bad. But shouldn't I feel greatful?
00:38 <****> mst: ok thanks, let me try that
00:38 <****> awesomess3: depends on context!
00:39 <****> GionnyBoss: do you know what $_[0] means and what @_ is?
00:39 <****> Khisanth: that is so true, I should've thought of that
00:40 <****> so, does unpack do conversions? or is the best I'm going to get this extraction of a couple digits that I then convert with hex()? I'm not sure what the 'h' and 'H' directives are there for, perhaps. Maybe not everything that is meaningful for pack() is meaningful for unpack()?
00:41 <****> ChibaPet: unpack() says "I convert Perl scalars into Foreign crap (hex, binary, int, short, float, long)"
00:41 <****> s/unpack/pack/ ?
00:41 <****> pack() says "I pack shit into sanity"
00:41 <****> ChibaPet: perhaps it would be best not to listen to awesomess3 ;)
00:42 <****> heh
00:42 <****> So, to reiterate, how do I do this (map { hex($_) } unpack("a2a2", $chunk)) with just unpack()?
00:42 <****> if nothing else, perldoc perlpacktut would be a more trustworthy source
00:43 <****> Ooh, I didn't know that existed. Thank you.
00:52 <****> eval: [unpack "CC", pack "H4", "F00F"]
00:52 <****> Khisanth: [240,15]
00:52 * Khisanth pokes ChibaPet
00:52 * ChibaPet is poked.
00:52 * Khisanth packs and unpacks ChibaPet
00:54 <****> hm
00:54 <****> I wouldn't have guessed at "C". Hm.
00:55 <****> I want a chiba pet with cute little ganja fur
00:55 <****> My "F00F" is coming in as some arbitrary string, however... Do I want to pack it, and then unpack? Or can unpack do something with the string of four hex digits directly?
00:55 <****> what does 'block on read' mean in this context: http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm
00:55 <****> heh
00:56 <****> eval: [unpack "S", pack "H4", "F00F"]
00:56 <****> Khisanth: [4080]
00:57 <****> Mordecai1, are you familiar with blocking in general? In this case, it seems to indicate that it's going to "poll" if you select that option, rather than waiting for input.
00:58 <****> Mordecai1: Essentially it means that the function will not return until it has received input, no matter how long it takes.
00:59 <****> well, you can block and have a timeout on the block, :)


Total 35 pages. You are browsing page 1/35.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo