[10875] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4476 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 22 02:07:22 1998

Date: Mon, 21 Dec 98 23:00:24 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 21 Dec 1998     Volume: 8 Number: 4476

Today's topics:
        Basic Pattern Matching Question <tcural@yahoo.com>
    Re: Basic Pattern Matching Question (Martien Verbruggen)
        Can Perl provide Contextual Menus??? (Bob Smith)
    Re: Can Perl provide Contextual Menus??? <jamesht@idt.net>
    Re: check mail with perl (Clay Irving)
    Re: explain an hash assignment: $hash{'key'}++ (Tad McClellan)
    Re: explain an hash assignment: $hash{'key'}++ <rakesh_puthalath@hotmail.com>
    Re: explain an hash assignment: $hash{'key'}++ (Martien Verbruggen)
    Re: It's about time (Clay Irving)
    Re: Mac, Perl, uploading, help! (Ronald J Kimball)
    Re: Meaning of comp-generated statement -- amended (Ronald J Kimball)
        Net::FTP and hash printing <kin@symmetrycomm.com>
        newbie: cannot grab a webpage with frame <bl@dcs.ed.ac.uk>
    Re: One Level, Two Level, Blue Level, Purple Level beable@my-dejanews.com
        Perl and WIN98 ActiveDesktop? <bradnix@geocities.com>
        question on <> operator optiknerv1138@yahoo.com
    Re: reading form files <peter@berghold.net>
    Re: replace single quote to double quote with an exampl (Tad McClellan)
        Reversed hash is truncated <nospam_gwynne@utkux.utk.edu>
    Re: running perl commands in background <peter@berghold.net>
    Re: shift. <aqumsieh@matrox.com>
    Re: Text::Parser (Clay Irving)
    Re: what's wrong with this bit of code? :) (Tad McClellan)
        Why does my browser try to download the script instead  (Worldmall)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 21 Dec 1998 18:47:28 -0800
From: Tim Ural <tcural@yahoo.com>
Subject: Basic Pattern Matching Question
Message-Id: <367F0840.740DABA4@yahoo.com>


Greetings,

Mission:   I am trying to get the contents of a given directory and then
find all the subdirectories
that contain any of the days month of the year. I then change to the
given directories and
get total disk space they occupy.

Problem: The output is fine EXCEPT  I get some of the directories
repeating twice.

i.e.
/dir/Apr15: 8963488  .
/dir/Apr29: 8612896  .
/dir/Apr29: 8612896  .
/dir/Apr29: 8612896  .

Any help would be greatly appreciated.

@fs=('/dir');


$| = 1;

open(STDOUT,">$temp") || die "Can't write to stdout:$!";

for $fs (@fs){
        opendir(DIR,"$fs") || die "Can't open: $!\n";
        @parentfiles=readdir(DIR);
        chomp(@parentfiles);
        closedir(DIR);
                foreach $file (@parentfiles) {
                       if ($file =~ /^Jan/ || $file =~ /^Feb/ || $file
=~ /^Mar/ || $file =~ /^Apr/ || $file =~ /^May/ || $fil
e =~ /^Jun/ || $file =~ /^Jul/ || $file =~ /^Aug/ || $file =~ /^Sep/ ||
$file =~ /^Oct/ || $file =~ /^Nov/ || $file =~ /^Dec/)
 {
                                chdir "$fs$file";
                                $area=`pwd`;chomp($area);
                                $space=`du -sdk`;chomp($space);
                                print "$area: $space\n";
                        }
                }
}


Best Wishes and Happy Holidays!!

Tim

tcural@yahoo.com



------------------------------

Date: Tue, 22 Dec 1998 05:47:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Basic Pattern Matching Question
Message-Id: <wnGf2.52$s7.1325@nsw.nnrp.telstra.net>

In article <367F0840.740DABA4@yahoo.com>,
	Tim Ural <tcural@yahoo.com> writes:
