[11247] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4847 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 8 16:07:30 1999

Date: Mon, 8 Feb 99 13:00:46 -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, 8 Feb 1999     Volume: 8 Number: 4847

Today's topics:
    Re: 8-bit input (or, "Perl attacks on non-English langu (Mark Leighton Fisher)
    Re: 8-bit input (or, "Perl attacks on non-English langu <NOSPAM.hal9k@technologist.com>
    Re: 8-bit input (or, "Perl attacks on non-English langu <cmcurtin@interhack.net>
    Re: 8-bit input (or, "Perl attacks on non-English langu <laurent.duperval@bellsygma.com>
    Re: building DBI/DBD::Oracle on HP-UX 11 dynamically mgogala@yahoo.com
        Building Perl 5.004_04 under HP/UX 11.00 - Help! jmartens@compusmart.ab.ca
    Re: Converting a Byte to it's respective bits (Mark Leighton Fisher)
    Re: File::Path rmtree and tainting droby@copyright.com
        how can i post? <yotakim@hyowon.cc.pusan.ac.kr>
        Multithreading in Perl <venky@clam.com>
        My SQL <bruce.d@btinternet.com>
        NEWBIE Question about error checking string <paxtond@ix.netcom.com>
    Re: NEWBIE Question about error checking string <jglascoe@giss.nasa.gov>
    Re: NEWBIE Question about error checking string <jglascoe@giss.nasa.gov>
    Re: Parsing output from a program called within perl <ludlow@us.ibm.com>
    Re: Perl vs. ASP for new project <matthew.sergeant@eml.ericsson.se>
    Re: Perl Webpage <jjarrett@ecpi.com>
    Re: Perl, PHP, Python, ColdFusion, MS Frontpage, which  (brian d foy)
    Re: Programming with Style <evb@lucent.com>
    Re: Python vs. Perl vs. tcl ? <larsga@ifi.uio.no>
    Re: Python vs. Perl vs. tcl ? <larsga@ifi.uio.no>
        Question: using write to format strings in a $variable  <bsmith@perf.zko.dec.com>
    Re: Serial Port in WinNT and OS/2 (Mark Leighton Fisher)
    Re: Simple Question About a Scalar <spike_YYwhiteYY@YYdellYY.com>
        Sorting on multiple fields <greg@erinedwards.com>
    Re: Sorting on multiple fields <ludlow@us.ibm.com>
    Re: String splitting. <debot@xs4all.nl>
    Re: String splitting. <spike_YYwhiteYY@YYdellYY.com>
    Re: String splitting. <upsetter@ziplink.net>
    Re: String splitting. <upsetter@ziplink.net>
    Re: swap space (I R A Aggie)
    Re: trouble invoking script from shell prompt <spike_YYwhiteYY@YYdellYY.com>
    Re: What Am I Doing Wrong Here? <spike_YYwhiteYY@YYdellYY.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 8 Feb 1999 13:43:26 -0500
From: fisherm@tce.com (Mark Leighton Fisher)
Subject: Re: 8-bit input (or, "Perl attacks on non-English language communities!")
Message-Id: <MPG.1128fa5529f242d79896a9@news-indy.indy.tce.com>

In article <xlxiudcizfn.fsf@gold.cis.ohio-state.edu>, 
cmcurtin@interhack.net says...
> Given that Perl was started by a linguist, namely Larry, and has also
> been under the influence of another, namely Tom, it seemed to me that
> if any language would be friendly to languages other than boring
> English (and Esperanto!) with non-accented, 7-bit ASCII characters, it
> would be Perl.

To do this up really right, Perl should handle Unicode. And the 8-bit 
encoding of Unicode, UTF8, is coming.  It is in beta (alpha?) in the 
development release of Perl right now.  I haven't had occasion to do 
anything with UTF8, so I've probably told you more than I know already 
:). 
==========================================================
Mark Leighton Fisher          Thomson Consumer Electronics
fisherm@.tce.com              Indianapolis, IN
"Browser Torture Specialist, First Class"


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

Date: Mon, 8 Feb 1999 13:20:53 -0500
From: "hal9000" <NOSPAM.hal9k@technologist.com>
Subject: Re: 8-bit input (or, "Perl attacks on non-English language communities!")
Message-Id: <79nbvv$pro$1@news.interlog.com>

Matt Curtin wrote in message ...
>We might write a small program to see if it can be done:
>    #!/usr/local/bin/perl
>    icrivez "Bonjour, monde!\n";
>    sub icrivez ($) {
>      my $m = shift;
>      print $m;
>    }


Perl isn't perfect (yet), but in the meantime, we could always build latin
based language modules 'sans' accenting characters.  At least it's better
than what we could (not) do for Asiatic languages. The following does work,
after all.  :-)

#!/usr/local/bin/perl

    ecrivez("Bonjour, monde!\n");

    sub ecrivez ($) {
      my $m = shift;
      print $m;
    }





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

Date: 08 Feb 1999 14:35:01 -0500
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: 8-bit input (or, "Perl attacks on non-English language communities!")
Message-Id: <xlx7ltssn8a.fsf@gold.cis.ohio-state.edu>

"hal9000" <NOSPAM.hal9k@technologist.com> writes:

> The following does work, after all.  :-)
> 
>     sub ecrivez ($) {
>       my $m = shift;
>       print $m;
>     }

Indeed.

But the module I really wanted to write was Russian.pm, which without
the ability to accept 8-bit code, requires transliteration.  (That's
no fun.)

Ehto ya ne hachu delat!

-- 
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/


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

Date: Mon, 08 Feb 1999 14:08:59 -0500
From: "DUPERVAL, LAURENT" <laurent.duperval@bellsygma.com>
Subject: Re: 8-bit input (or, "Perl attacks on non-English language communities!")
Message-Id: <36BF364B.A2047A66@bellsygma.com>

Matt Curtin wrote:
> 
> Let's see ... what other (programming) languages might support this
> sort of thing?  How about Lisp?  XEmacs Lisp, at that?
> 
>     (defun icrivez (m)
>       "Icrivez un message."
>       (message m))
> 

Tcl:

% proc icrivez {msg} {
puts $msg
}
% icrivez Test
Test


-- 
Penguin Power!

Laurent Duperval - CGI
5 Place Ville Marie, Suite 1600 South, Montreal H3B 2G2
Tel: (514) 870-0879  Fax: (514) 391-2212
EMAIL: mailto:laurent.duperval@bellsygma.com


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

Date: Mon, 08 Feb 1999 18:01:13 GMT
From: mgogala@yahoo.com
Subject: Re: building DBI/DBD::Oracle on HP-UX 11 dynamically
Message-Id: <79n8p3$ash$1@nnrp1.dejanews.com>

In article <79n4do$79c$1@nnrp1.dejanews.com>,
  John Cotter <jdcotter@execpc.com> wrote:
> From reading various postings I get the (possibly incorrect) notion that I
> should now be able to build the DBI/DBD::Oracle on HP-UX 11 dynamically. So
> far I've been unable to do this.  Has anyone out there been successful doing
> this? If so, any special tricks I need to know?
>
> DBD-Oracle-0.59
> DBI-1.06
> perl5.005_02
> Oracle 7.3.4
> HP-UX 11.0
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>
You can't build it dynamically. The only proper way to build it is
to build it statically with 'make test_static' and then copy the resulting
'perl' executable to /usr/local/bin
Mladen Gogala

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


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

Date: Mon, 08 Feb 1999 19:07:38 GMT
From: jmartens@compusmart.ab.ca
Subject: Building Perl 5.004_04 under HP/UX 11.00 - Help!
Message-Id: <79nclj$eaf$1@nnrp1.dejanews.com>

Sorry, Perl newbie question...I hope someone can help me with this, as its
getting a little annoying...

I am attempting to build Perl 5.004_04 (and later, 5.005_02) under an HP/UX
11.00 HP9000/80 K580 (both static and dynamic), and one of its 'make test'
sections fails. The error message I receive is below:

comp/cpp..........syntax error at comp/cpp.aux line 28, near "print"
Scalar found where operator expected at comp/cpp.aux line 37, at end of line
        (Missing semicolon on previous line?)
syntax error at comp/cpp.aux line 37, near "$x "
Execution of comp/cpp.aux aborted due to compilation errors.
FAILED at test 0

This works fine under HP/UX 10.20 (for both static and dynamic). The only
thing I can tell that is different is that the HP/UX 11.00 box has the HP
C/ANSIC compiler (B.11.01.01) as well as the HP aC++ compiler
(B.11.01.01)...On an HP/UX 11.00 machine that is only using the bundled cc
compiler (un-ANSIfied..) the builds work fine.

I'm expecting that I'll have to update some patches (or whatever...)..

Anyone have any suggestions?

Thank you.

James

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


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

Date: Mon, 8 Feb 1999 13:37:36 -0500
From: fisherm@tce.com (Mark Leighton Fisher)
Subject: Re: Converting a Byte to it's respective bits
Message-Id: <MPG.1128f8f8bc2987379896a8@news-indy.indy.tce.com>

In article <36BE76FC.BF1AEFCD@acpub.duke.edu>, ricks@acpub.duke.edu 
says...
However, I can't figure out how to break that
> information out into its separate bits (I need to be able to read out
> the bit values).

Use vec(). 
==========================================================
Mark Leighton Fisher          Thomson Consumer Electronics
fisherm@.tce.com              Indianapolis, IN
"Browser Torture Specialist, First Class"


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

Date: Mon, 08 Feb 1999 19:14:40 GMT
From: droby@copyright.com
Subject: Re: File::Path rmtree and tainting
Message-Id: <79nd2n$emb$1@nnrp1.dejanews.com>

In article <79n5l7$8br$1@nnrp1.dejanews.com>,
  dturley@pobox.com wrote:
> I was trying out the rmtree2 example in the Perl Cookbook (section 9.8
> Removing a directory and its contents). Th example uses the rmtree() function
> from File::Path. When tainting is turned on I get an insecure error on unlink
> within file.pm. The only user input I send is the directory name, which I
> untaint. Since the directory name is untainted, shouldn't the file names
> derived from it be also? How can I this function when running with the -T
> flag?

The rmtree function uses the DirHandle module (and through it the readdir
function) to get a list of filenames in the directory you specified.

Unfortunately these filenames are tainted (they came from outside the
program). And (also unfortunately?) File::Path doesn't untaint them.

--
Don Roby

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


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

Date: Sun, 7 Feb 1999 23:15:47 +0900
From: "1h?5EB" <yotakim@hyowon.cc.pusan.ac.kr>
Subject: how can i post?
Message-Id: <79k7lq$mc9$1@jagalchi.cc.pusan.ac.kr>

hi~

i want to receive in the form at my site
and post the input data to other sites..

i succeed in finding the strings in the back of xxx.cgi? or xxx.pl?

so i use like this

exam 1 : ..... xxx.cgi?name=test&...
            i succeed

exam 2 : .....xxxx.pl?name=test&...
           i fail  ,, i receive message 'you don't forget to input name..'

why?
is there any difference between xxx.cgi and xxx.pl?

please help.. me..!!

from cheetah




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

Date: Mon, 08 Feb 1999 13:53:08 -0500
From: Venkatesh Vaidyanathan <venky@clam.com>
Subject: Multithreading in Perl
Message-Id: <36BF3294.6093C20A@clam.com>

hi,

  I am trying to enhance the performance of a shell script - It does
some time-consuming
tasks in a simple loop sequentially.
Basically
    for i in all_groups
            process group $i
    end

The processing part for each group takes a long time.

Was wondering if it is a good idea to use multithreading
in Perl to get some improvement in performance.

Any books/resources that cover multithreading in fair amount of detail ?

thanks

venkatesh





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

Date: Mon, 8 Feb 1999 20:28:01 -0000
From: "Bruce Davidson" <bruce.d@btinternet.com>
Subject: My SQL
Message-Id: <79nh9a$36c$1@uranium.btinternet.com>

Using Active Perl on W95. (GS port also available).
I've installed W32 mysql shareware server.
Could anyone offer a shopping list for modules needed to fire mysql commands
and a sample perl sub to e.g., create table.
Trying to build and populate tables off line.
Thanks





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

Date: Mon, 08 Feb 1999 14:21:57 -0500
From: "Mr. Paxton *S*" <paxtond@ix.netcom.com>
Subject: NEWBIE Question about error checking string
Message-Id: <36BF394F.61B179FD@ix.netcom.com>

I need to check a string to see if it contains any characters OTHER
THAN  0, 1, 2, 3, 4, 5, and the space key.  The string is coming from an
HTML form and is already in the buffer.  This is the code minus the
piece that I need.  i realize that this is a very basic programming
question but I do need the assist.

if ($FORM{'string1'}) {
        unless ($FORM{'string1'} "CONTAINS  CHARACTERS OTHER THAN..."
                print "Content-type: text/html\n\n";
                print "<html><head><title>Bad Entry</title></head>\n";
                print "<body><h1>Bad Entry</h1><br>Some of the
characters you have entetred are invalid\n";
               print " Please click back and\n";
                print "try again.\n";
                exit;
        }
}

Thanks,

Dan
--
Please remove "nospam" in order to reply...




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

Date: Mon, 08 Feb 1999 14:52:01 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: paxtond@nospam.ix.netcom.com
Subject: Re: NEWBIE Question about error checking string
Message-Id: <36BF4061.FD525070@giss.nasa.gov>

hi,

"Mr. Paxton *S*" wrote:
> 
> I need to check a string to see if it contains any characters OTHER
> THAN  0, 1, 2, 3, 4, 5, and the space key.  The string is coming from an
> HTML form and is already in the buffer.  This is the code minus the
> piece that I need.  i realize that this is a very basic programming
> question but I do need the assist.
> 
> if ($FORM{'string1'}) {
>         unless ($FORM{'string1'} "CONTAINS  CHARACTERS OTHER THAN..."

	unless ($FORM{'string1'} !~ s/[0-5 ]/)


--
	"The early bird gets the worm, but
	 the second mouse gets the cheese."


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

Date: Mon, 08 Feb 1999 14:56:49 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: jglascoe@giss.nasa.gov
Subject: Re: NEWBIE Question about error checking string
Message-Id: <36BF4181.10F9DCAA@giss.nasa.gov>

Jay Glascoe wrote:
> 
> hi,
> 
>         unless ($FORM{'string1'} !~ s/[0-5 ]/)

whoops, out-smarted myself.  (in more ways than one...)

if ($my_string =~ /[^0-5 ]/)
{
	# "my_string" contains something other than [0-5 ]
	# So, do something with it...
}


	Jay
--
ping.


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

Date: Mon, 08 Feb 1999 14:51:40 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Parsing output from a program called within perl
Message-Id: <36BF4E5C.78636F3A@us.ibm.com>

kalikste@uiuc.edu wrote:
> 
> How can I parse input from a program called from system() as if it were
> comming from <STDIN>?  I don't think it should matter, but I am on a win32
> system (NT).

I think that you are (mis-|not )reading 'perdoc -f system'.  Especially
the sentence, "This is NOT what you want to use to capture the output
from a command, for that you should use merely backticks or qx//,..." 

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Mon, 08 Feb 1999 09:58:10 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: Perl vs. ASP for new project
Message-Id: <36BEB532.E6983756@eml.ericsson.se>

Sameer Samat wrote:
> 
>             How does database access performance with perl compare to access
> via ADO objects in ASP?

Using DBI is much faster than ADO, although the DBI API isn't quite as
complete - it's getting there. I did some simple benchmarking here and
found DBI to be about twice as fast as ADO, and that was using DBD::ODBC
(using ODBC rather than a specific library, e.g. Oracle, or Sybase). The
benchmark was against SQL Server.

>                         How big a role does connection pooling play here?

Connection pooling always plays a big role. Under Apache we use
Apache::DBI, if using PerlEx this is supported natively. These days on
NT servers connection pooling is best left to MTS.

>             Is there any way, via perl, to maintain a session state for a
> user across pages? (I didn't think so, but not sure)

Yes. If using mod_perl there's Apache::Session which does this. Unlike
ASP it can't store database connections or other OLE objects, but it's
usually sufficient.

>           In terms of overall performance, I've heard / read things going
> both ways.  There is a cache for compiled ASP scripts,
>             what about for PERL? ... each script is recompiled every time?

It depends on your execution model. If using normal CGI then yes,
there's a big performance hit. On NT you can use ISAPI perl which
maintains the interpreter in memory, but there's still a compile for
each script. Or you can move up to one of the better options - on NT
that's either PerlEx or Velocigen, on Apache that's mod_perl. Mod_perl
is incredibly powerful - it's like being able to write ISAPI dll's in
perl.

> Is there a way to keep the perl interpreter in memory, or does
>             that need to fire up every time as well?

See above.

>         Is Perl much slower on NT? and does this entire discussion pretty
> much come down to 'do you want to use NT or Unix?' ... from some reading
> I've done I'm beginning to believe that on NT you want to go the route of
> ASP ... but Unix Perl is going to be faster than ASP on NT.

It depends on what you want to spend. It's cheaper to do it all on Unix.

Of course there's always PerlScript, which is ASP written in Perl (ASP
is NOT equal to VBScript as most people think - ASP is just a framework
into which other languages fit). However PerlScript is quite a dog
performance wise ATM, although I've been assured that this will change
in the near future.

-- 
<Matt email="msergeant@ndirect.co.uk" />

| Fastnet Software Ltd              |   Perl in Active Server Pages   |
| Perl Consultancy, Web Development |   Database Design   |    XML    |
| http://come.to/fastnet            |    Information Consolidation    |


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

Date: Mon, 08 Feb 1999 12:06:38 -0500
From: "John T. Jarrett" <jjarrett@ecpi.com>
Subject: Re: Perl Webpage
Message-Id: <36BF199D.64B84406@ecpi.com>

Also, some web servers don't allow execution of '.pl' files; only '.cgi' which is easily fixed (or
checked at least) by changing extension

John





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

Date: Mon, 08 Feb 1999 14:28:36 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl, PHP, Python, ColdFusion, MS Frontpage, which one for beginner
Message-Id: <comdog-ya02408000R0802991428360001@news.panix.com>

In article <79m950$i4c$1@nnrp1.dejanews.com>, ghill@n2.net posted:

> I've been doing alot of reading and a little testing trying to decide what
> language I should commit to.

use the one that fits your needs.  languages are tools and as such
have different strengths and specialities.  you might even mix all
of the options that you mentioned.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Mon, 08 Feb 1999 13:48:03 -0500
From: Ed Bacher <evb@lucent.com>
To: chad@vcn.net
Subject: Re: Programming with Style
Message-Id: <36BF3163.40DC@lucent.com>

"Programming Pearls", by Jon Bentley. Still in print, according
to amazon.com.  Great reading. Although these pearls are pre-Perl,
they still apply.

Ed

chad@vcn.net wrote:
>
> wondering if anyone ran across a good book.  I heard of one
> called "The Pearls of Programming", but have never been able
> to find it in a store.
>


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

Date: 08 Feb 1999 20:19:00 +0100
From: Lars Marius Garshol <larsga@ifi.uio.no>
Subject: Re: Python vs. Perl vs. tcl ?
Message-Id: <wkr9s0hfff.fsf@ifi.uio.no>


* Ala Qumsieh
| 
| 1) [...] 2) [...]

