obtaining a process ID.
Looking for a simple method of getting a single process ID (for a process such as syslogd) and store it in a scalar. I've found a few methods of doing so but they haven't been pretty. I'm taking suggestions :) -gomes -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need help!
I need help with the following assignment. I've got the three words in the first line listed in an array. But I'm stuck here. All I have to do is read the file and print the amount of times each word in the array occurs: this is what I have so far !/usr/bin/perl -w open (INPUTFILE, "inputfile") or die "No input file, I'm going to die now $!\n"; $Line_number = 1; $. = 0; do { $LINE = } until $. eq $Line_number || eof; for ( $LINE ) { ($word1, $word2, $word3) = split ( " ", $LINE); @words = ($word1, $word2, $word3); print "@words\n"; } This should be easy... but I'm stuck Here is the assignment: 2. Write a program that counts all occurrences of 3 words the user wants counted in an input file. The input file consists of line 1 with the 3 words the user wants to be counted separated by a space. The actual input text starts with line 2 of the input file and will contain 0 or more occurrences of the words in line 1. Your program should read the first line and store the 3 words the user input. It should then read each word starting with line 2 and maintain a running count for the 3 words identified in line 1. When your program reaches end of file, it should output the counts for the 3 words. For example, the input file may look like the following: rain water cloudy It was a cloudy day and the sky was overcast with dark ominous clouds. It presently started to rain and the rain water started flowing along the streets. The water from the rains started with a trickle, but quickly developed into a massive torrent flooding all the low level areas of the streets. Your program should output the counts of 2 for rain, 2 for water, and 1 for cloudy.
Re: Sun Sparcstation 20 and Perl?
It definitely depends on price. A sparc 20 isn't even a match for most Pentium IIIs running just about any flavor of UNIX or LINUX. Not to mention, hardware is proprietary (uses S-bus not PCI bus), a special keyboard is needed, and monitor, unless you get a converter. If your not going to use Solaris, I don't see much a point in spending the cash on a Sparc when a PC running LINUX is cheaper and easier to deal with. -bryan PS> Don't get me wrong, I love Sun Sparcs, but I love them running Solaris, and Solaris applications. On Tuesday, September 24, 2002, at 06:39 PM, david wrote: > Kevin Pfeiffer wrote: > >> Sorry to pose a slightly off-topic question... >> >> A colleague has a Sun Sparcstation 20 for sale. He says it will run >> linux. >> I was thinking it might be a good project machine for running an >> Apache >> server, trying out some cgi scripts, Perl, etc. >> >> Any opinions on whether this might be suitable? (ducking and >> promising >> never to ask another hardware question here again). >> >> -Kevin > > ask him how much and if it's reasonable to you. buy it and use it. i > had one > when i was in school. my professor gave it to me but i don't know how > much > those machine cause nowaday. it came with Solaris. i used it to run > Apache. > Perl, C++ etc and it runs great. when the machine finally ran out of > disk, > i gave up on it because i don't know how to change/upgrade to a > bigger/newer disk. i don't know much about the hardware side of the > machine. > > but if you just want to play with Linux,Apache,CGI,Perl etc, it should > have > no problem. > > david > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]