> 
> Greetings,
> 
> Mission:   I am trying to get the contents of a given directory and then
> find all the subdirectories
> that contain any of the days month of the year. I then change to the
> given directories and
> get total disk space they occupy.

There is no need to change to those directories to read them. It is
actually adviseable to not do that, and just use the full path. That
saves you the trouble of having to check whether a chdir was
successful.

> Problem: The output is fine EXCEPT  I get some of the directories
> repeating twice.

odd.

> @fs=('/dir');

Does this mean you may have more than one directory?

Did you use -w? and use strict? Both are very useful.

> for $fs (@fs){
>         opendir(DIR,"$fs") || die "Can't open: $!\n";

unnecessary quotes around $fs
If you leave off the \n at the end of the die message, you'll also get
the line number of the error

>         @parentfiles=readdir(DIR);
>         chomp(@parentfiles);

This isn't necessary

>         closedir(DIR);
>                 foreach $file (@parentfiles) {
>                        if ($file =~ /^Jan/ || $file =~ /^Feb/ || $file
> =~ /^Mar/ || $file =~ /^Apr/ || $file =~ /^May/ || $fil
> e =~ /^Jun/ || $file =~ /^Jul/ || $file =~ /^Aug/ || $file =~ /^Sep/ ||
> $file =~ /^Oct/ || $file =~ /^Nov/ || $file =~ /^Dec/)

Ack. Gets a bit unreadable, not?
Besides that, you could have put this whole regex thing in a grep
before the readdir above.

>  {
>                                 chdir "$fs$file";

You really should check to see if this was successful.

besides, A $file will just have the filename in it, and $fs doesn't
end in a '/', so you'll end up with paths like '/fsJanblablabla'. Not
what you want?

Besides that, du takes a directory as argument (on all the systems I
ever worked on), so there's no need to change to it.

>                                 $area=`pwd`;chomp($area);

Unneccesary call to external program, unportable. use Cwd's functions
for this.

>                                 $space=`du -sdk`;chomp($space);

Unportable call to external program :)

>                                 print "$area: $space\n";

I'd probably write this more or less like this:

#!/usr/local/bin/perl5.00404 -w
use strict;

my @fs = qw( /dir );

foreach my $dir (@fs)
{
	opendir(DIR, $dir) || die "Couldn't opendir $dir: $!";

	# We only want files starting with a month shortname
	my @subdirs = grep {
		/^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/
	} readdir(DIR);

	closedir(DIR);

	foreach my $subdir (@subdirs)
	{
		# Unportable call to du

		# I always use the full path to these thingies. The person
		# executing the perl script may be using a different path,
		# and therefore may find another du, which possibly doesn't 
		# understand the -d flag (This is what can happen on 
		# e.g. Solaris, which comes with three versions of du)

		my $space = `/usr/bin/du -sdk $dir/$subdir`;

		# You may want to check for errors here

		chomp($space);

		print "$dir/$subdir: $space\n";

		# we could leave the chomp($space) out, as well 
		# as the \n in the print

		# My du outputs the directory name as well as the size, 
		# so I would probably have split the output of du as well
		# That's what I mean with unportable. You can't even rely
		# on two unices to do it the same way. I'd probably roll
		# my own stuff based on File::Find
	}
}


The above compiles ok, but there may be a runtime error (it worked on
a test directory I created). You'll be able to twiddle it enough to
make it work. As you can see, there is no necessity to do any chdir or
pwd, because you already have all the information you need.

Of course, you are free to use your own code, but I sort of prefer
mine, and it would be odd if I wouldn't :)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


------------------------------

Date: Mon, 21 Dec 1998 21:34:06 -0500
From: bob@digital-design-group.com (Bob Smith)
Subject: Can Perl provide Contextual Menus???
Message-Id: <bob-2112982134070001@ip153.philadelphia9.pa.pub-ip.psi.net>



I have a need for sorting through about 2000 items on a web site. They are
divided into about 100 categories. I would like the visitor to be able to
choose a category with the first drop menu, and then choose a sub-category
from a second menu, the values of which would be dependent upon the choice
made in the first.

Whew.... sounds confusing. Hopefully I've explained myself well enough. Is
this a job for Perl or should I look elsewhere? If so, where? Java,
Javascript, etc...


thanks in advance,

bob

-- 

- 
   
+++++++++++++++++++++++++++++++++++++++++++++++++++++
                                                     
       D.I.G.I.T.A.L   D.E.S.I.G.N   G.R.O.U.P       
                                                     
 Web Page Design, Hosting, and Maintenance Solutions 
P.O. Box 265  Linwood, NJ  08221-1899  (609) 926-5501
                                                     
        Website: www.digital-design-group.com        
        E-mail: info@digital-design-group.com        
                                                     
+++++++++++++++++++++++++++++++++++++++++++++++++++++



------------------------------

Date: Tue, 22 Dec 1998 00:48:26 -0500
From: jamesht <jamesht@idt.net>
To: Bob Smith <bob@digital-design-group.com>
Subject: Re: Can Perl provide Contextual Menus???
Message-Id: <367F32AA.4013F1D7@idt.net>

Hello,

This person wrote one of these, and I think has either published it somewhere
or is willing to share it.

boris@feldmangroup.com

Good luck,

James



------------------------------

Date: 21 Dec 1998 21:26:25 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: check mail with perl
Message-Id: <75n00h$o2e@panix.com>

In <9dsf2.1784$t85.14440@news1.cityweb.de> "Patrick Schnorbus" <webmaster@gigagames.de> writes:

>how can i get mail from a POP3 account with Perl?

perl -M CPAN -e shell

cpan> m /POP/
Module          Mail::POP3Client (SDOWD/POP3Client-1.19.tar.gz)
Module          Net::POP3       (GBARR/libnet-1.0606.tar.gz)
Module          QPopupMenu      (AWIN/PerlQt-1.06.tar.gz)
Module          URI::pop        (GAAS/URI-1.00.tar.gz)

There are at least two Perl modules that may help you.

-- 
Clay Irving
clay@panix.com


------------------------------

Date: Mon, 21 Dec 1998 20:58:20 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: explain an hash assignment: $hash{'key'}++
Message-Id: <cs1n57.j71.ln@magna.metronet.com>

Tk Soh (r28629@email.sps.mot.com) wrote:
: Tad McClellan wrote:
: > 
: > Xah Lee (xah@web-central.net) wrote:
: > 
: > : Can anyone explain how constructs like $hh{'ss'}++ works? Here's an example:
: > 
: >    That works just like (assuming $hh{'ss'} contains a number):
:                            ^^^^^^^^                      ^^^^^^
: I think someone will ask: 

:      what if it's not a number? ;-)


   Then you might get magic auto-increment, as other followups
   have pointed out  ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 22 Dec 1998 13:39:24 +0800
From: Rakesh Puthalath <rakesh_puthalath@hotmail.com>
Subject: Re: explain an hash assignment: $hash{'key'}++
Message-Id: <367F308B.73D9CC9E@hotmail.com>

It's just another way for denoting an existence of a key.

Xah Lee wrote:

> Can anyone explain how constructs like $hh{'ss'}++ works? Here's an example:
>
> #!/usr/bin/perl -w
> use strict;
> use Data::Dumper; $Data::Dumper::Indent = 0;
>
> my %hh;
> $hh{'ss'}++;
> print Dumper(\%hh);
> __END__
>
> The above prints $VAR1 = {'ss' => 1};
>
> This question originates from L. Stein's CGI.pm book page 71, line 14.
>
> Thanks.
>
> Xah
> xah@best.com
> http://www.best.com/~xah/PageTwo_dir/more.html
> 'Emacs forever!'

 



------------------------------

Date: Tue, 22 Dec 1998 05:49:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: explain an hash assignment: $hash{'key'}++
Message-Id: <EpGf2.53$s7.1325@nsw.nnrp.telstra.net>

In article <367F308B.73D9CC9E@hotmail.com>,
	Rakesh Puthalath <rakesh_puthalath@hotmail.com> writes:
> It's just another way for denoting an existence of a key.

No, it's not. It is a way to (possibly magically) increment the value
that is stored in that hash, with key 'ss'. It will exist after that,
sure, but it may have existed before as well.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.       | password?
NSW, Australia                      | 


------------------------------

Date: 21 Dec 1998 21:41:51 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: It's about time
Message-Id: <75n0tf$p8r@panix.com>

In <367e8c0a.566322252@news.codenet.net> ningersoll@codenet.doh.net (Nelson E. Ingersoll) writes:

>    I can list() an ASCII date/time string and pull the appropriate
>year/month/day/hour/min/sec sub-strings from an ASCII time string.
>And using various Perl functions I can get the local/gm time in
>seconds since Jan 1, 1970 which is cool.  However, how can I convert
>an ASCII time string, such as 21-Dec-1998 to seconds since 1-Jan-1970
>so that it can be used with localtime() for example?

You just gotta love that Date::Manip module...

   #!/usr/local/bin/perl -w
   
   use Date::Manip;
   
   $date = "21-Dec-1998";
   @format = ("%s");
   
   $epoch_sec = UnixDate($date,@format);
   print "$epoch_sec\n";
   
prints:

   914227200

-- 
Clay Irving
clay@panix.com


------------------------------

Date: Mon, 21 Dec 1998 21:46:23 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Mac, Perl, uploading, help!
Message-Id: <1dkeoo7.1is1j5m1q9f52oN@bay2-518.quincy.ziplink.net>

Bill Jones <bill@fccj.org> wrote:

> > > > Everytime I try to ulpoad a perl script with FETCH to my server the
> > > > people at the isp say it is corrupted.
> > > >
> > > > Now when I upload my html to my regular dirs I have no problems with
> > > > fetch (set to raw data). I edit in BBedit light, should I be saving
> > > > in a specific format?
> > >
> > > Send the file as text, so the line endings get converted properly.
> > >
> > 
> >  I tried this and it still did not work. Could I be saving it wrong in
> > bbedit?
> 
> Are you saving it as Unix or Mac?  BBEdit can save it as a Unix Text
> file...

If you upload it as text, it doesn't matter whether you save it with
Unix or Mac line endings.  That's kinda the whole point of text-mode FTP
transfers.

Perhaps he can get more specific feedback from his ISP than "it is
corrupted"?  That seems to describe a problem more serious than just
incorrect line endings.

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


------------------------------

Date: Mon, 21 Dec 1998 21:46:24 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Meaning of comp-generated statement -- amended
Message-Id: <1dkeot7.1r85mrf1rp8127N@bay2-518.quincy.ziplink.net>

Ryan <rich_guy@hotmail.com> wrote:

> Maybe you can find something that's already working at  Matt's Script
> Archive.

 ...but it would be quite a surprise if she did!  ;-)

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


------------------------------

Date: 21 Dec 1998 20:55:50 +0000
From: Kin Cho <kin@symmetrycomm.com>
Subject: Net::FTP and hash printing
Message-Id: <uhfupdxk9.fsf@server3.symmetrycomm.com>

Has anyone implemented HASH printing using Net::FTP?
Care to share the code?

Thanks.

-kin



------------------------------

Date: Tue, 22 Dec 1998 06:23:55 GMT
From: Budi Ling <bl@dcs.ed.ac.uk>
Subject: newbie: cannot grab a webpage with frame
Message-Id: <199812220623.GAA18965@keisgaig.dcs.ed.ac.uk>



I'm using webget for grabbing a web page, but when
the webpage contains a frame, I get the following
message:


<FRAMESET cols="100,1*" frameborder=0 framespacing=0 border=0>
<NOFRAMES><BODY>

<P>Viewing this page requires a browser capable of displaying frames.
</P>

 ..etc...

Is there any way to solve this? Thanks beforehand,

Bud


------------------------------

Date: Tue, 22 Dec 1998 06:25:26 GMT
From: beable@my-dejanews.com
Subject: Re: One Level, Two Level, Blue Level, Purple Level
Message-Id: <75ne0l$kat$1@nnrp1.dejanews.com>

In article <743.659T33T12990957@abo.fi>,
  "Dag Right-square-bracket-gren" <dagren@abo.fi> wrote:
> beable wrote:
> >In article <75bo45$7uh@josie.abo.fi>, dagren@abo.fi wrote:
> >> Nick S Bensema (nickb@primenet.com) wrote:
> >> > In article <755pbk$alm@josie.abo.fi>, Dag ]gren FYSI <dagren@abo.fi>
> >> > wrote:
> >> > >2) Naming it. This is where you people come in. I was going to call it
> >> > >"porn" but I can't figure out what the o would be for.
> >> > Then make it a zero.  Problem solved!
> >> This is a scarily good idea. If nothing else, I would get to mess with
> >> people's heads.
> >or how about:
> >Post Or Read News
>
> Hey.
>
> Whoa!
>
> That IS a good idea!
>
> It _IS_!
>
> Yay!
>
> Just one problem left then!

