#perl
06 October 2007
Total 39 pages. You are browsing page 1/39.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Sat Oct 06 00:00:35 2007
--- Day changed Sat Oct 06 2007
00:00 <****> is there a way to match string without involving regexp ? ie.. like simple and fast stuff... * for wildcard just or so
00:01 <****> rudenstam: the extra . is too much to type to use a regexp for it?
00:01 <****>_<
00:01 <****> well, so much for my dinner :/
00:01 <****> trying to match ip addresses that got . all over the place
00:02 <****> [.] or \.
00:02 <****> would perl optimize a single line of code like "$sum+= expensive_sub($_) if (expensive_sub % 13 == 0)"?
00:02 <****> wait, this sounds like something common that a lot of people would need to do
00:02 <****> rudenstam, use Regexp::Common
00:03 <****> cube it
00:03 <****> and I do that by first $ip =~ s/./[.]/g ?
00:03 <****> Temporarily out of entropy. Please try again later.
00:03 <****> stupid workbench
00:03 <****> buubot: jerk it
00:03 <****> simcop2387-music: FOLKS I JUST TOOK A DATE-RAPE DRUG AND I'LL BE OUTSIDE ON THE LAWN
00:03 <****> Regexp::Common::net I assume
00:03 <****> rudenstam, no. [] is a character class. read perldoc perlre. and use Regexp::Common
00:04 <****> rudenstam: what exactly are you trying to do? just match and/or capture IP addresses from text?
00:04 <****> I got ipaddresses in a sql.. and I want to see if the ip connecting matches any.. like.. 123.123.%.% and stuff like that
00:06 <****> rudenstam: an address in sql? huh?
00:06 <****> an sql database then
00:07 <****> rudenstam: so you are using the Sql matching, and not Perl's then?
00:07 <****> I just store the ips in sql
00:07 <****> cause I need to check if ip matches 127.0.0.1 also.. and if so, always allow it
00:07 <****> rudenstam: so what you are really doing is seeing if an IP matches specific subnets?
00:08 <****> Paladin`: almost I guess.. sometimes just parts of subnets
00:08 <****> rudenstam: Net::Subnets seems to do that
00:09 <****> okey.. thanks
00:09 <****> rudenstam: always check CPAN.. there is usually a module that does what you want
00:09 <****> ah.. new to perl.. did not know of CPAN.. thanks
00:09 <****> rudenstam: welcome
00:10 <****> http://search.cpan.org
00:11 <****> dkr: yeah.. googled my way there
00:25 <****> either perlmonks is incredibly bloated, or this version of konquerer has a memory leak
00:25 <****> 200M resident memory used and that's the only site I've visited in this session
00:26 <****> my konqueror only has 100M res and I've been through a boatload of tabs
00:26 <****> and it's 64-bit
00:27 <****> stop moaning about bloat, ram comes in gigabytes these days :)
00:28 <****> Somni: I'm guessing it's the latter.
00:29 * CPAN upload: Test-Harness-2.99_03 (+++++) by ANDYA
00:29 * CPAN upload: DateTime-Format-Natural-0.54 by SCHUBIGER
00:29 <****> seems that way, loading perlmonks doesn't cause any noticeable increase on mine. And perlmonks is hardly complicated anyway.
00:30 <****> there's something with Perlmonks, it takes a few seconds for both firefox and konqueror to load any given page
00:39 <****> Somni: Er, the perlmonks server is psychotically slow.
00:39 <****> (Because Everything is a gigantic pig)
00:39 <****> what a surprise, it's Everything Engine
00:45 <****> print (((1..9)."0")x6); <= this is wrong. What I need is an output of 12345678901234567890.... (6 times 1-0)
00:45 <****> what an odd request..
00:45 <****> join your sequence, repeat that
00:45 <****> join('', '1' .. '9', '0') x 6
00:45 <****> or just change the . to a , so it makes sense :)
00:46 <****> Somni: yea, Day two into perl...I'll have some odd questions for now :/
00:49 <****> mauke: any difference between what you wrote and join('', 1 .. 9, '0') x 6?
00:49 <****> not really
00:49 <****> perl will just convert those numbers to strings anyway
00:49 <****> mauke: so the string will get treated as a decimal either way
00:49 <****> what?
00:50 <****> oh, other way around.
00:50 <****> you don't need to quote numbers
00:50 <****> n8
00:50 <****> nvm
00:50 <****> mauke: just did ('a' .. 'c'), makes sense now
00:51 <****> eval: [ '000' .. '015' ]
00:51 <****> mauke: ['000','001','002','003','004','005','006','007','008','009','010','011','012','013','014','015']
00:51 <****> eval: [ 000 .. 015 ]
00:51 <****> mauke: [0,1,2,3,4,5,6,7,8,9,10,11,12,13]
00:51 <****> mauke: Why does it stop at 13 and not 14?
00:51 <****> heh
00:51 <****> why would it stop at 14?
00:52 <****> am i correct in thinking that chomp will only remove the $/ character? hence if it's \n, then $_ =~ s/\n//g; chomp; the chomp here is superfluous ?
00:52 <****> yes
00:52 <****> NessieLiberation: yes
00:52 <****> not necessarily
00:52 <****> oh wait
00:52 <****> hence if it's \n
00:52 <****> mauke: I guess 15, why doesn't it go to 15?
00:52 <****> yeah
00:52 * Limbic_Region shuts up
00:52 <****> sabooky: because 015 is 13
00:52 <****> 015 = 13
00:53 <****> base 8
00:53 <****> without the chomp line, the output is different from if it's there i think
00:53 <****> sabooky: perl interprets 0nn as an octal
00:54 <****> rickest, mauke: Intresting... thanks
00:54 <****> eval: [015, 13]
00:54 <****> rickest: [13,13]
00:54 <****> eval: [009]
00:54 <****> rickest: ''ERROR: Illegal octal digit '9' at (eval 213) line 1, at end of line
00:54 <****> eval: [001]
00:54 <****> rickest: [1]
00:54 <****> eval: [010]
00:54 <****> rickest: [8]
00:56 <****> nevermind, it was a different chomp in the cde block that i thought was changing something
00:56 <****> thanks and bye
01:13 <****> whos doing some coding tonight?
01:14 <****> this is a world-wide holiday away from coding; if you're caught you may be beaten with wet noodles
01:15 * initself_ hides!
01:17 <****> sorting is freaking hard
Total 39 pages. You are browsing page 1/39.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
