Perl regular expresions HELP!

2002-02-13 Thread Bruce Ambraal
Please explain to me what this code does, here I'm tying to rename files in current directory to 1.fil, 2.fil, ... foreach my $f ( @files ){ if( $f =~ /private/ ){ next; } chomp $f; $fil{$f} = 0; # if we match the extension... if( $f =~ /\.$extension$/ ){

RE: finding .jpg or any .extention file

2002-02-13 Thread Bruce Ambraal
John This is greater than great... Thinks are getting to hot for me. Thank again, I'll chat to you tomorrow, have to go... In mean time you may think about the this one, and don't tell me you got this one too. Goes like this: 1)Open a file, create if necessary, 2)Prints you name into the file e

RE: finding .jpg or any .extention file

2002-02-13 Thread Bruce Ambraal
= `ls -F`; my @jpegs; my $extension = "jpg"; foreach ( @files ){ next if /private/i; chomp; if(/\.$extension$/){ push(@jpegs, $_); } } foreach (@jpegs) { print "$_\n"; } HTH John -Original Message- From: Bruce A

Help can't figure this one out

2002-02-13 Thread Bruce Ambraal
I have written following coding to produce a triangle pattern(see below); I now want to produce following paterns I can't figer this out (a)(b) (c) (d) diamond ** * * * * * * * * *

Generating for loop paterns HELP!

2002-02-13 Thread Bruce Ambraal
Hi I have done (b) for coding see below, could someone assist with (a) (b) (d) #!/usr/local/bin/perl -w my $num_rows; my $i; my $r; $num_rows = ; for ($r = 1; $r <= $num_rows; $r++) { for ($i=1; $i<= $r; $i++) {print (" \n");} for ($i = $num_rows + 1 - $r;$i>=1; $i--){ pr

Generating for loop paterns HELP!

2002-02-14 Thread Bruce Ambraal
Hi I have done (b) for coding see below, could someone assist with (a) (b) (d) #!/usr/local/bin/perl -w my $num_rows; my $i; my $r; $num_rows = ; for ($r = 1; $r <= $num_rows; $r++) { for ($i=1; $i<= $r; $i++) {print (" \n");} for ($i = $num_rows + 1 - $r;$i>=1; $i--){ pr

Re: Generating for loop paterns HELP!

2002-02-14 Thread Bruce Ambraal
Hi Everyone had to crawl before they could walk, JON, stop being polite and help me I need your assistance now... Cheers Bruce >>> Jon Molin <[EMAIL PROTECTED]> 02/14/02 12:00PM >>> This smells homework! /jon Bruce Ambraal wrote: > > Hi > > I have

Printing data into a file every time some presses HELP!!

2002-02-18 Thread Bruce Ambraal
Hi Could someone help? the following code is not working. open(INPUT_FILE,"+>fixed.dat") || die "Could not open filename"; while () { print INPUT_FILE "bruce\n"; } close(INPUT_FILE); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Fwd: Printing data into a file every time some pressesHELP!!

2002-02-18 Thread Bruce Ambraal
Hi Where's every one? Or maybe our my server's down. Help! Cheers --- Begin Message --- Hi Could someone help? the following code is not working. open(INPUT_FILE,"+>fixed.dat") || die "Could not open filename"; while () { print INPUT_FILE "bruce\n"; } close(INPUT_FILE); -- To unsubscr

What is the value of @_4_[0], and $return_me? (see below)

2002-02-20 Thread Bruce Ambraal
Hi 1. (see subject) 2. Explain lines 3 , 4 3.Why does'nt this coding return anything2 sub routine { my @arr = (0, 'a' 1, 'b'); @_ = @arr; my $retun_me = shift; return( $return_me ) }; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Fwd: What is the value of @_4_[0], and $return_me? (see below)

2002-02-20 Thread Bruce Ambraal
OOPs! I meant Fwd: What is the value of @_$_[0], and $return_me? (see below) --- Begin Message --- Hi 1. (see subject) 2. Explain lines 3 , 4 3.Why does'nt this coding return anything2 sub routine { my @arr = (0, 'a' 1, 'b'); @_ = @arr; my $retun_me = shift; return( $return_me ) }; -- To

Perl subroutines using array & hash????