That would be "doing the work" right? Actually you
"inspired" me to get a perl web browser. But I couldn't
find one! I went to www.perl.com and it said to look
on CSPAN. SO I WATCHED CSPAN FOR TWELVE STRAIGHT HOURS
AND ALL IT HAD WAS A STUPID DEBATE ABOUT IMPEACHING
SOME PREZIDENT GUY!!! THERE WAS NOTHING ON CSPAN
ABOUT PERL WEB BROWSERS!!!!111!!!

But anyway, I got all this libwww modules and stuff,
and installed them. I couldn't install them on NT, so
I had to use Solaris. YAY! Now I've got a "perl web
browser" that can penetrate the mysterious firewall
and retrieve dilbert cartoons! Like this:
 ./webtoad.pl > dilbert.gif

Of course, it sux severely because you have to type
the url you want into the perl program and the output
is just the html page or the gif or jpg; whatever
you pointed it at. So I need to add a command line
parsing module to it, and it needs to parse what
it gets back from the web and THROW AWAY ALL THE
STUPID TAGS LIKE: frames, fonts, colours, sizes,
bold, italic, etc. I will only keep the good tags
like "a href", "img src", "blink" and "marquee".
And all the text of course. Naturally all input
will be via the keyboard, because everybody hates
using the mouse. Well looking at that, I wonder
why I don't just use lynx? I think it's because
"webtoad" is a much catchier name.