I think these two arguments of yours are common fallacies, but will
not try to argue here. People in these two newsgroups are mostly fed
up with language wars and so I think it's better if we just agree to
differ on this.
 
| 3) He says "the documentation is hard to navigate". He shows an
| example of how he was unable to find out how to turn off output
| buffering very easily.

The example was badly chosen. I've removed that section now, since
getting it right would take time I'd rather spend on implementing the
CORBA Relationship service or writing about character sets.

| 4) He says "There are many Perl features built right into the
| language." I just can't see why this is a Bad Thing (tm).

Maybe it isn't for you, but it really freaks me out.
 
| 5) [...] If the author was unable to do something as easy as
| dereferencing an array of references, then I would not count on his
| experience to make any conclusions.

That's entirely up to you, of course. The section was written that way
to illustrate how non-intuitive this is for something that's supposed
to be a scripting language. Even C is more straightforward. 

That it also illustrates my boundless incompetence is just a
side-effect. :-)
 
| 7) He says that Python documentation is better than Perl's and
| mentions a "program" that generates the documentation in various
| formats. I wonder if that author knew about perldoc and the pod2*
| scripts.

Vaguely. Do they automatically get the signatures of subroutines and
methods right in the generated documentation?
 
| 8) He says Python's data structures are easier to use than Perl's. I
| wouldn't really comment on that since I don't know much of Python.
| But from my limited knowledge I would tend to agree with him there.