2002-02-21 Thread Bruce Ambraal
Hi How do you do it Give me two different methods in subroutines, that will: match together all of its parameters into on large list. Many thanks to the following people: Brett, Micheal F, Zentara, Stephen H, Edward) Appreciate all you asistance) Cheers Bruce -- To unsubscribe, e-mail:

Re: Perl subroutines using array & hash????

2002-02-21 Thread Bruce Ambraal
ve problem, let you know about my solution. Cheers Bruce >>> Jon Molin <[EMAIL PROTECTED]> 02/21/02 01:44PM >>> is this homework? Your other posts looks very homeworkish... /jon Bruce Ambraal wrote: > > Hi > > How do you do it > Give me two different me

Adding the input file digits together

2002-03-17 Thread Bruce Ambraal
Hi I am want to add digits in In_digits together. Print total to screen. Could someone help? Thanx Bruce In_digits: 1,200 2,400 #!/usr/bin/perl -w open(INPUT, "In_digits") || die; open(OUTPUT, ">Out_digits") || die; while () { if (/(\d{1})(\,)(\d{3})/) { print OUT

Adding the input file digits together (Come on guys)

2002-03-17 Thread Bruce Ambraal
Hi I am want to add digits in In_digits together. Print total to screen. Could someone help? Thanx Bruce In_digits: 1,200 2,400 #!/usr/bin/perl -w open(INPUT, "In_digits") || die; open(OUTPUT, ">Out_digits") || die; while () { if (/(\d{1})(\,)(\d{3})/) { print OUT

Seach around word text - display totals only!

2002-03-19 Thread Bruce Ambraal
An input data file looks like this: (see below) Description: financial amount Shoes: $110 Car: $3,100 Rates: $0,50 I want to add the total of amount. Also want to add all the totals containing an "s" discription. My problem is basically Searching arround the w

How to handle a currency sign in a calulation

2002-03-21 Thread Bruce Ambraal
The following programs calculates sum totals of the values in file (Values.dat). Values.dat: --- $30,45 $0,50 How do I handle the $ sign infront of the values. I want the $ sign in the result when calulating sum of these values. In my program I left out the $ sign cause I dont kno

Printing frequency of word occurence in paragraph

2002-03-21 Thread Bruce Ambraal
In the program below I don't know when to stop the loop. (CTRL + d ) will just terminate the program, leaving the data via STDIN unattended, this is my problem. Lets define what I want to do: I want to print the frequency of every word at the beginning. and every word at the end of a line. Th

Printing the number of times phone number appear in a textfile

2002-03-22 Thread Bruce Ambraal
Hi all In the program below I am attempting to count the number of times that a phone number(purely digits) occurs in a file of text. I am not succeeding cause i end up counting all the digits of phone numbers that occurs. Could anyone help. -

Script extracting the output from a search engine - Help!

2002-03-23 Thread Bruce Ambraal
In the script below I am trying to to extract the results from performing a search on the word "help" at http://srch.overture.com Running the script produce lots of errors. What am I doing wrong, is my rules correct. Help #!/usr/bin/perl - strict open(A_file,""); my@ary = ; while($n <

A script to understand the output from a search engine HELP!!

2002-03-23 Thread Bruce Ambraal
Hi all, Part I If you get the script below to work then it needs to be modified: I have pulled the seach.html file as follows: I went to link http://srch.overture.com) then search for word "help", then I save the result as file named search.html Then I wrote the script below to extract and find

The LinkExtor.pm module

2002-03-24 Thread Bruce Ambraal
Hi friends I call you all friend because I am very impress with the way in which you are guiding me. Indeed I want to locate the LinkExtor.pm module. Cheers Bruce -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

The LinkExtor.pm module (Wow! its very quiet in here) Anybodyout there!!!

2002-03-24 Thread Bruce Ambraal
Hi friends I call you all friend because I am very impress with the way in which you are guiding me. Indeed I want to locate the LinkExtor.pm module. Cheers Bruce -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail:

Table for message board server to save/delete/update messages

2002-03-27 Thread Bruce Ambraal
Hi all Am I on the write track, else assist. boris this is where I'm at currently: Could you assist #!/usr/local/bin/perl use DBI; my $dbname = 'Bruce'; my $dbhostname = 'localhost'; my $user = 'root'; my $password = '' ; CREATE TABLE employee_Info ( primary_key INT AUTO_INCR

Creating table for message board server tosave/delete/update messages

