| |
| |
| |
|
Page: 1 2 3
Comments:
<0> Why don't you just ban him permanently? <0> er <0> was scrolled uip <0> up <0> ($targetUrlQueryString = $targetUrl) =~ s/^.*?\.com\/.*?\?(.*)/$1/; <0> is that the right way to get the match into $targetUrlQueryString? <1> Can somebody tell me the one liner? for my $x (0..#@_) { print $_{$x}; } <2> There appears to be too many ways to do what I'm trying to do which is getting me confused. I want to parse through a text file that looks like this: <2> Name: Some Guy <2> Address: Whatever <2> Phone number: 213-555-1212 <2> and on and on and on. <2> Wanna read each thing into its own variable; for example: what appears after "Address:" I would like to get put into a variable named $address <3> well, there are a lot of ways to do that, which is one of perl's strengths, most would say <2> I don't disagree. <2> I'm just stating it as a reason I am getting confused.
<3> are you confused on syntax or concept? <2> I've got opening the file and reading it into an array figured out. <2> Syntax more or less. <3> is there a specific question or are you just stuck? <2> What I've thought up consists of: "foreach (@ARRAY) { chomp $line; if ($line =~ Field:*) { @field = split (/ /, $fieldline); " but I kinda get lost here... <2> That seems like a ridiculously ineffeicient way of doing it. <2> It seems like I should be using a hash instead. <3> what are you looking to do with the stuff in the file? <2> Basically, the job of this script is to parse an e-mail, and then use WWW::Mechanize to submit what's in that e-mail to an HTML form. <3> brb <2> I can DCC an example e-mail that I want to parse... <2> (ie., example.txt) <3> so you're parsing emails for these fields? <2> Yes. <2> It's not like a straight up .htp***wd or /etc/p***wd situation. <2> It has to be like foreach line, then if that line = something, then, split it, put certain fields into variables. <2> I can show you what I mean. <3> ...this is unfortunate timing, as it looks like my dog needs to be walked. bbiab, hopefully. <2> Alright, I'll take this opportunity to grab dinner. bbiab too <3> away <3> oops <3> well, i'm back for a bit <2> back <2> OK, so, would you mind me showing you the text file that I want to parse? It's an a-typical example. <3> sure. can you post it at pastebin.com? <2> sure <2> OK, here we are: <2> http://pastebin.com/544584 <4> wow, i can tell right now this is a big mistake <2> What is? <4> do i dare ask why you are attempting to parse such an email? <2> The job of this script is to parse an e-mail, and then use WWW::Mechanize to submit what's in that e-mail to an HTML form. <4> apart from the inability to submit "to" a form, that doesn't answer my question <4> it just seems that "email" is a highly unnecessary layer in this process. and i'm trying to figure out why it's there <4> especially if cc info is being p***ed around <2> Two-Bits: Because, originally, whatever takes the order e-mails it to sales, and then sales forwards it to us to go to this webpage of ours to register the domain. <4> you and sales are not on interoperable servers? <4> if not, i have no choice but to bring the hosting capabilities into serious question <2> Eventually, the system in place is going to handle the domain registration part. <2> But for now, they register the domains by forwarding these e-mails to us to do by hand. <2> I'm Trying to get around that by parsing it as a text file, and then using WWW::Mechanize to submit the form. <4> well a generic and less efficient means may be to loop each line and match any text before and after a colon (minus whitespace) <4> load them up into a hash <4> and pull what you expect/need <2> This is what I've got so far: http://pastebin.com/544588 <4> which obviously doesn't even come close to compiling <2> Right; it's not done yet. <2> Hense "...so far". <4> um.. that wasn't the reason <4> 1) you are using variables before they are declared <5> hey <5> who <4> 2) you're inconsistant spelling of a variable will cause yet another aforementioned problem <4> 3) your regex is erroneous AND not delimited <4> 4) your array subscripts are improperly 1 based, rather than 0 based <4> there are a few other unnecessary things as well, but that's irrelavent <2> Hey, T-1000, scram. <6> how do interpreters read lines specified after #!, is it stdinn or what? <4> rmpants: que? <6> like how do they read whats p***ed to it
<6> like #!/bin/bash <6> echo "yo"; <6> how does /bin/bash read echo "yo"; <6> is it stdinn or what? <6> you know? <4> i imagine it reads from a file pointer. stdin is just a name for a data stream that applications might use for default input <4> it's not a hard defined concept that i know of <4> though i'm not entirely sure what the point of the question is. best i can tell you're trying to write your own interpreter? <6> well i'd like to <6> in perl <6> im wondering what to read from <6> file handle or whatever <4> you lost me <4> a perl script itself is not an interpretter <6> well you can do #!/usr/bin/perl <6> i want to do like #!/myscript <6> and have my script interpret <4> i dont think it works like that at all. the interpreter specified by the shebang is typically a binary executable <4> and i dont have a *nix system with which to experiment otherwise <4> and i'm tired, so i'm going to bed. <7> hm <8> Gents, Perl doesn't do: my $t = 'B'; my $u = $t-1; print $u; <8> right ? <7> no <7> would raise a subtraction error <7> what would you be trying to accomplish with that anyway? <7> heh <7> $u, uppercase? would be an offset of 32 - if thats the case at all <8> eh no. <8> just wondering <7> ahh <7> a curiousity, I have lots of those <7> usully random, totally useless things <7> heh <8> me too <8> maybe I'll stitch them all together some day <8> and win a nobel prize =) <8> ( I think not =) <7> lol <8> here's another one. I think the answer is no. <8> there's talk of gravity-lenses, light bending in a strong gravity field. Can you make a gravity prism? <9> I have a terribly written perl script (that I did not write) and i need a config file for. There is no author to contact, there is no doc. on the code, I realize most won't want to help, another script is not a solution as I only have 10k of space to work with, I do no know perl so can't write a script for myself, and examining the code has baffeled everyone I have asked to the point of them wanting to kill its auther. The code i <9> s at http://sial.org/pbot/15805 if any will help figure out the correct format for the config file I would be greatly appriciative. <7> nothing baffling about that <7> nick <7> <a nickname> <7> <- blank line delimiter <7> server <7> server1 <7> servr2 <7> etc.. <7> <- blank line delimiter <7> and so on <7> nick\name are single items <7> channels\servers lists as such <7> just yes.. <7> nick <7> a nickname here.. <7> "" <7> "" as to say nothing, to tell it END OF last header, in this nick <7> name <7> name here.. <7> "" <7> and yea, so on <7> and, were very much correct to refer to it as "terribly written" <9> okay so let me see if I get this <9> its litterally <9> nick <9> somename <9> "" <7> yes <7> well <7> uh <7> "" not in that literal sense
Return to
#perl or Go to some related
logs:
#india #india #chat-world zzzzzzzzzzzzzz _Cyb0rG #allnitecafe #chat-world #kl #india poem beuwulf
|
|