| |
| |
| |
|
Comments:
<0> hi all <0> quick question - <0> in perl will $list give the lenght of a lis @list? <1> no, that#s $#list <1> no, that's $#list <1> and it'll give the scalar value of the last entry - so the length is $#list + 1 <0> hmn ok <0> but $x=@list+1 will give you the lenght also? <0> stored in x
<1> no <1> for that, you'd use: <1> my $x = $#list +1; <0> huh <1> then $x will contain the number of entries in @list <0> im reading this book and it hasnt meantioned the $# at all is that a new feature? <1> no, not at all <1> it mentions scalar values for arrays? <0> yeah <1> well, $#list gives the scalar value of the last entry <0> ok <0> so i could do <0> for($i=0; $i<$listOfWebsites; $i++){ <0> err $#listofwebsites <0> then $x=$#listofwebsites[$i] <0> well $#listofwebsites+1 right <1> yeah <0> cool thanks :) <1> you want it to pull a specific site from a list? <1> how i'd do that would be a foreach loop <0> foreach($#listofwebsites) ?? <1> well, what do you need it to do? <0> open each website and store the information to a file <1> and the sites are stored in an array? <0> yeah @listOfWebsites <0> just as strings to be pased to wget <1> so, you want it to go through the array, and for each and every entry, do something? <0> yes <1> that's even easier <1> do it like this: <1> foreach $site (@listofwebsites){ <1> do whatever you need to do <1> } <1> simple as that <0> ahh and $site will hold each website? <0> thats cool thanks man! <1> yes
<1> no problem <0> hello again <0> how can you look at individual charecters in a string? <2> I need perl to download a text file from a site and save it localy for parseing. anyone have some info that might help? <3> Isn't there a www:get thingy or something? <4> HTTP::Get ? <3> That would be it. <4> IO::Socket <4> is this basically what you want ? http://www.newbie.org/snippets/cgi/content/sockets3.html <3> If he's just getting a text file then HTTP::Get should be fine. <2> i ended up useing LWP:UserAgent <2> $ua->mirror($url); <2> it automaticly compares the dates and only downloads if it's newer <2> so it works perfect for what i'm doing <4> hi <5> hello Mariandroid <5> all ok?? <4> all dandy here, you ? <5> sort of so so <5> home ill... <4> not good. <5> and I get abuse and kicked by ppl for no real good reason...sort of makes ya loose faith in ppl <4> Faith? Oh, I had a girlfriend named Faith. She cheated on me, with a girl named Chastity. <4> *giggle* <5> lol <5> nice point.. <5> I just try to go thru life not making enemies and bein ok with folk...it bugs me when ppl are mean <5> and being female I am naturally disposd to being irritating <4> oh ? <4> I'm just a regular pain in the *** =) <4> *giggle* and I'm singing along with Midge Ure "Breathe" <5> oooh liked Vienna <4> and "Dancing with tears in my eyes" <4> hi <4> -only heaven's silence for an answer- <4> "Mastering regular agression"
Return to
#perl or Go to some related
logs:
cartman sings i'm sailing away mp3
#php #india #kl #kl #php kuttam india #kl #allnitecafe #india
|
|