[8221] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1839 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 9 15:07:23 1998

Date: Mon, 9 Feb 98 12:00:28 -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, 9 Feb 1998     Volume: 8 Number: 1839

Today's topics:
    Re: "Mastering Regular Expressions" <jgoerzen@southwind.net>
    Re: "Mastering Regular Expressions" <ptimmins@netserv.unmc.edu>
    Re: ca anybody explai me this from the perl faq? (Gabor)
    Re: foreach and my() (Chip Salzenberg)
    Re: Fork/Threads <tchrist@mox.perl.com>
    Re: getting perl system calls to run in different shell <carey@tippett.com>
        getting rid of duplicate lines in a file <tim@hcirisc.cs.binghamton.edu>
    Re: Happy with Perl? (Richard Bellavance)
    Re: Happy with Perl? (Honza Pazdziora)
    Re: Happy with Perl? <tchrist@mox.perl.com>
    Re: Happy with Perl? <eglamkowski@angelfire.com>
        How to tell if your CGI-related question belongs in com (Joe McMahon)
    Re: is one class per file necessary? (Gabor)
    Re: is one class per file necessary? <tchrist@mox.perl.com>
    Re: New Perl book reviews (Andy Lester)
    Re: perl and file system <tchrist@mox.perl.com>
        Perl on NT not working and need help <Webmaster@smyth.net>
    Re: returning the date <dgoddard@us.oracle.com>
    Re: Sending a message to a pager (team lamer)
    Re: Sharing variables between scripts (Martin Vorlaender)
        Sorting some text in Perl <jola@acc.umu.se>
    Re: Sorting some text in Perl (Honza Pazdziora)
    Re: Two Perl programs -> One html output (real time) <dgoddard@us.oracle.com>
        use of regex in INDEX rsignorino@yahoo.com
    Re: Windows NT perl mail command <camerond@mail.uca.edu>
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl <kiblerj@aset.com>
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl <tchrist@mox.perl.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 09 Feb 1998 13:19:20 -0600
From: John Goerzen <jgoerzen@southwind.net>
Subject: Re: "Mastering Regular Expressions"
Message-Id: <r6zwwf47fif.fsf@peridot.southwind.net>

As far as regexps go, I found the descriptions in the early parts of
the camel book (Programming Perl, I think the title is) to be quite
sufficient.  The perlre manpage is also available should it be
necessary.

I got the Advanced book and it is pretty good.  It doesn't quite have
Wall's humorous and fun style to it (but then, very few books do).
Parts of the Advanced book tend to duplicate the Camel book.  However, 
the treatment of concepts like references, hashes of arrays, nested
arrays, OO concetps, etc. is very thorough and valuable.  There are
also some good comparisons to other lanauges.

Advanced is also the only publication of any sort that I've ever seen
that has a good Perl-Tk reference.

On the whole, it is a good buy.  I would say that it is probably not
quite as good as the camel book, but it probably actually duplicates
less material -- a good chunk of the camel book is just the perlfunc
manpage.

John

doswald@xmission.com (David Oswald) writes:

