> 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
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.
> 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
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
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
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 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
> 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
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
___
> 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
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
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
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]
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
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
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
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
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
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
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
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
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_
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
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
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
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
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
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
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
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
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
> 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
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
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
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
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
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
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
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',
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]
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
> 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
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
> 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
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
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
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
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
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
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.
--
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
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
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
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
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
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}
[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
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
(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
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
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
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
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 = ){
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
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;
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
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
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
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()
100 matches
Mail list logo