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

Channels


#perl

28 October 2007


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

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

02:20 <****> exactly
02:45 <****> is anybody here have a script to upload pictures on any web free hosting pages ?
02:48 <****> hey guys, I can split(//,$_) ; .. to access each character seperately, but is there a way to just do like $_[0] (when you've got a scalar)
02:48 <****> TapoutT: no, but you can use substr()
02:48 <****> $_[0] would be the first element of @_
02:49 <****> I want whatever is the most efficient :) .. I'll try substr() .. thx guys
02:49 <****> i usually just split, and then use the array but i'm trying to be as efficient as possible, thx again
02:49 <****> manipulating one character at a time is usually not the most efficient
02:52 <****> tmp.$_.txt"); .. then printing out the rows into each file, then gonna sort each file to see if it's faster
02:53 <****>) { print {substr($_,0,1)} "$_"; } .. kinda thing
02:55 <****> Oh sweet jesus christ on a pancake, I am going to mailbomb $client.
02:55 * jagerman didn't know jesus went well on pancakes
02:56 <****> Yeah, who knew.
02:56 <****> I did
02:57 <****> i thought he was a waffle man.
02:58 <****> Heh, for reasons too long to explain, I am now running kdevelop inside a vmware host, and forwarding X to a cygwin x server.
02:59 <****>_<
02:00 <****> TapoutT: on what OS ?
02:04 <****> tybalt89, centos 5
02:04 <****> do the sort with gnu sort ...
02:05 <****> man 1 sort
02:05 <****> for whatever reason it always prints to tmp.z.txt .. $i = substr($_,0,1); print {$files["my$i"]} "$_";
02:05 <****> I can report for a fact that looping through the strings and doing eq is not faster, it was 10x slower (actually, out of stupidity I was oding ==, but I suspect the speed results would be similar either waY)
02:05 <****> tybalt89, i'll try gnu sort
02:05 <****> And in this case I was going for exact equality, but I could possibly end up changing it to something that uses the other way too--at any rate, thanks to everyone for helping
02:06 <****> gusnort!
02:06 <****> Not tonight, thanks.
02:06 <****> TapoutT: er, $files["my$i"]? an array is not a hash
02:07 <****> tmp.$_.txt"); }
02:07 <****> there's also a handy tool "split" which can break a file up
02:07 <****> TapoutT: an array is still not a hash, you can't index into an array with a string
02:07 <****> TapoutT: turn on warnings
02:08 <****> also, how large is this file you're trying to sort, and how much memory do you have?
02:08 * polettix would also turn strict on
02:08 <****> Somni, how do you then tell print to use the filehandle?
02:09 <****> TapoutT: your problem has nothing to do with print, fix your data structure then work on the rest
02:10 <****> TapoutT: perldoc perldata is a good place to start.
02:11 <****> eval: use warnings; @x = qw(zero one two); $x["three"] = "three"; $x["four"] = "four"; join(", ", @x);
02:11 <****> Somni: 8325: Argument "three" isn't numeric in array element at (eval 238) line 1.8325: Argument "four" isn't numeric in array element at (eval 238) line 1. four, one, two
02:16 <****> heh, meant to be using the hash instead of array .. thx guys
02:17 <****> there we go
02:18 <****> what happens is that I program in perl, take 3-4 months off and come back and forget small things ;)
02:18 <****> like warnings
02:19 <****> ya i should be using warnings ;)
02:34 <****> I wonder how much disruption there would be if strict and warnings became default in the next perl and you had to explicitly turn them off
02:34 <****> jwang: make sure to leave the perl6 exception: perl -e is still non-strict. :)
02:36 <****> or you could compile perl to use strict|warnings by default or not
02:36 <****> that way people can still choose by compiling their own
02:36 <****> the disruption would probably be 100%
02:36 <****> jwang: just put -Mstrict into PERL5OPT and see what breaks
02:36 <****> I don't think any script or module without 'use strict' at the top would pass use strict
02:36 <****> if it could, it'd have use strict already
02:37 <****> some have 'no strict;'
02:38 <****> Hello mauke
02:38 <****> Gumbybrain: say hello to GumbyGumby
02:38 <****> do you have money... Living with my hello to gumbygumby.
02:40 <****> yeah, I wonder how many of those perl scripts would be worth making strict. probably not many. people just want them to run no strict
02:40 <****> f00li5h, purr
02:41 <****> is there a recommended version of perl to use as a base for compatibility?
02:41 <****> CPAN releases should probably lack to work with the last major release
02:42 <****> so, 5.6 now
02:42 <****> er, s/lack/lag/
02:42 * CPAN upload: Net-MAC-Vendor-1.18 (+++++) by BDFOY
02:42 * CPAN upload: Tie-Cycle-1.16 by BDFOY
02:42 <****> Somni: ok. that seems reasonable to me.
02:43 <****> how do i delete a file from the system with perl ?
02:43 <****> perldoc -f unlink
02:44 <****> thank you
02:45 <****> mauke: Insecure dependency in unlink while running with -T
02:45 <****> mauke: what exactly does that mean ?
02:45 <****> xored: the filename you're trying to delete is tainted
02:46 <****> where tainted = came from an unsafe source
02:46 <****> (-T enables taint checks)
02:46 <****> mauke: iam working on a plugin for twiki which should just delete attachments.
02:46 <****> mauke: taint = "owned by other users the the one who runs the script" ?
02:47 <****> no
02:47 <****> variables aren't owned by users
02:47 <****> variables only exist in your script
02:48 <****> mauke: iam not sure what you mean. Iam delete a file fromt he filesystem ( trying to)
02:49 <****> "taint" refers to data in your script (in this case, the filename), not some external entity
02:49 <****> mauke: how can i make in "untainted" ?
02:49 <****> see perldoc perlsec
02:50 * iank apeiron GumbyBRAIN
02:50 <****> Apeiron comes back with a gumbybrain.
02:51 <****> mauke: ok things are clear now. I want get arround that so easy. Anyway to "deactivate" the taint check for some lines ?
02:52 <****> can i check if element belongs to array (...) without explicitly iterating through it? :-)
02:52 <****> did you just read all of perlsec?
02:52 <****> tockitj: perldoc -q contain
02:52 <****> mauke, thanks
02:52 <****> mauke: no, i just took a overview
02:53 <****> "Once taint mode is on, it's on for the remainder of your script." ... "But testing for taintedness gets you only so far. Sometimes you have just to clear your data's taintedness. Values may be untainted by
02:55 <****> Thanks GumbyMAUKE
02:57 * CPAN upload: Test-Data-1.21 by BDFOY
02:57 * CPAN upload: Parse-Marpa-0.001_024 (+ ) by JKEGL
02:57 * CPAN upload: Test-File-1.19 by BDFOY
02:57 * CPAN upload: Test-HTTPStatus-1.07 by BDFOY
03:04 <****> {} if onair isnt set but i dont know how to use an if clause to check wether it is set or not
03:04 <****> tried several things but i just dont have a clue :-/
03:04 <****> scalar keys %{ $xml{onair} }
03:05 <****> (returns the number of keys in the {}, which in your example is zero)


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

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


Tutti i nuovi CAP Italiani. Come ottenere il database completo