I'm glad to hear it. This was what I tried to illustrate with the
array stuff.
 
| My conclusion: [...] I enjoyed reading it, but I would rather have
| another opinion from someone that knows both Perl and Python very
| well.

That's OK. It was intended more as a way of letting out steam and
being enjoyable than changing the world in a week.
 
| PS. I intend to read more on Python in the next few days. I will try
| to draw my own conclusions then and compare them with the others.

Great! If you write something about it please let me know and I'll put
up a link to it. (I can even include it if you want.)

(Followups mercifully set out of c.l.tcl. :)

--Lars M.


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

Date: 08 Feb 1999 20:07:01 +0100
From: Lars Marius Garshol <larsga@ifi.uio.no>
Subject: Re: Python vs. Perl vs. tcl ?
Message-Id: <wksocghfze.fsf@ifi.uio.no>


* Sam Holden
| 
| A friend of mine sent me a copy of that article a fairly long time ago. I
| also had some problems with some of it's content and added some comments to
| my copy of the page. If anyone is interested you can find the annotated 
| version of the page at :
| 
| http://www.cs.usyd.edu.au/~sholden/pythonperl.html

I've added a link to this article now, so that people who are
interested can find it.

Also, I've updated it a bit. The section on documentation has been
removed. I still think it's basically right (and several perlites
agree), but researching that section enough to get it right would take
a lot of time I'd rather spend on other things.
 