2002-03-27 Thread Bruce Ambraal
Hi All I need some one to comment on the program below With the code below I am trying to design a table that allows a simple message board server to: 1) Save a message, 2) delete a message, 3) update a message The password + username must be saved in the same table entry, and compare it when

Read in from STDIN

2002-04-04 Thread Bruce Ambraal
Please help with following: Using a while loop I want to do the following: Read info in from STDIN Read in any number of name/value pairs, Read in names in pairs of two, and compute their sum. Choose the maximum of all those pairs and print it. At the same time choose the minimum and print it.

Opens / create file if necessary

2002-04-04 Thread Bruce Ambraal
Could you help I am not doing what I'm surpose to With the code below I'm trying to do the following: -Open a file, creating it if necessary -Print a name in file every time someone presses "enter" -Print a new line -Seek to the begining of file without closing file -and print the file to STDO

Split input on whitespaces - Another approach

2002-04-04 Thread Bruce Ambraal
Hi all My code below does the following : - Reads from STDIN - Splits the input on whitespace - And prints the frequency of terms, with each term printed next to its frequency on STDOUT. I need another approach (code) to do the same things #!/usr/bin/perl -w my %freq; while( my $line = ){

find files with .jpg extensions in directories

2002-04-04 Thread Bruce Ambraal
Hi John Seems you're the only one around here. also the prev solution(RE: Opens / create file if necessary) just worked fine. Help I'm struggling to have these two pieces of codes do what I want it to do With code (1) I'm trying to recursively decends into directories to find all the files th

Fwd: Split input on whitespace

2002-04-04 Thread Bruce Ambraal
Could you help me... With the code below (see attached) I tried to do following: Read from STDIN, splits the input in whitespace, and prints the frequency of terms, with each term printed next to its frequency on STDOUT. --- Begin Message --- Why does my code not write the splitted words t

RE: Split input on whitespace

2002-04-04 Thread Bruce Ambraal
ly, you don't need the if() statement by the increment. -Original Message- From: Bruce Ambraal [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 3:00 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Fwd: Split input on whitespace Could you help me...

Spit the input in whitespace

2002-04-04 Thread Bruce Ambraal
One last request please run the code below and see whether it does the following With the code below (see attached) I tried to do following: Read from STDIN, splits the input in whitespace, and prints the frequency of terms, with each term printed next to its frequency on STDOUT. According

Split input on whitespaces - Another approach - Co m e o n g u y s

2002-04-04 Thread Bruce Ambraal
Hi all My code below does the following : - Reads from STDIN - Splits the input on whitespace - And prints the frequency of terms, with each term printed next to its frequency on STDOUT. I need another approach (code) to do the same things #!/usr/bin/perl -w my %freq; while( my $line = ){

Read from STDIN

2002-04-04 Thread Bruce Ambraal
Anyone's free to assist Part 1 is already done just need assistance for part (2-4) See below provided test data aswell 1)Read in any number of name/value pairs, 2)Read in names in pairs of two, and compute their sum. 3)Choose the maximum of all those pairs and print it. 4)At the same time ch

Re: Read from STDIN

2002-04-04 Thread Bruce Ambraal
Thanx boris problem completely solved. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Split input on whitespace

2002-04-04 Thread Bruce Ambraal
Why does my code not write the splitted words to STDOUT? #!/usr/bin/perl -w open (OUTPUT, ">ex92.out")||die; my %freq; while (my $line = ) { foreach my $w ( split( /\s+/, $line ) ){ if( exists $freq{$w} ){ $freq{$w}++; }else{ $freq{$w} = 1;

Thanks alot Boris

2002-04-26 Thread Bruce Ambraal
Hi Boris I see you are still around. Well I just want to take the oportunity in thanking you for all the help that you have given me I really appreciate it. Go well. Psst! Boris is the man of the hour with more power. Cheers Bruce -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

HELP! : To write a script that reads numbers from STDIN andprint on STDOUT.

2002-02-07 Thread Bruce Ambraal
Hi ALL Could any one write some coding for the following problem. In perl against Linx could someone help. --- I want to write a script that reads in four numbers from STDIN and add t

RE: To write a script that reads numbers from STDIN and printonSTDOUT.

2002-02-11 Thread Bruce Ambraal
Hi Stephen thanks a million, I cross referenced the program and clearly it make in deed sense. I have done the second part myself. ANYONE please assist and check whether the following code will work. The problem gets defined as follows. To write a script to read a name, and then the number