cheers
brian


--
Beable, you moron. That was a FAKE Captain Picard you were arguing with
before. -- Riboflavin

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Tue, 22 Dec 1998 00:16:05 -0600
From: "brad" <bradnix@geocities.com>
Subject: Perl and WIN98 ActiveDesktop?
Message-Id: <4QGf2.2657$w91.1195351@newsread1-mx.centuryinter.net>

Would there be a way to use Active Desktop and Perl.  IE:  I would like to
make a text form using the powers that active desktop gives me, and have a
save button and retrieve button that would allow me to keep my notes well
organized.  Is this possible?  I do have omnihttpd if that helps some.




------------------------------

Date: Tue, 22 Dec 1998 05:57:32 GMT
From: optiknerv1138@yahoo.com
Subject: question on <> operator
Message-Id: <75nccb$j12$1@nnrp1.dejanews.com>

This should be easy to accomplish but...

Want to do something like this:

#!/user/bin/perl
#
if(<>) { print "there's something on stdin\n";
  } else { print "Type something you twit: ";
       chop($something=<STDIN>);
}
Except this doesn't work of course.
For example, when you run the ftp command you can
optionally enter a ip address, or if there was
nothing entered after ftp command, prog propts for
input. Like getopt but the options not specified in the script.
 Help! All responses appreciated! Already looked through the