| Also newer versions of Perl have made even more of the articles
| points invalid. The obvious one being the qr{} syntax for regexes is
| one obvious example.

I've been told about this, but would really like to see an example
before removing the text. (For now I've just inserted a comment in
parenthesis.)
 
| My formatting is bad and my spelling is attrocious and since I
| wasn't intending on giving out the url in such a public place. I'm
| sure I made some errors in fact as well.

Let me know if you want me to remove the link to it.
 
| Anyway take a look if your interested (the full text of the original
| is their, and if those style sheet things work my stuff should be in
| italics)...

Well, most of it, anyway. :)

Followups set out of cl.tcl, since this has little to do with tcl.

--Lars M.


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

Date: Mon, 08 Feb 1999 15:23:32 -0500
From: Ben Smith <bsmith@perf.zko.dec.com>
Subject: Question: using write to format strings in a $variable or @list
Message-Id: <36BF47C4.B6C1A932@perf.zko.dec.com>

I would like to be able to use format and write to generate a page held
only in
memory, without having to write to a file and then read it back in. Does
anyone
have an idea of how I might be able to do this?
-- 
work: bsmith@perf.zko.dec.com = Ben Smith = ZKO2-3R55 = 603-884-2836 
home: ben@roninhouse.com = 603-924-4131 = FAX: 603-924-3582


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

Date: Mon, 8 Feb 1999 13:46:57 -0500
From: fisherm@tce.com (Mark Leighton Fisher)
Subject: Re: Serial Port in WinNT and OS/2
Message-Id: <MPG.1128fb2bf9476ec29896aa@news-indy.indy.tce.com>

In article <36BF1F0B.FCCDF171@siemens.at>, peter.prinz@siemens.at says...
> Hi, 
> 
> Im trying to open the serial ports for read and 
> write access in WinNT and OS/2. I have read the 
> Perl FAQ (Part 8), but it was of little help.
> (The link for the sysopen command was wrong!)

I suspect that if it can be done through normal Perl mechanisms, there's 
some funkiness with ioctl() you'll have to perform.  Which funkiness, I 
don't know... 
==========================================================
Mark Leighton Fisher          Thomson Consumer Electronics
fisherm@.tce.com              Indianapolis, IN
"Browser Torture Specialist, First Class"


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

Date: Mon, 8 Feb 1999 13:40:18 -0600
From: "Spike White" <spike_YYwhiteYY@YYdellYY.com>
Subject: Re: Simple Question About a Scalar
Message-Id: <79ndvv$efo$1@obsidian.us.dell.com>

$date = system("date +\%m\%d");

Double-quoted strings are variable-interpolated.  Meaning that
perl is interpreting %m as a (currently-undefined) hash.  Since
it's currently undefined, in this scalar context I'd guess it has a value
of  0.

