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

Channels


#perl

17 October 2007


Total 46 pages. You are browsing page 2/46.

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

00:22 <****> Thanks. I see my problem now.
00:23 <****>", "/path/to/my/log/file" ) or die ...;
00:23 <****> re-open as in "open again" =P
00:24 <****> tnx
00:26 <****> LeoNerd, bareword filehandles is so oooollldddd
00:28 <****> Notrix: Sure, but STDIN / STDOUT / STDERR are usually a sensible exception to the rule :)
00:29 <****> LeoNerd, yeah true :(
00:30 <****> initself: im using URI now, but if the URL has not xxx:// at the beginning it cruhs
00:30 <****> it crash
00:31 <****> Regexp::Common::URI::http
00:31 <****> so easy
00:31 <****> could someone have a quick look at this snippet http://rafb.net/p/F005RV45.html and tell me why i keep getting "Global symbol "$i" requires explicit package name at" for $i and $var?
00:31 <****> xpato: then your code contains a bug
00:32 <****> why reinvent the wheel :p ?
00:32 <****> tomboy64: because you're trying to use a C-style for loop and getting it wrong
00:32 <****> ayeeee
00:32 <****> ok
00:32 * Notrix hates C-style loops
00:32 <****> how would it be right?
00:32 <****> what is that first loop supposed to do?
00:33 <****> it's supposed to iterate over @maclist; foreach is not a good option since i need the iteration count
00:33 <****> why do you need teh count?
00:33 <****> well that isn't the correct syntax for a C-style for loop either
00:33 <****> anything wrong with print ONLINE join(", ", grep $allowed{$_}, @maclist), "\n"; ?
00:34 <****> Hey all, I have a wierd error I'm getting -- it's "Can't modify bitwise and (&) in scalar assignment at ezziaudit.pl line 180, near "/ /;"" But the line in question is COMMENTED OUT.
00:34 <****> and even if you did need the count, for my $i (0 .. $#maclist) would have been better
00:34 <****> mauke: mhmmm ... k, will try that ^^
00:35 <****> gushi, there's a mis-parsing upstream
00:35 <****> tomaw, $#maclist gives scalar @maclist - 1
00:35 <****> i'd put parens around the grep(), since if you add anything after @machlist, ... then it becomes an argument to grep instead of join
00:35 <****> That's what I'm thinking...is there any way to make the parse more verbose?
00:35 <****> or you are editing the wrong file :)
00:35 <****> i hate those errors, i have had that happen with join/map expressions
00:36 <****> found it.
00:36 <****> was some misplaced quotes.
00:37 <****> good
00:37 <****> mmap__: syntax highlighting usually catches those
00:37 <****> the missing quotes
00:37 * anno- doesn't trust syntax highlighting out of principle
00:39 <****> mst: why a bug, it works if the url is "well" defined, but i suppose the module should check this
00:39 <****> xpato: it does. then if the URL isn't well defined it throws an error
00:39 <****> xpato: your problem is you aren't catching the error
00:42 <****>new('foo') works, you just don't get any particular type of URI
00:42 <****> mauke: am i right to assume that "grep($allowed{$_}, @maclist)" checks if some key in %allowed matches @maclist and returns its value? is that so?
00:42 <****> not quite
00:43 <****> grep loops over @maclist, returning those elements for which $allowed{ } returns true
00:43 <****> mst: ok, so i should check if the url start with xxx://?
00:43 <****> mauke: so it returns elements from @maclist?
00:44 <****> yes
00:44 <****> xpato: I have no idea
00:44 <****> xpato: since what you've said errors, doesn't.
00:44 <****> eval: [ grep $_ % 2 == 0, 1 .. 20 ]
00:44 <****> mauke: [2,4,6,8,10,12,14,16,18,20]
00:44 <****> xpato: shows us your code ...
00:45 <****> ok
00:46 * mmap__ lives dangerously (without syntax highlighting ;-)
00:46 <****> but i want it to return the corresponding values from %allowed ... i can do it in to steps, i think. but i can't think of a way to modify that statement so it would work in a one-liner.
00:46 <****> you kids today, with your bell bottom pants, pacman and syntax highlighting
00:46 <****> mauke
00:47 <****> mmap__: ey, nothing against bell bottom pants!
00:47 <****> tomboy64: your original code doesn't use the values from %allowed
00:47 <****> why the change?
00:47 <****> oh wait
00:47 <****> tomboy64: sorry, I misread
00:47 <****> the original didn't have correct syntax either :)
00:48 <****> mauke: it does - print ONLINE $allowed{ $maclist[$i] }
00:48 <****> mauke: yep ;)
00:48 <****> print ONLINE join(", ", map $allowed{$_} || (), @maclist), "\n";
00:48 <****> or something like that
00:49 <****> with $time, in front of map
00:49 <****> mauke: ok, this got far too much magic in it for me to understand at this time of day xD
00:49 <****> mauke: i think i'll do it in a two-liner ;)
00:50 <****> tomboy64: map f [x1, x2, x3, ...] == [f(x1), f(x2), f(x3), ...]
00:50 <****> "xpato" at 200.73.34.13 pasted "#!/usr/bin/perl -w use strict;" (20 lines, 378B) at http://sial.org/pbot/28068
00:50 <****> mst: http://sial.org/pbot/28068.
00:50 <****> grep defined, @allowed{ @maclist};
00:51 <****> mauke: what's the "|| ()," doing?
00:51 <****>path methods
00:51 <****> tomboy64: a || b returns a if a is true, b otherwise
00:51 <****> anno-: you mean grep(defined, $allowed{@maclist})?
00:52 <****> @allowed
00:52 <****> tomboy64: perl's map is actually concatMap, i.e. you can return multiple values for each input. the () case returns zero values, effecticely filtering the element
00:53 <****> mst, yes that is the problem, and also that i have no clue what to do if they dont have
00:53 <****> mauke: ah, you liar
00:54 <****> perl -wle 'package Foo; use strict; my @name = split /::/, "Foo"; my $sym; while (my ($k, $v) = each %::) { $sym = $v if $k eq $name[0] . "::" }'
00:54 <****> what
00:54 <****> how did you say you implemented a use strict importer?
00:54 <****> *{$sym . "subname" } = sub {} would work but that's not strict refs safe..
00:56 <****> let me recreate the code
00:56 <****> \o/
00:56 <****> /o\
00:56 <****> \o/
00:57 <****> if i have: while(..){..; if(...){..}} how can i do the if jump to the outher while?
00:57 <****> xpato: what do you mean by "outer while"?
00:57 <****> there's only one while
00:57 <****> xpato: if is not a loop, any loop control statements automatically affect the 'while'
00:58 <****> "foo" at 88.218.180.162 pasted "How are you guys?;d here is boring without irc... ;d send replay , over 1 2 3" (1 line, 3B) at http://sial.org/pbot/28069
01:00 <****> message in a bottle...
01:00 <****> hey, I can reply with a paste!@
01:01 <****> "Chris62vw" at 69.34.101.137 pasted "Hi m00" (3 lines, 72B) at http://sial.org/pbot/28070


Total 46 pages. You are browsing page 2/46.

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


Tutti i nuovi CAP Italiani. Come ottenere il database completo