@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet


Comments:

<0> i'm trying to patch a bug in this module but since i'm kinda new to perl i was wondering if you could help me
<0> the bug is that when receiving a stream it will drop whatever is after a single quote
<0> example.. MC Hammer - Can't touch this becomes MC Hammer - Can
<0> my ($title) = $text =~ /StreamTitle='(.*?)'/i;
<0> that is the line and I don't know what (.*?)'/i does so I can't fix it
<0> if I print @_ above that linen it prints out Netx::WebRadio::Station::Shoutcast=HASH(0x8474084)StreamTitle='MC Hammer - Don't touch this';StreamUrl='';
<0> when I print out the $title after that line it ends up MC Hammer - Can
<1> You came up with this regex?
<0> no, it was what was in the module



<0> i haven't changed it
<1> It's a module written by a short sighted person
<0> yeah, i'm sure
<1> Don;t use it
<0> its the only one that does what I need
<1> It's prone to give you more headaches
<0> well besides that ' bug
<0> i only need it to do one thing
<0> thats read and return the meta info from radio stations
<1> well, we like to help perl programmers here. not fix other people's code.
<0> Yes, I understand that
<1> if you really need to fix it you can read more on regexes
<1> perldoc perlretut is a good place to staert
<1> I ***ume you have perl installed on your machine
<0> I just um.. I'm a very basic perlgrammer and people are always scarin me with how hard regexs are
<1> just type perldoc perlretut at th eshell
<1> regexes are not hard
<1> Judge for yourself after reading that tutorial.
<0> ok
<1> We are more than willing to help people trying to program
<0> i'm writing the backend to http://www.stream-irc.net
<0> i learn as I go
<1> Best way to learn.
<1> IMHO
<0> do you realize how long that thing is?
<0> I plan to learn regexs but right now i'm kinda in the middle of something and this will take a few days
<1> Most of us all spent quite a deal of time reading it too.
<1> Personnaly I read it several times
<0> -sigh-
<0> I came here cause I can't connect to efnet, figured you guys could help me with a quick fix so I could get back to other things
<0> I am glad you gave me that reference
<1> I doubt you;d get much more help from efnet
<1> trust me, programmers don;t like to spoonfeed.
<0> Yeah, well



<0> I won't either
<0> erm.. don't
<0> It's not like I'm asking for someone to teach me perl or teach me how to do something
<1> That reference by the way is among the best one to learn about regexes
<0> I need a fix so I can go back to learning perl
<0> I don't NEED a fix
<0> its just annoying to not have one
<1> You're asking someone to fix a bug made by another programmer.
<0> no, its not really a bug because it's not suppose to do what I"m making it do
<1> The way the regex is made, yes it's supposed to misbehave.
<0> yes, and you know this because you understand what those symbols mean
<1> The guy din;t forsee that there might be single quotes in titles
<0> no, but any decent programmer would have used something such as the first ; after the StreamTitle
<0> or better yet, used ;StreamURL as a key also
<0> since it only will accept ice / shoutcast streams
<0> but since I'm not that far in perl yet I can't write that
<0> TopMach
<0> Your mean
<0> you made me figure it out myself
<0> and so now i understand regexs alittle bit
<1> I know
<0> my ($title) = $text =~ /StreamTitle=\'(.*?)\'\;StreamUrl=/i;
<1> You don't need to escape (backslash) thw quotes
<0> if i don't it turns my screen a differnt color in joe :P
<1> if it works it's because of the 'StreamUrl you added. the regex has to match that far, so it won;t stop at the first quote found
<0> oh
<0> well it included that single quote in the variable
<1> well, if it works for you...
<0> Ace of Base - Travel to Romantis'
<0> so i had to add that single quote to the search term
<0> your methods are harsh, but I do appreciate what you did
<1> Of course. I'm glad you finally appreciate
<0> heh, it works.. and works well :)
<0> what is the variable name for arguments sent via command line
<0> google is my friend
<0> heh, -goes back to work then sleep-
<0> thanks again
<1> perldoc is actually your best friend when it comes to perl.


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #perl
or
Go to some related logs:

lim kok weng
MUFFBURGER.COM
ashwita
aiswaria rai
#chat-world
#chat-world
orospu.kt
rockzilla bikes
daru vich pyar
doctorbob Viper



Home  |  disclaimer  |  contact  |  submit quotes