What surprises me is that you don't get two 0's.  If I'm correct, it's
as if you invoked date as so:

    date +00

Spike

Pete Holsberg wrote in message <79fi77$171$1@lawrenceville.mccc.edu>...
>I would like to create a filename from a string with the
>month and day (eg, 0204) appended.
>
>I used
> $date=system("date +%m%d");
>
>to get the date but when I append --
>
> $name="XYZZY"."$date";
>
>perl appends the numeric value, 0, and I end up with
>
> XYZZY0
>
>instead of
>
> XYZZY0204
>
>How can I get what I want?
>
>Thanks,
>pete




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

Date: Mon, 08 Feb 1999 14:55:07 -0500
From: Gregory Rohman <greg@erinedwards.com>
Subject: Sorting on multiple fields
Message-Id: <36BF411B.DC7C9BE0@erinedwards.com>

I have a backspace-delimited text file that I am using to store data
entries. Three of the fields contain values for the month, day, and year
of the entry (the date is inputted from the HTML form and not generated
by the Perl script).

Is there a way to sort the records in reverse-chronological order? I
don't need them sorted in the actual text data file... they just need to
be sorted by day, month, and year when they are printed back out.

I modified some code from the perl.com site to sort by a particular
field:

######## Begin code #########
  open(DATAFILE, $INPUT_FILE) || print "Cannot Open Input File!";
  @unsortedLines = <DATAFILE>;

  @sortedByYear = sort {
    @alist = split(/\\/, $a);
    @blist = split(/\\/, $b);
    $alist[7] <=> $blist[7];
  } @unsortedLines;
