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

Channels


#perl

27 October 2007


Total 23 pages. You are browsing page 23/23.

First :: Prev :: [...] [19] [20] [21] [22] [23] :: Next :: Last

23:04 <****> nah
23:04 <****> i would use different delimiters for s though
23:05 <****> what do you mean?
23:05 <****> to avoid the escaping
23:06 <****> :)
23:06 <****> Oh that works?
23:06 <****> You mean different delimeters for split, right? There's no s there
23:06 <****> yes. there is
23:06 <****> s///
23:07 <****> Ahh I see.
23:08 <****>; ?
23:09 <****> no
23:09 <****>e;
23:09 <****> as far as function goes, TIAS
23:09 <****> what's TIAS
23:09 <****> try it and see
23:09 <****> perlbot, tias
23:09 <****> Try It And See: the best way to learn if something works.
23:10 <****> Maybe I'll just escape the slashes then.
23:10 <****> which will probably have its own host of problems.
23:10 <****> hanzou: So, don't.
23:10 <****> hanzou: "s" can take any delimiter you want
23:10 <****> thing Khisanth said is like a double-delimeter.
23:11 <****> huh? no, it's the same as s///
23:11 <****> s{regexp}{replacement} s.regex.replacement. s(regex)(replace) etc;
23:11 <****>e;
23:11 <****> you can even use whitespace or letters, heh
23:11 <****> Ahh
23:11 <****> but i would not recommend it
23:11 <****> and [], Perl uses the matching closing character to close it, for anything else it uses the same one.
23:11 <****> You can't use whitespace
23:11 <****> you can't?
23:12 <****> Oh well
23:12 <****> Nope
23:12 <****> ah ok
23:12 <****> And you *need* whitespace if you use alphanumeric
23:12 <****> eval: $_ = "abc"; s abaza; $_
23:12 <****> jagerman: azc
23:12 <****> right
23:13 <****>
23:14 <****> eval: $_ = "abc"; s{b}/z/; $_
23:14 <****> jagerman: azc
23:20 <****> good afternoon
23:21 <****> if I have a line like ($foo, $bar, $baz) = $line =~ /regex_that_assigns/g;
23:21 <****> how may I tell how many matches it actually accomplished?
23:21 <****> i.e. maybe the line only matched two
23:22 <****> tzanger: Put it into an array, then look at the array size
23:23 <****> yeah I'd thought of that too... then I need to pull them out afterward
23:23 <****> was hoping to avoid that :-)
23:23 <****> ($foo, $bar, $baz) = @array; # not too difficult
23:25 <****> I know
23:25 <****> then jus tlook at $#matches?
23:25 <****> er $#ary
23:25 <****> @matches
23:25 <****> my $count = @matches;
23:26 <****> or scalar(@matches) if you need to use it somewhere that would interpret it as a list
23:26 <****> (Using an array as a scalar value gives you the array size)
23:26 <****> hmm
23:29 <****> thanks jagerman
23:36 <****> what can i use to strip content types from emails
23:37 <****> mimedefang
23:37 <****> cheers
23:40 <****> mmlj4, where do i get it from ?
23:41 <****> google
23:41 <****> its not helping much
23:41 <****> hello
23:41 <****> its looking like its part of sendmail
23:44 <****> matt_: Not part of, just commonly used with
23:44 <****> i want the var $file to hold a string only if it ends with the extension that is held in ARGV[1]. how do i do this? i wrote: $file =~ /$ARGV[1]\$/ but it aint it
23:45 <****> jagerman, ok, i found it now, its not mimedefrag its mimedefang
23:45 <****> heh
23:46 <****> ?
23:46 <****> Ben_Cs: $file =~ /\Q.$ARGV[1]\E$/ is probably more like what you want.
23:46 <****> Ben_Cs: \$ matches a literal dollar sign; $ by itself matches the end of the string
23:47 <****> \Q and \E make sure any special characters in between them (i.e. in $ARGV[1]) get escaped.
23:47 <****> jagerman: ok thanks
23:47 <****> LOL you gotta see this: http://imc-il.com/ofer/pokerroom.avi
23:49 <****> jagerman: just started learning perl. my course teacher gave us lots of info in a .ppt file, but no detailed enough, and an exercise. so i have to jump from the .ppt to O'reilly's book all the time, and still i don't always succeed to find what i want :)
23:51 <****> Ben_Cs, learning perl is easy. mastering it is another issue
23:52 <****> good luck though.
23:52 <****> thanks
--- Log closed Sun Oct 28 00:00:54 2007


Total 23 pages. You are browsing page 23/23.

First :: Prev :: [...] [19] [20] [21] [22] [23] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo