RE: perl6

2002-04-04 Thread peter grotz
> variable sigils ($@%) are now constant (ie you say >@array[2] instead of $array[2]), the concatenation operator is changing >from '.' to ' - ' (note the whitespace), the member of operator '->' is >changing to '.', and various other small things. what at hell should these changes help us? I´m

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.

RE: perl6

2002-04-04 Thread Jonathan E. Paton
> what at hell should these changes help us? I´m using perl 5.6.1 now for > a long time and I don´t wanna change my kind of writing my progs, only > because some mastermind thinks that he must change the good old!! There are many better changes, including: * Parrot (the interpreter) will be easi

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

RE: Opens / create file if necessary

2002-04-04 Thread John Edwards
Why open the file until enter has been pressed? Try something like this $file = "c:/test.txt"; while (1) { &stuff; } sub stuff { print "Enter some text for the file (q to quit): "; $input = ; print "\n"; exit if $input eq "q\n"; open FILE, ">>$file" or die "Can't appe

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 = ){

mod_perl issues

2002-04-04 Thread Adrian C
Hi everybody, 1) Could anyone share their experience in installing mod_perl on Windows (2000 or any for that matter). I read some stories about bad support for multithreading on winxxx as opposed to Linux etc so I wonder if it's worth considering installation on winxxx, but on the other hand I

Re: Split input on whitespaces - Another approach

2002-04-04 Thread Jonathan E. Paton
> 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. > if( exists $freq{$w} ){ > $freq{$w}++; > }else{ > $freq{$w} = 1; > } Increment is magical, if

Re: Split input on whitespaces - Another approach