######## End Code ##########

In the above code, index 7 in the a and b lists is the year field. This
code will sort by the year, but I also need it to sort by the month and
day (indexes 5 and 6, respectively).

Thanks in advance. Any help is greatly appreciated.

 
-- 

Gregory E. Rohman, Producer  |  greg@erinedwards.com
Erin/Edwards Communications  |  http://www.erinedwards.com/greg
http://www.erinedwards.com


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

Date: Mon, 08 Feb 1999 14:41:48 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Sorting on multiple fields
Message-Id: <36BF4C0C.30DF9F59@us.ibm.com>

Gregory Rohman wrote:

> Is there a way to sort the records in reverse-chronological order? I
> don't need them sorted in the actual text data file... they just need to
> be sorted by day, month, and year when they are printed back out.

The FAQ is your friend:

http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#How_do_I_sort_an_aray_by_anyth

$ perldoc perlfaq4

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Mon, 08 Feb 1999 20:39:08 +0100
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: String splitting.
Message-Id: <36BF3D5B.AF84E231@xs4all.nl>

Why you don't explain it?
It's  simple

@array = split(/ /, $string);

Between the spaces must come what should be the split section in the string. In
this case it is a single space.
You can call each array with: $array[0] (The first)  $array[1]  (The second)


Scratchie wrote:

> om7@cyberdude.com wrote:
> : I've got a string, something like $string = abcd.efg, say. Can someone remind
> : me how I would get the part of of the string before the full stop.
>
> perldoc -f split
> perldoc -f index
> perldoc perlre
>
> Depending on what you want to do with it.
>
> --Art
>
> --
> --------------------------------------------------------------------------
>                     National Ska & Reggae Calendar
>                   http://www.agitators.com/calendar/
> --------------------------------------------------------------------------



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

Date: Mon, 8 Feb 1999 13:45:27 -0600
From: "Spike White" <spike_YYwhiteYY@YYdellYY.com>
Subject: Re: String splitting.
Message-Id: <79ne9l$eit$1@obsidian.us.dell.com>

