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$/ ){
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
= `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
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
** * * * * * * * * *
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
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
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
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]
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
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]
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
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:
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
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
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
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
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
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
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.
-
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 <
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
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]
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:
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
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
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.
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
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 = ){
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
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
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...
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
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 = ){
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
Thanx boris problem completely solved.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
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;
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
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
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
39 matches
Mail list logo