> In my continual quest to maximize my skills so that I may more fully
> exercise laziness I'm interested in another book that will help me to
> improve my effectiveness toward those goals.  I've been interested in
> ordering either "Mastering Regular Expressions" (O'Reilly & Assoc) or
> "Advanced Perl Programming"  (O'Reilly & Assoc).  There are no
> bookstores in my area that have either of these books, so I can't
> really look them over before buying.  Thus I turn here for a
> recommendation.
> 
> 'Advanced' sounds very interesting to me, but I read another post here
> mentioning that it is rather error-ridden.  I'd be surprised if this
> is true, coming from a publisher like O'Reilly, but I would rather not
> buy it and find out that it is indeed troublsome.  Would this
> respected Usenet community recommend 'Advanced'?
> 
> The other publication that has my interest is the "Mastering Regular
> expressions" book.  Again, I can't find anyone local who has one
> sitting on the shelf.  It sounds interesting to me but I'd like to
> hear firsthand that it's a good book.  I can always order it, but some
> recommendations first would be greatly appreciated.
> 
> I apologize for bringing up the book question again.  I've read the
> reviews on O'Reilly's site, but it's always nice to hear from some of
> the satisfied (or not so) customers.
> 
> 
> By the way, for those who are considering other Perl titles, I can
> personally strongly recommend Learning Perl and Programming Perl (the
> Llama and Camel books) as well as the somewhat perl oriented Mouse
> book (Programming CGI).
> 
> Thanks,
> 
> Dave

-- 
John Goerzen
Southwind Internet Access, Inc,
Business e-mail: jgoerzen@southwind.net

Personal e-mail: jgoerzen@complete.org
Wichita State University e-mail: jgoerzen@cs.twsu.edu
Developer, Debian GNU/Linux    <http://www.debian.org>


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

Date: Mon, 09 Feb 1998 12:34:54 -0600
From: Patrick Timmins <ptimmins@netserv.unmc.edu>
Subject: Re: "Mastering Regular Expressions"
Message-Id: <34DF4C4D.489@netserv.unmc.edu>

Calle Dybedahl wrote:
> 
> "Mastering Regular Expressions" on the other hand is one of the best
> computer-related books I have ever read. I had absolutely no idea
> there was that much to know about regular expressions! If you're going
> to do serious Perl programming, you *need* this book. It's easy to
> read, covers a subject which hasn't had very much written about it and
> it's written with a mind-boggling attention to detail[1]. Very highly
> recommended.
> 
> --
>                     Calle Dybedahl, UNIX Sysadmin
>        qdtcall@esavionics.se  http://www.lysator.liu.se/~calle/
> 
> [1] For example, it points out the one case in which $`$&$' isn't
>     equivalent to the string matched on. I would never in a million
>     years have thought of it, but Jeffrey Friedl did, commenting that
>     you will almost certainly never encounter it but that he thought
>     that he should mention it just for completeness.

I would agree with Calle ... everyone using perl should own Friedl's
book "Mastering Regular Expressions". It is the most important book I've
purchased in the past year or two (or more), and definitely one of the
best technical books I've ever read. It will make you a better "perler"
in particular, and a better "thinker" in general. This guy has a very
clear understanding of regular expressions, and more importantly, he is
extremely good at communicating this clear understanding. Short of
giving you the money to buy the book, I can't recommend it enough ...
and I won't.

Patrick Timmins
U. Nebraska Medical Center
ptimmins@netserv.unmc.edu


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

Date: 9 Feb 1998 17:59:53 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: ca anybody explai me this from the perl faq?
Message-Id: <slrn6dugr2.qma.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Jahnel Klaus <jahnel@xarch.tu-graz.ac.at> wrote :
# I want to test an array
# if there is a certain element in an aray but i realy dont  understand
# this  procedere which s in the perlfaq.
# 
# #    @blues = qw/azure cerulean teal turquoise lapis-lazuli/;
# #    undef %is_blue;
# #   for (@blues) { $is_blue{$_} = 1 }

why the loop, if you only need existance
@is_blue{@blues} = @blues;

print "$color is a blue\n" if exists $is_blue{$color};

# #Now you can check whether $is_blue{$some_color}. It might have been a
# good idea to keep the blues all in a hash in the first #place.
# 
# So can anybody explain this to me
# TIA KLAUS
# 

gabor.
--
    What about WRITING it first and rationalizing it afterwords?  :-)
        -- Larry Wall in <8162@jpl-devvax.JPL.NASA.GOV>


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

Date: Mon, 09 Feb 1998 18:36:11 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: foreach and my()
Message-Id: <6bnidb$eem$1@cyprus.atlantic.net>

According to rjk@coos.dartmouth.edu:
>Nevertheless, if the implementation is according to the documentation, which
>it most likely is, the question still remains, why is it implemented that way?
>
>In particular, since this is legal syntax:
>
>   foreach my $a (@list) {}
>
>It makes no sense for this to have the same effect:
>
>   my($a);
>   foreach $a (@list) {}

As the inventor of "foreach my", allow me to explain that it does in
fact make a lot of sense.

There is no way that we can break existing code that uses the latter
syntax just because we've decided to invent the former syntax.

The purpose of "foreach my" is convenience of expression, not new
behavior.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
        "Nice shooting, Zanthar!"  "Thanks, Denise."  // MST3K
           ->  Ask me about Perl training and consulting  <-
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: 9 Feb 1998 19:16:27 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Fork/Threads
Message-Id: <6bnkmb$9oh$4@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

If you can't get fork to work, I promise that you'll never
get threads to work.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    tmps_base = tmps_max;                /* protect our mortal string */
        --Larry Wall in stab.c from the perl source code


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

Date: Mon, 09 Feb 1998 11:31:37 -0800
From: Carey Pembroke <carey@tippett.com>
To: sharyl_griffith@ftw.paging.mot.com
Subject: Re: getting perl system calls to run in different shells
Message-Id: <34DF5999.88D200E0@tippett.com>

Sharyl_griffith@ftw.paging.mot.com wrote:

> I'm trying to get my perl scripts with system calls to run regardless of
> which shell a user is running.  Is there an easy way to do this?
>
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet

  You can always open the shell by hand, to be sure that you are using the
shell of your
choosing:

open(CMD, "|/bin/sh");
print CMD "echo your shell command here";
close(CMD);

Carey



--
  ####   The Cad decides he has grown weary
 #    #   Of this affair, and that is that;
 #       And so he tells her just how dreary
 #        He think she is, then leaves the flat.
 #    #
  ####                    -Edward Gorey-





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

Date: 09 Feb 1998 14:47:56 -0500
From: Tim Gray <tim@hcirisc.cs.binghamton.edu>
Subject: getting rid of duplicate lines in a file
Message-Id: <t03ehsblw3.fsf@hcirisc.cs.binghamton.edu>


How would you go about getting a perl script to remove all duplicate
lines in a file?  I basically want to do the equivalent of
`cat filename | uniq > filename` but since this will be in perl for
win32 I can't do it that way.  Thanks.

Tim Gray


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

Date: 9 Feb 1998 13:23:45 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: Happy with Perl?
Message-Id: <6bnhjh$hva@stratus.CAM.ORG>

In article <6bnbrg$iec$1@blinx.lizard.org>,
Mark Lewis <markl@blinx.lizard.org> wrote:
>is perl stable?  would it be a good idea to risk millions of pounds on
>something that is unsupported?  what do you think?
>

Unsupported ?   UNSUPPORTED ???  What the @##@!% do you think the people in
this newsgroup are doing ?  Sheesh, the nerve of some people...   :-)

Richard.

-- 
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
    "All along this path I tread  /  My heart betrays my weary head
     With nothing but my love to save / From the cradle to the grave"
                                 (Eric Clapton, "From the cradle")


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

Date: Mon, 9 Feb 1998 18:47:14 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Happy with Perl?
Message-Id: <adelton.887050034@aisa.fi.muni.cz>

markl@blinx.lizard.org (Mark Lewis) writes:

> I am looking into the possibility of rewriting all the site-specific shell
> scripts for our company in perl, but am checking to see if anybody else
> has done this and wished they hadn't.

No, but I know some who didn't rewrite in time and now wish they had.

> is perl stable?  would it be a good idea to risk millions of pounds on
> something that is unsupported?  what do you think?

As for stable and unsupported, please check www.perl.com and also
perlfaq. They answer both questions and I believe that the existence
of www.perl.com, perlfaq, this newsgroup or Perl Clinic (to mention
a few) are the most significant features of stableness and
supportness.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 9 Feb 1998 19:29:59 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Happy with Perl?
Message-Id: <6bnlfn$9oh$5@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, markl@blinx.lizard.org (Mark Lewis) writes:
:is perl stable?  

Stable == dead. 

:would it be a good idea to risk millions of pounds on
:something that is unsupported?  what do you think?

I think that your false premise of Perl's being unsupported
merits any possible response.  In fact, it's entirely 
likely that your system will spontaneously vaporize for
such a vapid question.

Perl is highly supported.  As for the rest of your question,
those are technical matters.   You'll have to look into this
in different ways than your trolling post.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    I don't know if it's what you want, but it's what you get.  :-)
            --Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>


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

Date: Mon, 09 Feb 1998 14:52:36 -0500
From: the count <eglamkowski@angelfire.com>
Subject: Re: Happy with Perl?
Message-Id: <34DF5E84.2346@angelfire.com>

Richard Bellavance wrote:
> 
> In article <6bnbrg$iec$1@blinx.lizard.org>,
> Mark Lewis <markl@blinx.lizard.org> wrote:
> >is perl stable?  would it be a good idea to risk millions of pounds on
> >something that is unsupported?  what do you think?
> >
> 
> Unsupported ?   UNSUPPORTED ???  What the @##@!% do you think the people in
> this newsgroup are doing ?  Sheesh, the nerve of some people...   :-)

And that's not even to mention perl.com, perl.org and the perl 
conference (I assume there will be others in future years...).

But seriously, this newsgroup has provided accurate and helpful 
assistance for all my problems without fail.  And usually within 
minutes.  Try and get that from commerical tech support!  :P


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

Date: Mon, 09 Feb 1998 14:39:29 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: How to tell if your CGI-related question belongs in comp.lang.perl.misc
Message-Id: <joe.mcmahon-0902981439290001@prtims.stx.com>

If you're not sure what you want to do, figure out what you want to do in
*detail* first. After you've done that, check with this list again and see
what you should be doing next. You're not ready for comp.lang.perl.misc or
any other any newsgroup yet.

If you've written up your requirements, but aren't sure how to proceed,
you'll need to learn (or refresh your memory) on how CGI works first, no
matter what language you're going to use. Try
comp.infosystems.cgi.authoring for help on how to get started writing CGI
programs. You're not ready for comp.lang.perl.misc yet.

If you know Perl, you know your requirements and understand how to proceed
but don't know how to write a CGI program, check out the CGI and
HTML::Stream documentation and try to get a program working first. You're
not ready for comp.lang.perl.misc yet.

If you've written a CGI program and you're getting a browser or server
error (e.g., 404 file not found, 500 Server error), check your server
error logs first to see what messages are in there concerning your
program. Either you haven't set things up right, you can't execute CGI
programs from the location you chose, or your program is dying with a
syntax error or some other reason that isn't specifically a perl problem.
You're not ready for comp.lang.perl.misc. yet.

If you're having trouble actually implementing a solution - you've
actually tried writing some code and the *code itself* is not working - 
*now* you're ready for comp.lang.perl.misc. Don't forget to include the
part of the code that isn't working, and what is happening instead of what
you want.

(Note: I'd appreciate any additions/corrections to this posting - I'd like
to turn it into a periodic posting to help cut the noise level.)

 --- Joe M.


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

Date: 9 Feb 1998 18:08:48 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: is one class per file necessary?
Message-Id: <slrn6duhbq.qma.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Vladimir Alexiev <vladimir@cs.ualberta.ca> wrote :
# I'm writing a simple program that contains 7-8 classes of 20 lines
# each. I'd like to keep it in one file, at least for the exploratory
# stage. However, the following causes a ``Can't locate object method
# "new" via package "Bar"'' error: 
# 
#   Bar->new;
# 
#   package Foo;
#   sub new {}
# 
#   package Bar;
#   @Bar::ISA='Foo';
# 
# When I move Foo and Bar to their separate classes Foo.pm and Bar.pm
# and put the required "use" clauses, everything works ok.
# 
# What's the rationale for this, and is there a way to avoid it?

You can have more than one object in a file, however to 'use' the
object you need to use the name of the file

file Bar.pm

package Bar;

sub new
{
    bless {}, shift;
}

sub gum
{
    print "in bar\n";
}

package Foo;

sub new
{
    bless {}, shift;
}

sub gum
{
    print "in foo\n";
}
1;
end of Bar.pm

use Bar;

$t = Foo->new;
$t->gum;
$t = Bar->new;
$t->gum;

gabor.
--
    Be consistent.
        -- Larry Wall in the perl man page 


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

Date: 9 Feb 1998 19:11:53 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: is one class per file necessary?
Message-Id: <6bnkdp$9oh$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Vladimir Alexiev <vladimir@cs.ualberta.ca> writes:
:When I move Foo and Bar to their separate classes Foo.pm and Bar.pm
:and put the required "use" clauses, everything works ok.
:What's the rationale for this, and is there a way to avoid it?

The problem is that when you put them all in one file, you haven't set
up the @ISA inheritance lists before you need them.  Wrapping any
such class constructors with BEGIN{} blocks would work.  

But you are probably violating the rule about "Don't try to be too
clever."  In general your life will be simpler if you have one module
in one class with one file and one package

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    "Winter is worth its wait in cold." --Larry Wall


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

Date: 9 Feb 1998 17:54:22 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: New Perl book reviews
Message-Id: <6bnfse$b3l$1@usenet85.supernews.com>

: > URL is http://ChicagoMusic.com/perl/

: Sorry, you can't say it is a list for beginners without mentioning the
: Llama first. The Llama is by far the best perl primer.

If you go back and read my intro again (or a first time?), you'll find
that I specifically say it is NOT a list for beginners.

<BLOCKQUOTE>
These reviews are entirely subjective, and come from my frame of
reference. They're the books I've found most useful. With one exception,
none of the books I recommend are introductions, because I'm fairly fluent
with Perl, and don't need my hand held. 
</BLOCKQUOTE>

That being said, I'll agree that the Llama may well be necessary for
anyone getting into it from the get-go.  There are just too many idiomatic
doodads to be gleaned from the "read the Camel" approach.  I tried that
with Camel #1 years ago, but it wasn't until I got the Llama that I
understood, for example, $_ and its implicit uses.

xoxo,
Andy


--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: 9 Feb 1998 19:13:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl and file system
Message-Id: <6bnkfs$9oh$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, jdporter@min.net writes:
:Also, mount may be in different directories, typically /usr/sbin/.

Which is why I called it "mount" -- just insist on a proper path, 
and eschew full pathnames, as they are fragile and quick to break.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


 "All things are possible, but not all expedient."  (in life, UNIX, and perl)


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

Date: Mon, 09 Feb 1998 13:15:24 -0500
From: Webmaster <Webmaster@smyth.net>
Subject: Perl on NT not working and need help
Message-Id: <34DF47BC.57E@smyth.net>

I am trying to install perl on NT 4.0 and all I get is moduel not found.
Can someone help? The web site is at www.smyth.net and our e-mail is
webmaster@smyth.net.

						Sincerly,
							Mike Perdue


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

Date: Mon, 09 Feb 1998 10:12:16 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
Subject: Re: returning the date
Message-Id: <34DF4700.F4D3D0EE@us.oracle.com>

Ronald L. Parker wrote:

> On 9 Feb 1998 14:50:31 GMT, Tom Christiansen <tchrist@mox.perl.com>
> wrote:
>
> >I don't think you should use MM/DD/YYYY either.  Is that really MM/DD
> >or DD/MM?  ISO says DD/MM/YYYY, but as you see, that has the same problem.
>
> My understanding was that ISO is now squarely behind YYYY-MM-DD

 ... which, to me, seems "confusable" on the same logic that <tchrist>pointed
out.

A certain pretty big software company that I work with every day,
(but my opinions aren't always theirs, I don't speak for them, etc),
is squarely behind "-MON-" for the month part.

You may ask about language dependencies, to which I say, NLS determines
the three letters to use.

I have sometimes confused $day="12" with $month="12".
I have never     confused $day="12" with $month="DEC",
 ...even when inadvertently SvIV'ing the latter.

-Denis

     __  __  _  __     __
~~~~(__)|-< /-\(__ |__(-_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard, Senior Member Technical Staff|"I see the heads of men arise
email: dgoddard@us.oracle.com               |with hungry minds and open eyes!"
ourworld.compuserve.com/homepages/d_goddard | -Rush, from 2112: _The Oracle_




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

Date: Mon, 09 Feb 1998 17:32:28 GMT
From: spam@fritter.com (team lamer)
Subject: Re: Sending a message to a pager
Message-Id: <34df3d1f.1096406@news1.newscene.com>

On Mon, 9 Feb 1998 00:18:55 GMT, aml@world.std.com (Andrew M.
Langmead) enlightened us with:
<snip>
>Take a look at <URL:ftp://ftp.netcontech.com/pub/paging_info/ixo_faq.txt>
>
this is great, thanks :)


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

Date: Mon, 09 Feb 1998 19:43:01 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Sharing variables between scripts
Message-Id: <34df4e35.524144494f47414741@radiogaga.harz.de>

Brian M. Beaulieu (banman@earth.execpc.com) wrote:
: I've seen this done before but can't recall how again.  All I need to do
: is share variables that are located in 1 perl script between other scripts
: .. I've tried 'require' .. that didn't seem to do the trick (and I did
: give it the relative path to the script with my variables)

Beware that the current directory may not be the one your script is in.
To make sure your script's directory is in @INC, try

use FindBin;
use lib $FindBin::Bin;

before require-ing the inclusion of your shared-variables script.

Hope it helps,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Mon, 09 Feb 1998 18:57:31 +0100
From: Johan Larsson <jola@acc.umu.se>
Subject: Sorting some text in Perl
Message-Id: <34DF438A.A0D95BBB@acc.umu.se>

Hi All,


How can I sort a @text list in Perl containing strings like "9801"
"9802" etc? (dates - oh yes!)


Regards,
Johan Larsson
jola@acc.umu.se <--- Please carbon copy!



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

Date: Mon, 9 Feb 1998 18:51:19 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Sorting some text in Perl
Message-Id: <adelton.887050279@aisa.fi.muni.cz>

Johan Larsson <jola@acc.umu.se> writes:

> How can I sort a @text list in Perl containing strings like "9801"
> "9802" etc? (dates - oh yes!)

Check the man page perlfunc for a builtin function ... (wait, hmmmm,
here it is) ... it's called sort.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Mon, 09 Feb 1998 10:26:37 -0800
From: Denis Goddard <dgoddard@us.oracle.com>
Subject: Re: Two Perl programs -> One html output (real time)
Message-Id: <34DF4A5D.AC3F6A5C@us.oracle.com>

Ben Holness wrote:

>I would like the following to happen:
> 
> When the user clicks on /cgi-bin/p1.pl, the output of p1.pl is displayed
> as normal on the screen, followed by an <hr> break (which I can add at
> the end of the p1.pl file), followed by the output of p2.pl
> 
> Any ideas?

Yes. Three letters, One Powerful Concept: "IPC"
I will use straight-up HTML output below, but of course
you want to 'use CGI'

#!/usr/bin/perl5 -w -T
# filename: p1.pl
#
# religious requirements:
use strict; use diagnostics; use English;
$OUTPUT_AUTOFLUSH=1;
print "...html stuff...";
# ... 
print "<HR>\n";
open(P2_OUTPUT,"p2.pl|") || die "p2";
my @p2_output=<P2_OUTPUT>;
print @p2_output;
__END__

As always, more elegant solutions highlt appreciated...

-- 
     __  __  _  __     __
~~~~(__)|-< /-\(__ |__(-_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard, Senior Member Technical Staff|"I see the heads of men arise
email: dgoddard@us.oracle.com               |with hungry minds and open
eyes!"
ourworld.compuserve.com/homepages/d_goddard | -Rush, from 2112: _The
Oracle_


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

Date: Mon, 09 Feb 1998 12:53:18 -0600
From: rsignorino@yahoo.com
Subject: use of regex in INDEX
Message-Id: <887042974.864616456@dejanews.com>

Trying to locate special tags that begin with
an ampersand and end with a period in an HTML file.
ex. (&MYSPECIALTAG.)

I tried the INDEX function:

 $position = index($line, /&[0-9a-zA-Z]\./i);

while looping thru each input $line if the file,but INDEX seems to
require an actual string ("mystring"), rather than a regex. ( I keep
getting 0 for $position)

Is there a way that my regex can be used in INDEX, or should i look for
another way of doing this?

Thanks!

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Mon, 09 Feb 1998 12:51:30 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: Steve Linberg <linberg@literacy.upenn.edu>
Subject: Re: Windows NT perl mail command
Message-Id: <34DF5032.5607FE2D@mail.uca.edu>

[cc'd to SL]

Steve Linberg wrote:
> 
> There is a Win32-specific FormMail.pm that works fine for me.  See
> CPAN.
> 

Steve, maybe I'm blind (more likely, just inept), but I can't locate
FormMail.pm, looking by-modules under mail/, MailBot/. Win32/,
Win32API?, Chemistry/ (OK, I was just curious what I would find there),
where is this module?

Cameron Dorey
camerond@mail.uca.edu


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

Date: Mon, 09 Feb 1998 14:05:10 -0500
From: "Jon R. Kibler" <kiblerj@aset.com>
To: Ron Martell <rmartell@islandnet.com>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34DF5366.DE3414E4@aset.com>

Ron Martell wrote:
> 
> Just to follow up on Jon's comments re 1401s

<SNIP!> Delete some good comments to save space!
> 
> The point is, so long as any component of the system remained in
> Autocoder then the file formats had to remain the same.  The last I
> heard, Autocoder was still being used for one small remnant of the
> accounting system in the late 1980s.
> 
> I would imagine that there are many many applications that evolved the
> same way, and once a file and data storage format was being accessed
> by a large number of applications then it would be extrememely
> disruptive to change these formats.   So structures inherited from the
> legacy systems would persist long after the applications themselves
> had been rewritten or discarded.

<SNIP!>

Exactly! The 1401 is the root of many of today's' problems, because
files created on 1401s were often carried over to 360s and later
systems. If I remember correctly, IBM had a 1401 emulator that would run
Autocoder programs on systems as late as the 43xx systems -- and maybe
even later than that. 

Old legacy systems never die!

Thanks for the additions to my comments. For the young'ns out there, a
little history in how we got where we are today helps with perspective.

Jon Kibler
Jon.Kibler@aset.com
-- 
Advanced Systems Engineering Technology
389 Johnnie Dodds Blvd., Suite 205
Mt. Pleasant, SC 29464-2950  (Charleston)

Phone:	(803) 849-8214
Fax:	(803) 849-8215
www:	http://www.aset.com


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

Date: 9 Feb 1998 19:14:49 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <6bnkj9$9oh$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, jdporter@min.net writes:
:> If your birthday is
:> "2/2/05", are you 106 years old in 2006, or just one year old?
:
:Well, you sure won't be 106. Maybe 101, or 201...

This and similar things have been fixed in the on-web copy,

    http://www.perl.com/perl/news/y2k.html

I'm still thinking about the issue of people learning bad 
habits from the bad old days of Cobol.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

Personally, I don't care whether someone is cool enough to quote Doug
Gwyn--I only care whether Doug Gwyn is cool enough to quote. --Larry Wall


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

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


Administrivia:

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 1839
**************************************

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