$firstpart = (split /\./, $string)[0];

or

$string =~ s/(\w+)\..*\n//;


om7@cyberdude.com wrote in message <79n4kd$7dm$1@nnrp1.dejanews.com>...
>I've got a string, something like $string = abcd.efg, say. Can someone
remind
>me how I would get the part of of the string before the full stop.
>
>Thanks.
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: Mon, 08 Feb 1999 20:15:16 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: String splitting.
Message-Id: <oBHv2.689$wD5.119807@news.shore.net>


Frank de Bot <debot@xs4all.nl> wrote:
: Why you don't explain it?

Because I don't understand it as well as the people who wrote the
documentation. I may give him incomplete or inaccurate information without
meaning to, whereas the documentation is full of useful information. It
may not be germane to the problem he's trying to solve *right* *now*, but
reading it is likely to give him information that will help him in the
future.

--Art


-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Mon, 08 Feb 1999 20:17:10 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: String splitting.
Message-Id: <aDHv2.691$wD5.119807@news.shore.net>

Frank de Bot <debot@xs4all.nl> wrote:
: Why you don't explain it?

See my previous post.

: It's  simple

: @array = split(/ /, $string);

PS: This answer is wrong!

:> om7@cyberdude.com wrote:
:> : I've got a string, something like $string = abcd.efg, say. Can someone remind
:> : me how I would get the part of of the string before the full stop.

--Art

-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: 8 Feb 1999 19:04:09 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: swap space
Message-Id: <slrn7bude3.hr4.fl_aggie@enso.coaps.fsu.edu>

On Mon, 08 Feb 1999 10:46:52 -0600, Ralph N <ralph@inlink.com> wrote:

+ anyone know how to make perl allow child processes to use swapspace ?

Ummm...isn't this an OS issue? I thought, like, swap space was there,
and that the OS decides what processes get written into that space,
and that you don't really want your processes to swap if you can avoid
it?

Confused,

James


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

Date: Mon, 8 Feb 1999 13:49:22 -0600
From: "Spike White" <spike_YYwhiteYY@YYdellYY.com>
Subject: Re: trouble invoking script from shell prompt
Message-Id: <79neh0$ej0$1@obsidian.us.dell.com>

Works fine for me.  UNIX displays the next prompt and when
I check the specified output file (count.dat), there's a 0 in it, exactly
as expected.

Spike

Andy Goodman wrote in message <79fjjb$p8v$1@pacifica.access.ch>...
>I dont get any error messages:
>
>unix displays the next prompt, and when I check the error_log file there
are
>no new entries.
>
>
>Spike White wrote in message<79fd26$l1l$1@obsidian.us.dell.com>...
>>What error messages do you get back when you attempt to
>>run it from the shell?
>>
>
>
>




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

Date: Mon, 8 Feb 1999 14:02:55 -0600
From: "Spike White" <spike_YYwhiteYY@YYdellYY.com>
Subject: Re: What Am I Doing Wrong Here?
Message-Id: <79nfaf$ep9$1@obsidian.us.dell.com>

You can't have a "hash of hashes",  all hash key/values must be
scalars.  You can however, make the value be a "reference to a
hash".



John Passaniti wrote in message ...
>The intent here was to create a hash of anonymous hashes, and then iterate
>through the keys in sorted order:
>
>
>$x{a}{b}{c} = 1;
>$x{a}{b}{d} = 2;
>$x{a}{c}{x} = 3;
>$x{b}{a}{a} = 4;
>
>foreach $first (sort keys %x) {
>  foreach $second (sort keys $x{$first}) {
>    foreach $third (sort keys $x{$first}{$second}) {
>       print "$first $second $third = $x{$first}{$second}{$third}\n";
>    }
>  }
>}
>
>Perl complains on the second and third foreach that the argument to keys
>must be a hash, not a hash element.  This confuses me.  My guess is that
>context for "keys" is set by the dollar-sign of it's argument.
>
>Can someone explain to me what I'm doing wrong, and a way to fix it?
>
>
>
>
>




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

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

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