Forum: MySQL Jun 10th, 2008 |
| Replies: 1 Views: 438 Right Forum? I have just started using DB2 and have been re-introduced to SQL. I want to make sure I post in the right forum with some questions regarding SQL and some basic scripts I have been given - please,... |
Forum: Perl May 15th, 2008 |
| Replies: 14 Views: 1,114 Re: Is Perl Dead? I've just started learning/using Perl. My understanding is that it is very helpful for text mining. The books I have used in text mining class refer to Perl but not sure if that's the author's... |
Forum: Perl Apr 17th, 2008 |
| Replies: 5 Views: 1,178 Re: Can Array Name have Variable? Thanks katharnakh.
I am running into an issue with using the strict pragma. I 'Use strict' to start and define my arrays as:
my (@array1, @array2, @array3, @array4);
I am using strict since this... |
Forum: Perl Apr 16th, 2008 |
| Replies: 5 Views: 1,178 Can Array Name have Variable? Here's one I haven't been able to find an answer to. I have 4 arrays:
@array1, @array2, @array3, @array4. I ran code to compare the values of 2 arrays to see number of values in common:
use... |
Forum: Perl Apr 15th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string For anyone that was curious. Here is one way I solved what I was trying to do. I added a new hash in the while loop:
$cnter2{$title}{$_}++ for @line;
This way the title was first. I then added... |
Forum: Perl Apr 14th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string Thanks for clearing that up. I think I'm on the right track. What I want to do is add the total words for each section. I am trying to stay within th loop and do the following
%cntr = (
word1 =>... |
Forum: Perl Apr 14th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string Still learning on my end.
I am reviewing the code and am trying to understand this:
$cnter{$_}{$title}++ for @line;
I see this as a hash, %cnter, being populated . $_ is the word and the $title... |
Forum: Perl Apr 14th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string I did run it and you are right. I was getting zeros. I thought it was because of how I set it up. I corrected it and I am getting the count for the word in the sections. I am looking at now... |
Forum: Perl Apr 13th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string I added some spacing and then decided to add all the words that were in each section. I declared a new variable $count and wanted to add the count being pushed to the end of the @t array. My... |
Forum: Perl Apr 13th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string I tried it as well and the results give the same result of numbers for each word in each section. I think it does have something to do with [$index]. |
Forum: Perl Apr 10th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string I didn't realize the blank lines would create warnings. No more warnings now. In reviewing the script, it looks like a hash of hashes were made. I added (after the 'while' section' and before the... |
Forum: Perl Apr 9th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string Thank you. I updated my script and the output looks good. I did start using the 'warnings' and 'strict' commands as suggested to me in another thread. When I run the updated script I receive an... |
Forum: Perl Apr 8th, 2008 |
| Replies: 6 Views: 779 Re: Question on Creating Hashes Thanks for the advice. I do run the scripts using -w at the command prompt for warnings. I'm still trying to get a handle on 'use strict' and how variables are defined. I know I would use 'my' to... |
Forum: Perl Apr 8th, 2008 |
| Replies: 6 Views: 779 Re: Question on Creating Hashes KevinADC,
Thanks for responding. I thought no one looked at this as I never received a notification. I'll be taking another look at this. Thanks again. |
Forum: Perl Apr 8th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string Below is the code I am working with:
1. use strict;
2.
3. open(FILEIN,'Sample.txt') || die "Can't open OUT file: $!\n";
4. open (FILEOUT, '>SampleOut2.txt') ||die "Can't open OUT file:... |
Forum: Perl Apr 8th, 2008 |
| Replies: 32 Views: 3,820 Re: count characters in a string I have been playing with this. I have tried updating it to count words. When I update the split to /\s+/ I receive an error for an unitialized hash value. How would I correct it? I tried by... |
Forum: Perl Mar 24th, 2008 |
| Replies: 6 Views: 779 Question on Creating Hashes I am very sure the code below can be simplified. The exercise was to take a word list, rearrange each word's letter to be in alpha order (e.g. barter = aberrt). The rearranged letter would be the... |