Getting a bit stuck. Would appreciate any help?
Thanks
I have a list of names.
Each name corresponds to a profile on a txt document.
Each txt document profile contains a section called address
I am only interested in those names that are in Texas as well as those specifically in Austin...
use LWP::Simple;
open (HELLO, ">>thanks.txt");
foreach $person (@group) {
my $url = "http:domain/$person.txt";
my $content = get $url;
print HELLO $content;
@group contains list of names.
Hi there. The file from the website contains lots of details but I am just interested in the line that...
What is the last line doing?
I understand the rest?
Where did $families come from?
while(<SARACEN>) {
chomp;
my ($family, $people) = split (/=/, $_);
my @members = (split /,\s*/, $people);
foreach my $member (@members) {
push @{$people{$member}}, $family...
Is there a way to calculate the total number of terms altogether within arrays of a hash. I know I have to divide the following scalar but I can't figure out how to group the total number of "family members" in all the "families" of the hash.
print "$member can be found " ...
Basically my data is subject to change but will follow a format as follows where I will have a unique "Family Name" followed by "--" followed by various "family members". The contents of the data are unknown to me apart from the format: Data is a text file as follows:
FLINTSTONES=BARNEY...
A = 1
A = 2
A = 3
B = 5
B = 1
B = 7
e.t.c
C = .....
Is there a way to convert this format to:
A = 1,2,3
B = 5,1,7
C = ...
.
.
.
Z = ...
I am thinking
while in data file
split each line to letters and numbers.
if next letter matches previous letter push into an array
otherwise create a...
#!/usr/bin/perl
@foo= ("apple","orange","pear","pear","mango","apple");
for (@foo) {
$bar{$_}++;
}
while ( ($k,$v) = each %bar ) {
if ($v =~ 1){
print "$k appears $v time\n";
}
elsif ($v !=~ 1){
print "$k appears $v times\n";
}
}
The above code works nicely with a one column set of...
The 001 element (3 figure configuration is important. Is this possible without having to type out all the numbers?
I have tried @nums = (001 .. 500) with no success.
This is more a thought exrcise than anything as I am trying to understand how Perl interacts with web.
If I have a website with a list of film titles
-each film title when clicked opening upto a new page
--each page contains info about film as well as a link to a text document with the script...
Matching lines in a list?
Title says it all. I know I can do the perl (with lots of research and hard graft!) if I just know how to tackle the dilemma.
If I have a list:
John
Eric
David
Paul
John
Eric
Harris
Eric
[\code]
and I want to print out:
[code]
John 2
David 1
Paul 1
Eric 3
Harris 1...
Hi again. For those who know me you'll be gald to know I solved the other problem.... :)
But, now I have a new one.
However, although the program works this line is giving me errors:
@host = split(';',$guests[0]);
"Use of uninitialised value in split"
What is wrong? I have declared my @host...
I am trying to split files with ';###KW'
(NOT INCLUDING SINGLE QUOTES)
@finalcount = split (';###KW',$secondstring);
Is this right?
(It isn't because I have tried. Why?)
This is related to the following thread but I was told once before that if I have a new query, I should put it in a new thread.
http://www.tek-tips.com/viewthread.cfm?qid=1236725&page=1
I believe I can solve the problem originally posted in the thread above if anyone has any ideas on how I...
Okay this is complex. But, if you have the patience just to nudge me in the right direction. I know I am close...
I have a file. Format of file is:
Line starts with ST: SIGNAL_NAME1, SIGNAL_NAME2
.
.
.
Line starts with YZ: WO RD 1, WO RD 2, WO RD 3, WO RD 4,
Line starts with YZ: WO RD 5, WO...
Hi. I am reading through a file:
A -
B -
C -
D -
E -
F - word; word; word;
F - word; word; finalword;
G -
H -
I am trying to grab the contents in both F lines.
At the moment I've got
#!/usr/bin/perl
foreach $line (@data) {
if ($line =~ /^F/) {
$goodline = $line;
$goodline =~ s/F//g; #take...
This code works without the strict function but I was just wondering can anyone work out why it won't work with the "use strict" function?
#!/perl/bin/perl -w
use CGI;
$query = CGI::new();
$text1=$query ->param("intext");
$pattern=$query ->param("pattern");
print $query ->header();
print...
Hi there. If you can help you are a star.
I want user to:
Enter text into box A
Enter a pattern into box B
Box B is matched against the text in Box A.
Believe it or not, I know how to do the above! But, I am getting stuck on a configuration of this cgi program.
I need to configure the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.