2002-04-04 Thread Jonathan E. Paton
Hi again ;) >From subject: Split input on whitespaces - Another approach Code sample: foreach (split /\s+/, $line) { Answering question of subject line: foreach ($line =~ /\s+/g) { Just to make sure you really do have "Another approach"! Jonathan Paton ___

Re: Split input on whitespaces - Another approach (correction)

2002-04-04 Thread Jonathan E. Paton
> Answering question of subject line: > > foreach ($line =~ /\s+/g) { > Correction, \s should be \S Jonathan Paton __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com

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

Re: Perl 6?

2002-04-04 Thread Elias Assmann
On Thu, 4 Apr 2002, Jenda Krynicky wrote: > Ah well ... it will HURT. I'm sure I'll envy the newcomers. Since it'll > take ages to get used to the new $@% meaning and the new > operators. Just out of interest: were the changes between the last Perl versions equally drastic? (I'm thinking of 4->5 o

ActiveState Debugger

2002-04-04 Thread Babichev Dmitry
Hello, beginners. Sorry to trouble you. How i can forbid output of the report on absence licence in the subject? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Find all files that end in .jpg

2002-04-04 Thread Naomi Arries
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 that end in .jpg. With code (2) I'm trying to read in the extentionfrom the command line. ---code(1) - #!/u

Strip Carriage Returns

2002-04-04 Thread Glenn Cannon
Not strictly a perl question, I know, but... I have been writing and testing my perl script on a WinXP box, and I have now moved it to its final home on a linux box. When I run perl -c scriptname, I get the following: Illegal character \015 (carriage return) at index.pl line 2. (Maybe you did

RE: find files with .jpg extensions in directories

2002-04-04 Thread Nikola Janceski
Easy Answer to code (1): If you have Perl 5.6.1 or better, use the File::Find module. > -Original Message- > From: Bruce Ambraal [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 04, 2002 8:49 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: find files with .jpg extensions in dir

RE: find files with .jpg extensions in directories

2002-04-04 Thread John Edwards
Take a look at this code I just found for the directory recursion http://www.geodata.soton.ac.uk/~hrz/personal/perl_scripts/?link=view_source. html&script=recurse.pl For the second question, your until loop quits out as soon as the extension is correct, leaving you with no input data. Try this i

RE: DBI vs. piping query to Mysql

2002-04-04 Thread Job Miller
if this is a single query in a web page, at least he avoids the hassle of trying to install DBI and DBD.. :) we all know how many hundreds of messages we see from people who can't get their DBD drivers to make properly. what kind of overhead does DBI and DBD add to your script in a plain cgi envi

Hash Values (again)

2002-04-04 Thread Allison Ogle
Hi, I have a hash with all the values set to zero. I want to use the filehandle and if the filehandle matches a key in the hash I want to increment the value from zero. Does anyone know how to do this? I'm lost with hashes :( Thanks, Allison -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Strip Carriage Returns

2002-04-04 Thread John Edwards
How did you move the file? File copy? FTP? *nix systems use line feeds at the end of lines in text files. Windows systems use LF\CR. Or the other way round. That's the cause of your problem anyway. One way of solving it is to FTP the file to the box in asci mode, I believe. This might help htt

Re: Strip Carriage Returns

2002-04-04 Thread Elaine -HFB- Ashton
Glenn Cannon [[EMAIL PROTECTED]] quoth: *> *>Illegal character \015 (carriage return) at index.pl line 2. *>(Maybe you didn't strip carriage returns after a network transfer?) *> *>Is there a simple way to prevent/cure this? Several. Most modern Unixes have 'dos2unix' available or you can use P

Re: Find all files that end in .jpg

2002-04-04 Thread Elaine -HFB- Ashton
Naomi Arries [[EMAIL PROTECTED]] quoth: *>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 that end in .jpg. use File::Find; http://www.perlfaq.com/cgi-bin/view?view_by_

Re: Strip Carriage Returns

2002-04-04 Thread Chas Owens
On Thu, 2002-04-04 at 09:05, Glenn Cannon wrote: > Not strictly a perl question, I know, but... > > I have been writing and testing my perl script on a WinXP box, and I > have now moved it to its final home on a linux box. When I run perl -c > scriptname, I get the following: > > Illegal char

Hash Values (again)

2002-04-04 Thread Allison Ogle
Hi, I have a hash with all the values set to zero. I want to use the filehandle and if the filehandle matches a key in the hash I want to increment the value from zero. Does anyone know how to do this? I'm lost with hashes :( Thanks, Allison -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Strip Carriage Returns

2002-04-04 Thread Kevin Hancock
Cure: Make this script on linux box, call it strip-dos, and run it make it executable first ~#chmod 700 strip-dos ~#./strip-dos file-name Creates a file called file-name.stripped so it doesn't mess with the origional. The magic is in the last line, if you want to type command each time just run

Re: Perl 6?

2002-04-04 Thread Chas Owens
On Thu, 2002-04-04 at 08:55, Elias Assmann wrote: > On Thu, 4 Apr 2002, Jenda Krynicky wrote: > > Ah well ... it will HURT. I'm sure I'll envy the newcomers. Since it'll > > take ages to get used to the new $@% meaning and the new > > operators. > Just out of interest: were the changes between the

Re: Split input on whitespaces - Another approach

2002-04-04 Thread Michael Lamertz
This one should be a reply to the original poster, but I already deleted the head of this thread... I just love "modifiers" (perldoc perlsyn)! my %wc; while (<>) { $wc{$_}++ foreach split; } by using perldoc -f split's If EXPR is omitted, splits the $_ string. If PATTE

RE: perl6

2002-04-04 Thread Chas Owens
On Thu, 2002-04-04 at 03:25, peter grotz wrote: > > variable sigils ($@%) are now constant (ie you say > >@array[2] instead of $array[2]), the concatenation operator is > changing > >from '.' to ' - ' (note the whitespace), the member of operator '->' is > > >changing to '.', and various other s

RE: perl6

2002-04-04 Thread Timothy Johnson
At the risk of beating a dead and bloated horse, I have no doubt that I will enjoy and take advantages of the improvements in Perl6, but I still don't see the logic in changing operators. I mean, why make old code unusable? If you can make a Perl5->6 converter, why can't you integrate Perl5 cod

Re: Trying to add things to an array , but it has blank spaces

2002-04-04 Thread Chas Owens
On Wed, 2002-04-03 at 21:25, FLAHERTY, JIM-CONT wrote: > Hello, It seams I am sucessfully adding numbers to my array , but in turn > tey are blank spaces. I need Help > > My code > > > > $dbh =DBI ->connect($data_source, $username, $password) or die "cant connect > to > $data_source : my $db

sort by field

2002-04-04 Thread Bryan R Harris
I'm very much a beginner, I guess, the perldoc page on sort doesn't make much sense to me. I've got a tab-delimited file read into an array, now I want to sort it on the contents of column 3. Could someone point me in the right direction? TIA. - Bryan -- To unsubscribe, e-mail: [EMAIL PR

RE: perl6

2002-04-04 Thread Jonathan E. Paton
> At the risk of beating a dead and bloated horse, I have no doubt that I will > enjoy and take advantages of the improvements in Perl6, but I still don't > see the logic in changing operators. I mean, why make old code unusable? > If you can make a Perl5->6 converter, why can't you integrate Per

problem with javascripts

2002-04-04 Thread senrong
can anyone please tell me why the below javascripts doesn't work. when the correct info is key into the zip code...the page refuse to load the following page. survey part 2 http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd";> http://www.w3.org/1999/xhtml"; lang="en-US">Untitled Document

module / driver install question

2002-04-04 Thread Johnson, Shaunn
Howdy: Silly question time: Running RedHat Linux 2.4.7 rel. 10 and Perl 5.6.1. I think I installed the DBI module correctly and I'd like to use it. But I keep getting errors like: [snip] DBD::Pg installation failed: Can't locate object method "driver" via package "DBD::Pg" [/snip] So my q

FW: Hash Values (again)

2002-04-04 Thread Allison Ogle
Basically I have a hash with keys and all the values of these keys are set to zero. Then I step through my input file with the filehandle and I want to compare the filehandle to all of the keys in the hash. if there is a match, I would like to increment the value. My hash is called %seen. Bel

RE: Hash Values (again)

2002-04-04 Thread Wagner-David
If the key matches, then $MyTotal{$MyFileHandle}++; This will increment $MyTotal by 1 for the key $MyFileHandle. Wags ;) -Original Message- From: Allison Ogle [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 06:59 To: [EMAIL PROTECTED] Subject: Hash

RE: Perl 6?

2002-04-04 Thread Nikola Janceski
I disagree... the changes from Perl 4 to Perl 5.500?? were so much that I did have to re-write almost all my works, (the small ones were spared). The reason why I had to re-write it was that there were some subtle syntax changes, but mainly the functionality added was better the crap that I wrote

converting html to text

2002-04-04 Thread Paul Tremblay
I spent several hours last night trying to convert an html file to text, so that I could include it in an email. Someone from a mailing list sent me a simple perl script, which worked for my purpose. However, this script simply eleminates tables and lists. I am wodering if there isn't a CPAN mo

RE: sort by field

2002-04-04 Thread Wagner-David
Could try something like: #!perl -w my @MyData = (); # # Loading some data # push(@MyData , sprintf "%-s\t%-s\t%-s\t%-s\t%-s\t", 'a', 'b','c', 'd','e'); push(@MyData , sprintf "%-s\t%-s\t%-s\t%-s\t%-s\t", 'b', 'd','d', 'e','f'); push(@MyData , sprintf "%-s\t%-s\t%-s\t%-s\t%-s\t", 'c', 'e',

save button

2002-04-04 Thread Josiah Altschuler
Hi. Does anyone know how to make a save button on a web page so that when a client user clicks on it, a CGI program will send a text file to that client? Thanks, Josiah -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Hash Values (again)

2002-04-04 Thread Tanton Gibbs
You should use strict; That would show you some problems. > #$inputFile="LogFile.dat"; > > # Opening LogFile.dat > #open (INPUT,$inputFile)||die("Can't open datafile: $!"); > > #while(){ This is not necessary...and in fact you skip every other line. The above while loop reads from INPUT and put

RE: Use of unitialized value error.

2002-04-04 Thread Balint, Jess
I added a couple of debug lines and it looks like it is reading past the end of the array. It seems like I forget to add something to say last if( $array_pos == $MAX ); Thanks for the insight! -J-e-s-s- -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, A

Re: FW: Hash Values (again)

2002-04-04 Thread Chas Owens
On Thu, 2002-04-04 at 11:35, Allison Ogle wrote: > > Basically I have a hash with keys and all the values of these keys are set > to zero. Then I step through my input file with the filehandle and I want > to compare the filehandle to all of the keys in the hash. if there is a > match, I would

Re: sort by field

2002-04-04 Thread Elaine -HFB- Ashton
Bryan R Harris [[EMAIL PROTECTED]] quoth: *> *>I'm very much a beginner, I guess, the perldoc page on sort doesn't make *>much sense to me. *> *>I've got a tab-delimited file read into an array, now I want to sort it on *>the contents of column 3. Could someone point me in the right direction? h

RE: sort by field

2002-04-04 Thread Timothy Johnson
Well, you could try something like this. I stored the file as an array of arrays: use strict; open(INFILE,"test.tab"); my @temp; my @sort; my @infile; my $count = 0; while(){ chomp $_; print "$_\n"; my $temp; @{$temp} = split /\t/,$_; push @infile,$tem

Re: converting html to text

2002-04-04 Thread Agustin Rivera
Are you looking to keep the basic formatting of the HTML in tact during the conversion, or just want the HTML stripped? I wouldn't imagine that it would be that hard to convert the HTML to text if the HTML wasn't overly complicated. Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com

Re: module / driver install question

2002-04-04 Thread Agustin Rivera
Do you have the postgres shared libs installed? I believe it's dependent on that being present. That's just my guess. Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com - Original Message - From: "Johnson, Shaunn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday

RE: Hash Values (again)

2002-04-04 Thread Mark Anderson
Hope this helps. I made a lot of changes, and I didn't comment them all. I'm not sure where/how you sent this to the list, but I'm responding back to the beginners list. Don't crosspost between lists if you can help it. /\/\ark # warnings and strict help you

Re: module / driver install question

2002-04-04 Thread Elaine -HFB- Ashton
Johnson, Shaunn [[EMAIL PROTECTED]] quoth: *>Anyway ... how can I tell if the driver is installed? *>Also, why am I getting this error? perl -MDBI -e 'print "$DBI::VERSION\n"' perl -MDBD::PG -e 'print $DBD::PG::VERSION\n"' If you don't get a version number, it isn't installed. You also have to

RE: perl6

2002-04-04 Thread Chas Owens
On Thu, 2002-04-04 at 10:39, Timothy Johnson wrote: > > At the risk of beating a dead and bloated horse, I have no doubt that I will > enjoy and take advantages of the improvements in Perl6, but I still don't > see the logic in changing operators. I mean, why make old code unusable? > If you ca

Re: converting html to text

2002-04-04 Thread Elaine -HFB- Ashton
Paul Tremblay [[EMAIL PROTECTED]] quoth: *> *>I am wodering if there isn't a CPAN module already written. *>Converting html to text seems like such a common task, that there *>ought to be some robust scripts out there. Interestingly enough, *>I found many scripts to convert html to rtf and LaTeX a

Re: perl6

2002-04-04 Thread Elaine -HFB- Ashton
Timothy Johnson [[EMAIL PROTECTED]] quoth: *> *>At the risk of beating a dead and bloated horse, I have no doubt that I will *>enjoy and take advantages of the improvements in Perl6, but I still don't *>see the logic in changing operators. I mean, why make old code unusable? *>If you can make a

RE: Perl 6?

2002-04-04 Thread Chas Owens
On Thu, 2002-04-04 at 12:06, Nikola Janceski wrote: > I disagree... the changes from Perl 4 to Perl 5.500?? were so much that I > did have to re-write almost all my works, (the small ones were spared). The > reason why I had to re-write it was that there were some subtle syntax > changes, but main

Re: converting html to text

2002-04-04 Thread tom poe
Hi, elaine: Did you skip a step? How do we get from convert HTML to HTML-Format / distribution? Now, that secret is as good as the one about Life?! Thanks, Tom On Thursday 04 April 2002 10:52, Elaine -HFB- Ashton wrote: > Paul Tremblay [[EMAIL PROTECTED]] quoth: > *> > *>I am wodering if

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

2002-04-04 Thread Jonathan E. Paton
Hi, New subject line: Re: Split input on whitespaces - Another approach - Co m e o n g u y s Comment: As far as I know, we've answered your question. Unless you wish to provide us with more detail, I'm only training to use my ESP abilities - not a master yet. That monstrosity now appe

RE: problem with javascripts

2002-04-04 Thread Timothy Johnson
Offhand I'd have to say the problem with javascripts is that they're written in java. -Original Message- From: senrong [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 8:06 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: problem with javascripts can anyone please tell

Filehandle = blank line???

2002-04-04 Thread Michael Stearman
Hello all, I am stepping through an input file using the filehandle and I need to do an if statement which recognizes whether the filehandle is a blank line. In other words, what I want to do is if ($_ eq 'blank line') { ... } And I was wondering what I use to represent blank line. Than

RE: Filehandle = blank line???

2002-04-04 Thread Timothy Johnson
Maybe if($_ =~ /^\s+$/){ do something... } -Original Message- From: Michael Stearman [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 12:46 PM To: [EMAIL PROTECTED] Subject: Filehandle = blank line??? Hello all, I am stepping through an input file using the

RE: Filehandle = blank line???

2002-04-04 Thread Nikola Janceski
he might have chomp it... safer would be: if($_ =~ /^\s*$/){ } shorter would be: if(/^\s*$/){ } > -Original Message- > From: Timothy Johnson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 04, 2002 3:42 PM > To: 'Michael Stearman'; [EMAIL PROTECTED] > Subject: RE: Fil

Re: problem with javascripts

2002-04-04 Thread Thomas S. Dixon
Actually, the problem with javascripts is that their written in javascript. Java has its own problems. -Tommy - Thomas S. Dixon Applications Analyst II Pediatric Cardiology Medical University of South Carolina Timothy Johnson wrote: > Offhand I'd have to say the problem with javas

RE: problem with javascripts

2002-04-04 Thread Timothy Johnson
Good point. The second part of my point is that I and many of the people on this list won't know the answer since it's a Perl list. -Original Message- From: Thomas S. Dixon [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 12:52 PM To: [EMAIL PROTECTED] Subject: Re: problem with

Install question XML::SimpleObject

2002-04-04 Thread Stout, Joel R
I have XML::SimpleObject in one of my scripts. At that time it required XML::Parser, which is fine because XML::Parser comes with ActiveState so I'm cool. It was installed some time ago and runs great. But now I'm setting up another machine. When I try to install XML::SimpleObject it says: Ch

RE: converting html to text

2002-04-04 Thread murphy, daniel (BMC Eng)
Just did this with the help of "Perl Cookbook" (this book is great). Chapter 20.6 Extracting or Removing HTML tags use HTML::Parse; use HTML::FormatText; $plain_text = HTML::FormatText->new->format(parse_html($html_text)); Dan Murphy [EMAIL PROTECTED] EMC Corp.

RE: Filehandle = blank line???

2002-04-04 Thread Allison Ogle
I will actually be storing the filehandle as a variable and then comparing it. Something like = $word; chomp $word; if ($word eq 'blank line') { ... } how would I use your suggestion in this case? if ($word=~ /^\s*$/) doesn't seem to work. -Original Message- From: Nikola Jancesk

Re: Filehandle = blank line???

2002-04-04 Thread bob ackerman
perhaps: $word=; instead of the other way around. On Thursday, April 4, 2002, at 01:26 PM, Allison Ogle wrote: > > I will actually be storing the filehandle as a variable and then comparing > it. Something like > > = $word; > chomp $word; > if ($word eq 'blank line') { > ... } > how would

RE: Filehandle = blank line???

2002-04-04 Thread Timothy Johnson
Ok, I guess I misunderstood the question, and maybe I still do. As I understand it, what you are saying with ' = $word;' is "Store the value of $word into the default variable that results from reading the next line from FILEHANDLE", or something like that. Did you mean '$word = ;'? -Origi

Mod_Perl in Win2k/Apache-- Beginner

2002-04-04 Thread RArul
Could somebody posit to any resource, on writing a simple Database Accessing Webpage written in MOD_PERL? I am just whetting my feet on mod_perl and I just installed Apache 1.3 on W2K and have got mod_perl binary installed too. Thanks, Rex

RE: Filehandle = blank line???

2002-04-04 Thread Allison Ogle
I did mean $word=. It was just written wrong in the e-mail. Sorry about that. -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 4:25 PM To: 'Allison Ogle'; Nikola Janceski; a a Subject: RE: Filehandle = blank line??? Ok, I guess I misun

RE: Filehandle = blank line???

2002-04-04 Thread Timothy Johnson
Hmm. I'm not sure. Maybe if you post a little more of your code? $_ =~ /^\s*$/ should match any line where there are only whitespace characters or no characters at all. -Original Message- From: Allison Ogle [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 1:35 PM To: Timothy

RE: Filehandle = blank line???

2002-04-04 Thread Allison Ogle
My code so far... $word = ; chomp $word; if ($word=~ /^\s+$/){ print "There is no word."; } -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 4:30 PM To: 'Allison Ogle'; Timothy Johnson; Nikola Janceski; a a Subject: RE: Filehandl

PERL Modules

2002-04-04 Thread Newman, Perry N
> I have been trying to find 3 specific modules for Perl 5.004 and > cannot find them on CPAN. I've searched, read the FAQS, and searched some > more, all with no luck. It's possible, of course, that I missed > something. Didn't you use to be able to find individual modules for > download

RE: Filehandle = blank line???

2002-04-04 Thread Timothy Johnson
That's where the \s* instead of \s+ comes in. \s+ assumes that there will be at least one character, but if you chomp and the only character on the line was a \n, then it will fail because there are no characters on the line anymore. -Original Message- From: Allison Ogle [mailto:[EMAIL

Re: PERL Modules

2002-04-04 Thread Jonathan E. Paton
> something. Didn't you use to be able to find individual modules for > download on CPAN without having to download an entire version of Perl? search.cpan.org, look on LHS. > I'm specifically looking for the Fcntl, POSIX, and Socket modules, > but it appears that you can only get those modules

RE: Filehandle = blank line???

2002-04-04 Thread Allison Ogle
Thanks,it finally worked. -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 4:52 PM To: 'Allison Ogle'; Timothy Johnson; Nikola Janceski; a a Subject: RE: Filehandle = blank line??? That's where the \s* instead of \s+ comes in. \s+ assu

RE: Split input on whitespace

2002-04-04 Thread Mark Anderson
The only thing that you are sending to STDOUT is a "\n" for each line of your STDIN. /\/\ark Please don't cross-post. -Original Message- From: Bruce Ambraal [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 2:43 PM To: [EMAIL PROTECTED]; [EMAIL PR

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 Mark Anderson
No, you are printing to OUTFILE, which directs the output to "ex92.out". /\/\ark -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

RE: Split input on whitespace

2002-04-04 Thread Timothy Johnson
Add a line like this: print "$k $freq{$k}\n"; After this line: print OUTPUT "$k $freq{$k}\n"; BTW: Seriously, 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 PROTE

RE: Split input on whitespace

2002-04-04 Thread Bruce Ambraal
This is not working I tried it my output file is still empty. >>> "Timothy Johnson" <[EMAIL PROTECTED]> 04/05/02 12:58AM >>> Add a line like this: print "$k $freq{$k}\n"; After this line: print OUTPUT "$k $freq{$k}\n"; BTW: Seriously, you don't need the if() statement by the increment. --

upgrade to at least 5.6.1 was Re: PERL Modules

2002-04-04 Thread drieux
On Thursday, April 4, 2002, at 02:03 , Jonathan E. Paton wrote: [..] > You *could* download Perl 5.6, and transplant them... and fix the minor > problem that OO wasn't properly implemented until 5.005_03. Honestly, > upgrade to 5.6 something, or even 5.8 (is it out yet?) - even if you > have to

Re: perl executable

2002-04-04 Thread drieux
On Wednesday, April 3, 2002, at 12:27 , Mayank Ahuja wrote: [..] > Is there a way in which the whole code can be > converged to one executble file so that we do not need to ship all the > files to the user? [..] May I recommend that it is often easier to deliver one tarball of many things - with

Re: converting html to text

2002-04-04 Thread drieux
On Thursday, April 4, 2002, at 12:12 , tom poe wrote: [..] >> >> That's what the search engine is for >> >> http://search.cpan.org/search?dist=HTML-Format >> >> e. worth remembering is also that this will require the Font-AFM distribution. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL P

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

RE: Spit the input in whitespace

2002-04-04 Thread Wagner-David
Running under w2k as build 623 5.6.0 and did what you wanted. Wags ;) -Original Message- From: Bruce Ambraal [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 16:59 To: [EMAIL PROTECTED] Subject: Spit the input in whitespace One last request please run the code below a

Re: Hash Values (again)

2002-04-04 Thread John W. Krahn
Allison Ogle wrote: > > Hi, Hello, > I have a hash with all the values set to zero. I want to use the filehandle > and if the filehandle matches a key in the hash I want to increment the > value from zero. Does anyone know how to do this? I'm lost with hashes :( > Thanks, $hash{$filehandle}

Re: Filehandle = blank line???

2002-04-04 Thread John W. Krahn
[Please don't top-post] [154 lines removed from end of message] Allison Ogle wrote: > > My code so far... > > $word = ; > chomp $word; > if ($word=~ /^\s+$/){ > print "There is no word."; } chomp( my $word = ); print "There is no word." unless $word =~ /\S/; John -- use Perl; pro

perl

2002-04-04 Thread Schelstraete Bart
Hello, Can somebody tell me if it's possible: a) to count all the files in a directory , with extension 'msg' with perl b) Can perl calculate the total size of those files? rgrds, Bart -- Schelstraete Bart Unix/Netscape Administrator [EMAIL PROTECTED] * 'Linux is obsolete' * s

perl

2002-04-04 Thread Schelstraete Bart
(sorry, my previous message was signed, which can give some problems) Hello, Can somebody tell me if it's possible: a) to count all the files in a directory , with extension 'msg' with perl b) Can perl calculate the total size of those files? rgrds, Bart -- Schelstraete Bart Unix/N

RE: perl

2002-04-04 Thread Michael Gargiullo
yes perldoc stat -Original Message- From: Schelstraete Bart [mailto:[EMAIL PROTECTED]] Sent: Friday, April 05, 2002 12:15 AM To: [EMAIL PROTECTED] Subject: perl Hello, Can somebody tell me if it's possible: a) to count all the files in a directory , with extension 'msg' with perl b) C

Re: converting html to text

2002-04-04 Thread Paul Tremblay
On Thu, Apr 04, 2002 at 10:36:36AM -0800, Agustin Rivera wrote: > > Are you looking to keep the basic formatting of the HTML in tact during the > conversion, or just want the HTML stripped? I wouldn't imagine that it > would be that hard to convert the HTML to text if the HTML wasn't overly > c

Re: perl

2002-04-04 Thread Sudarsan Raghavan
Schelstraete Bart wrote: > (sorry, my previous message was signed, which can give some problems) > > Hello, > > Can somebody tell me if it's possible: > a) to count all the files in a directory , with extension 'msg' with perl Check out the glob operator of perl (perldoc -f glob or perldoc F

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 = ){

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

2002-04-04 Thread Chas Owens
On Thu, 2002-04-04 at 15:01, Bruce Ambraal wrote: > 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

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;

RE: Split input on whitespace

2002-04-04 Thread Timothy Johnson
Because you don't have any print statements to STDOUT? -Original Message- From: Bruce Ambraal [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 04, 2002 2:43 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Split input on whitespace Why does my code not write the splitted words to

Arguments

2002-04-04 Thread Michael Gargiullo
I have a bit of code thats throwing errors. "Use of uninitialized value..." #!/usr/bin/perl -w my $setup=0; while ($ARGV[0] =~ /^\-/) { if ($ARGV[0] eq '-s') { $setup = 1; shift; } } the code is basicly this at this point. I run it like so: #>./graboptions.pl

Re: Arguments

2002-04-04 Thread Sudarsan Raghavan
Michael Gargiullo wrote: > I have a bit of code thats throwing errors. "Use of uninitialized value..." > > > #!/usr/bin/perl -w > my $setup=0; > while ($ARGV[0] =~ /^\-/) { > if ($ARGV[0] eq '-s') { >$setup = 1; > shift; The shift here removes $ARGV[0] from

Re: use of HTML::Parser, HTML::FormatText

2002-04-04 Thread M z
drieux I don't think I'm using this right...can you help when I tried this little snippet on a basic html page #!C:/perl/bin -w use HTML::Tree; use HTML::Tagset; print "which one?: "; chomp($in = ); open(X, "<$in") || die "can't read this! ($!)"; open(X1, ">wow"); $tree = HTML::Tree->new()

  1   2   >