Camel book and the llama book.


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Tue, 22 Dec 1998 03:47:39 GMT
From: "Peter L. Berghold" <peter@berghold.net>
Subject: Re: reading form files
Message-Id: <367F1654.91CC7A99@berghold.net>

Martin Schager wrote:

> Hi I!
>
> I have the following problem:
>
> I create a file using perl.
>
> When I read it with the following routine, it only reads the first line
>
>  (open (FIL, "<" . $file)){
> $fi_content = <FIL>;

Replace the above line with @fi_conent=<FIL>

This will store the entire file into the array "@fi_content" trailing EOR
characters and all.

>
> close (FIL);
> }
>




--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Peter L. Berghold                               Peter@Berghold.net
"Those who fail to learn from history           http://www.berghold.net
are condemned to repeat it."                       ICQ# 11455958




------------------------------

Date: Mon, 21 Dec 1998 20:56:11 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: replace single quote to double quote with an example
Message-Id: <bo1n57.j71.ln@magna.metronet.com>

targetmailinfo@yahoo.com wrote:

: I have three input fields "$YourAddress" , "$MumAddress" and "$DadAddress" , I
: want to replace all these field's input data from single quote ( ' ) to Double
: quote( " ) . Is it prosible? Could you give me some example?


   $YourAddress =~ tr/'/"/;


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 21 Dec 1998 21:04:11 -0500
From: "Robert Gwynne" <nospam_gwynne@utkux.utk.edu>
Subject: Reversed hash is truncated
Message-Id: <75mv6r$d3t$1@gaia.ns.utk.edu>

I'm trying to modify the code for processing everyword in a file found on
page 280 of the Perl Cookbook so that it prints out a sorted list of values
by keys instead of keys by values. If I reverse the hash, the resulting hash
ends up being truncated. Consequently, I don't get a list of all of the
key/value pairs that SHOULD be in the list.

The following is a simplified snippet of code used to test the result.

#!/usr/local/bin/perl -w

open(TEXT, "file1") || die "Can't open it.";
%seen = ();
while (<TEXT>) {
            while( /(\w['\w-]*)/g) {
                    $seen{lc $1}++;
                    }
            }
print "Plain old %seen is: \n";
print %seen, "\n\n";
print ".................................\n";
%reversed_seen = reverse (%seen);

print "Reversed %seen is: \n";
print %reversed_seen , "\n";
print "...........................\n";
###################################
The results follow:
Plain old %seen is:
hear1www1readers8examine1be2complaint1asked1i'll1pretty1between1communities1
tim1
 .................................
Reversed %seen is:
10and1hear11that2be3mistakes22the4percent5what7in8readers
 ...........................

#########################
%seen runs off the right side of the page; whereas, %reversed_seen contains
only ten pairs.

Now, I understand that this happens because not all values in the reversed
hash are unique; however, I would like to end up with a list of alphabetized
words in column one and their frequency in column two instead of a list of
sorted frequencies in column one and unordered words in column two.  How can
I do that?  I've spent considerable time trying to solve the problem, looked
at the books, the FAQ, etc., but can't find the answer.
********************
Robert Gwynne, Ph.D.
Speech Communication
University of Tennessee, Knoxville
gwynne@utkux.utk.edu
http://web.utk.edu/~gwynne
423-523-1097 Home
423-974-6836 Office
423-974-4879 Fax
***********************************
Liberalism has always derived its authority and persuasiveness from a vision
of human nobility, from the idea that our dignity is derived from the
exercise of moral choice. Moral absolutism fears this act of choice and
fears the freedom required by the act of choosing.

Liberalism depends, ultimately, on faith in human choosing, and a liberal
revival depends on recovering the inspiration of this central conviction.

Michael Ignatieff









------------------------------

Date: Tue, 22 Dec 1998 03:52:16 GMT
From: "Peter L. Berghold" <peter@berghold.net>
Subject: Re: running perl commands in background
Message-Id: <367F1769.178772D0@berghold.net>

Neil Prater wrote:

> In my perl program I am running a unix command to display a text box
> message. When run, my perl script will not continue until the process for
> {snip!}

>
> The & allows unix commands to be run in the background, but the perl program
> still halts until I kill the xdialog process. Any help would be grateful.

Try forking a child process from your Perl script and execing your dialog box from
the child and have the parent go about its business.  That's one way.

Another way, (If I read your intent correctly) would be to use the Perl/TK interface
and instantiate your dialog box from Tk...



--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Peter L. Berghold                               Peter@Berghold.net
"Those who fail to learn from history           http://www.berghold.net
are condemned to repeat it."                       ICQ# 11455958




------------------------------

Date: Mon, 21 Dec 1998 18:07:07 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: shift.
Message-Id: <x3ylnk1umau.fsf@tigre.matrox.com>


rjk@linguist.dartmouth.edu (Ronald J Kimball) writes:

> 
> No, I think it puts your Perl script into gear.
> 
> Note that if you want your Perl script to back up, you should use
> reverse(), instead.
> 
> And if it breaks down, you'll have to get out and push().

But, you'll soon get tired, so you need to study() your situation. I
suggest then that you seek() help. open() your car, take your keys(),
and listen() for an incoming cab. Once you find one, tell() the driver
to take the next exit() and warn() him that you have no time(). DON'T
confess() to him how your car broke down. Walk until() you find a
log(). pop() the log() open(), and you'll find my() map(). use() it
wisely!


Ala



------------------------------

Date: 21 Dec 1998 21:53:12 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Text::Parser
Message-Id: <75n1io$qg5@panix.com>

In <75mlvu$nv5$1@news.cs.hut.fi> jkekoni@cc.hut.fi (Joonas Timo Taavetti Kekoni) writes:

>The CPAN metions the Text::Parser, but i cant find it. Has it changed name
>or something?

It isn't installed on CPAN:
   
   cpan> m Text::Parser
   Module id = Text::Parser
       DESCRIPTION  String parser using patterns and states
       CPAN_USERID  PATM (Pat Martin <pat@bronco.advance.com>)
       DSLI_STATUS  adpO (alpha,developer,perl,object-oriented)
       INST_FILE    (not installed)
   
We'd see a CPAN_FILE if it was installed. In the module list, I see:

   Module   Text::Parser  (Contact Author Pat Martin <pat@bronco.advance.com>)

-- 
Clay Irving
clay@panix.com


------------------------------

Date: Mon, 21 Dec 1998 15:46:28 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: what's wrong with this bit of code? :)
Message-Id: <kjfm57.jb5.ln@magna.metronet.com>

Bart Lateur (bart.lateur@skynet.be) wrote:
: Gavin Cato wrote:

: >open MAIL, "|$sendmail -t -i";

: You should check the result of the open. It could well be that launching
: sendmail doesn't work.

: 	open MAIL, "|$sendmail -t -i" 
: 		or die "Oops! Can't use sendmail: $!";


   Try that with:

      $sendmail = '/non/existant/prog';

   and note that your die() does *not* get executed...



   Then go have a look at the Perl FAQ, part 8:

      "Why doesn't open() return an error when a pipe open fails?"

   ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 22 Dec 1998 06:29:47 GMT
From: worldmall@aol.com (Worldmall)
Subject: Why does my browser try to download the script instead of execute it?
Message-Id: <19981222012947.27491.00000023@ng-ch1.aol.com>

Do you know why my browser tries to download the cgi/pl scripts I installed
instead of executing them?  I changed the chmod to 755 and I even tried 777 but
it still tried to download the scripts :(

Could this mean the administrators have disabled cgi scripts from running in
any directory other than cgi-bin?  They say they've enabled execute for all
subdirectories as I requested but I just don't see it.

Where should I start so I can make these scripts run properly?

Thanks!

Andre'
p.s. I know I can't install them to aol, I've installed them to a different
provider's site. Thanks again.



------------------------------

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4476
**************************************

home help back first fref pref prev next nref lref last post