[15928] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3341 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 13 11:05:40 2000

Date: Tue, 13 Jun 2000 08:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <960908711-v9-i3341@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 13 Jun 2000     Volume: 9 Number: 3341

Today's topics:
    Re: Appending and View with Perl? <raphaelp@nr1webresource.com>
    Re: ASP and Perl <samay1NOsaSPAM@hotmail.com.invalid>
    Re: Attempting to parse malformed XML (Tad McClellan)
    Re: Can't open perl script <red_orc@my-deja.com>
    Re: Can't open perl script (jason)
        CPAN/"Net::FTP" package error reported after 5.6.0 upgr <dme7@cornell.edu>
        Easy CGI question <srh104@york.ac.uk>
    Re: Easy CGI question <raphaelp@nr1webresource.com>
    Re: Easy CGI question newsposter@cthulhu.demon.nl
    Re: Easy CGI question <srh104@york.ac.uk>
    Re: Easy CGI question <flavell@mail.cern.ch>
        Generating an excel page by submitting a form <bob.rockNOboSPAM@intelligencia.com.invalid>
    Re: Help wtih Regular Expression (Tad McClellan)
        How do I... <altavistaNOalSPAM@agentkhaki.com.invalid>
    Re: How do I... <raphaelp@nr1webresource.com>
    Re: How do I... <trevor@trevorsky.com>
    Re: Larry Rosler interview on perl.com! <care227@attglobal.net>
    Re: Larry Rosler interview on perl.com! <care227@attglobal.net>
    Re: Length of an Array (Tad McClellan)
    Re: Length of an Array (Eric Bohlman)
        ls <map@usnavy.gov>
        perl system call problems, VSS cmd line invinfo@my-deja.com
        reading a file chris2037@my-deja.com
    Re: reading a file <aqumsieh@hyperchip.com>
    Re: reading a file (Tad McClellan)
        Simulating a key press using PERL <mrizzo@ismd.ups.com>
        sorting algorithim <broberts@cbu.edu>
    Re: sorting algorithim <panderse@us.ibm.com>
        sorting an array <dpalmeNOSPAM@unitedtraffic.com>
    Re: sorting an array <sariq@texas.net>
    Re: sorting an array <dpalmeNOSPAM@unitedtraffic.com>
    Re: sorting an array <blah@nospam.com>
    Re: sorting an array <trevor@trevorsky.com>
    Re: sorting an array (Eric Bohlman)
    Re: uses for PERL <red_orc@my-deja.com>
        web page and serial port ringo4269@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 13 Jun 2000 15:58:26 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: Appending and View with Perl?
Message-Id: <8i5enk$ffm$1@news.online.de>

Actually I haven't checked to see whether it works, but it "should"... :-)

$/ = undef;
open FILE, "a.html";
$a_html = <FILE>;
close FILE;
$/ = "\n";

$/ = undef;
open FILE, "b.html";
$b_html = <FILE>;
close FILE;
$/ = "\n";

$/ = undef;
open FILE, "c.html";
$c_html = <FILE>;
close FILE;
$/ = "\n";

$/ = undef;
open FILE, "d.html";
$d_html = <FILE>;
close FILE;
$/ = "\n";

$all_together = $a_html.$b_html.$c_html.$c_html;

print "Content-type: text/html\n\n";
print "$all_together;"

vivekvp <vivekvp@spliced.com> wrote in message
news:8i56k5$p40$1@nnrp1.deja.com...
>
>
> Hello,
>
> I have files that come in as a feed - a.html, b.html, c.html, d.html
>
> How do i append them all together and display them on one page and make
> it viewable on the web - since they are html - in perl?
>
> Thanks,
>
> V
> --
> He who fights and runs away, lives to run another day!
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Tue, 13 Jun 2000 07:21:58 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: ASP and Perl
Message-Id: <2022b442.754363c9@usw-ex0102-013.remarq.com>

No, I am not talking CGI.
 I am talking about PerlScript which should be handled by ASP.


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 13 Jun 2000 08:34:39 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Attempting to parse malformed XML
Message-Id: <slrn8kcaiv.29p.tadmc@magna.metronet.com>

On Tue, 13 Jun 2000 01:50:12 -0700, Charles Capps <capps@solareclipse.net> wrote:
>I've been given the job of taking exported data from a certain extremely
>brain-damaged and poorly designed application and rewriting it into a format
>that an in-house application can read.
>
>The only form of exported data is XML.  


No it isn't.


>The XML that it produces has
>*CERTAIN* tag elements unquoted.  Example:
><message body="Laa dee daa" number=000001 author="Lame dude">


That is not XML. Quoting attributes is _required_ by XML.

If the attributes are not quoted, then the data is not XML.

   The only form of exported data is "some angle-brackety text
   that sorta kinda looks like XML".

You are allowed to leave off the quotes in _SGML_, but that
is subject to restrictions of the form of the value, and
your "number" attribute value does not conform to the
restrictions, so you don't have SGML either.

( the value must start with a _name start character_. Digits
  are not name start characters.
)


>Unfortunately, nothing will parse it.  


If you can identify what the data is, you may be able to find
a program that can parse it.

So far we only know what it _isn't_  :-(


>Expat (XML::Parser, etc) chokes and
>dies when it comes across the unquoted elements.


Expat only works on XML.

You do not have XML.


>I'm very reluctant to attempt to write my own parsing routine.  


That is a sensible attitude.


>I'm currently
>using a series of regexes to split apart the tag, but it's difficult, tedious
>work due to the randomness of the element locations, values, and lengths, as
>well as tags.


It (using regexs rather than a real parser with a stack) is 
also impossible.

You should use a parser for parsing (though that too is impossible
if you cannot identify what format the data is in).


>Does anyone have any recommendations, pointers, hints, URLs, or
>perldoc/manpages?  ;)
>
>(Sigh, why can't this be like LAST week's XML project!  That was easy once I
>found the documentation.  Blech!)


Things are easier when they follow standards.

All you need to do is identify what standard the data follows
(though I expect you may find that it does not follow any
 standard...)



   1 while s/(<[^>]*? [a-zA-Z][a-zA-Z0-9.-]*\s*=)([^"> ]+)/$1"$2"/;

This may work for some (or many) cases, but can still end
up doing the wrong thing...



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


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

Date: Tue, 13 Jun 2000 13:03:16 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Can't open perl script
Message-Id: <8i5bea$sl6$1@nnrp1.deja.com>

In article <jSc15.2521$k2U.9109742@news.randori.com>,
  "Roger Brown" <webmaster@navarone.com> wrote:

> Now, the dos command, still in the ~eg sub-dir, I receive the response
> "Can't open perl script "example": No such file or directory".  The
> example.pl is still there.  I have copied it to perl\bin and tried
> there; same result. It's as though perl.exe is looking
> for "example.pl" in a place where it doesn't exist instead of looking
> under its own nose. BUT...
>
> When I dbl-click example.pl from the explorer, I can see the dos
> window display the "Hello, etc." properly.

if the file name is example.pl, you need to tell that to perl:

perl example.pl

looks like the file got renamed with a .pl extension.

>
> Anyone have any ideas what I have done wrong and how to fix it?
>
> Thanks in advance for all who read and or respond to this
> post/question.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 13 Jun 2000 13:22:28 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Can't open perl script
Message-Id: <MPG.13b0d2c1327447f3989735@news>

Roger Brown writes ..
>My apologies for the length of this post.  I just want to provide all the
>info up front that I think someone might ask....
>
>I have downloaded and installed ActivePerl 5.6, build 613 (the current
>version).  The only change I made is to install on drive e: instead of c:.
>Installation went fine.  Added path to E:\PERL\BIN.
>In e:\perl\eq threre is a test file called example.pl.  I was told to run
>this like so: "perl example".  I did.  It worked just fine, displaying on
>the screen "Hello from ActivePerl!" as it should.  Then...
>
>While 'screwing around where I probably shouldn't be', in windows explorer,
>I double clicked on config.pl.  (I'm not sure if this caused my problem.)
>Now, the dos command, still in the ~eg sub-dir, I receive the response
>"Can't open perl script "example": No such file or directory".  The
>example.pl is still there.  I have copied it to perl\bin and tried there;
>same result. It's as though perl.exe is looking for "example.pl" in a place
>where it doesn't exist instead of looking under its own nose. BUT...
>
>When I dbl-click example.pl from the explorer, I can see the dos window
>display the "Hello, etc." properly.
>
>Anyone have any ideas what I have done wrong and how to fix it?

if (as you say in your post) you're really typing

  perl example

then that will not work .. you need to type

  perl example.pl

or probably just

  example.pl

because ActivePerl should have made the .pl association with perl.exe 
for you

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 13 Jun 2000 09:28:08 -0400
From: Doug Elias <dme7@cornell.edu>
Subject: CPAN/"Net::FTP" package error reported after 5.6.0 upgrade
Message-Id: <86d7lln21j.fsf@research.johnson.cornell.edu>


G'day ...

After recently upgrading from 5.005 to 5.6.0, my previously-working
CPAN started throwing errors in Net::FTP:

========================================================================
cpan> i /classgen/
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
  ftp://cpan.nas.nasa.gov/pub/perl/CPAN/authors/01mailrc.txt.gz
Fetching with Net::FTP:
  ftp://cpan.nas.nasa.gov/pub/perl/CPAN/authors/01mailrc.txt.gz
Can't locate object method "new" via package "Net::FTP" at
/usr/local/lib/perl5/5.6.0/CPAN.pm line 1860.
========================================================================

This is on a Sun E3500 (Solaris 2.7), default sun4-solaris build:

========================================================================
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.7, archname=sun4-solaris
    uname='sunos research.johnson.cornell.edu 5.7 generic_106541-08
    sun4u sparc sunw,ultra-enterprise '
    config_args='-Dcc=gcc -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef 
    usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.7.2.3
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',    
    lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt -lsec
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
============================================================================

"make test" reports no errors, "make install" ditto.  Before I send in
a bug-report, I just figured I'd ask around and see if anyone has hit
this and has a quick-fix for it.

 ...and while I've got your ear/eye: "./roffitall -groff" creates the
documentation just fine, but the ToC is blank when printed: just the
header, no ToC.  I've generated it using pod2man and pod2html so I've
got what I really need, but if anyone has hit this and figured out how
to make it work, I'd like to hear from you.

Thanks for your attention,
doug


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

Date: Tue, 13 Jun 2000 14:15:20 +0100
From: "Simon H." <srh104@york.ac.uk>
Subject: Easy CGI question
Message-Id: <394633E8.CEBC5B15@york.ac.uk>

You'd never guess, but I'm new to Perl & CGI.

http://www.pedlars.f2s.com/cgi-bin/first.cgi

The script just has the #!/usr/bin/perl line, and what you see is a
string wrapped in 'print'. So why won't the browser actually treat it as

HTML, rather than plain text?

Permissions are 755 etc etc etc

TIA, Simon






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

Date: Tue, 13 Jun 2000 15:51:37 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: Easy CGI question
Message-Id: <8i5e91$fbd$1@news.online.de>

The heading (content-type...) must be exactly as follows:

print "Content-type: text/html\n\n";

Notice the 2 extra "\n" (newline) characters. If you have it like this,
everything should work just perfect!

Simon H. <srh104@york.ac.uk> wrote in message
news:394633E8.CEBC5B15@york.ac.uk...
> You'd never guess, but I'm new to Perl & CGI.
>
> http://www.pedlars.f2s.com/cgi-bin/first.cgi
>
> The script just has the #!/usr/bin/perl line, and what you see is a
> string wrapped in 'print'. So why won't the browser actually treat it as
>
> HTML, rather than plain text?
>
> Permissions are 755 etc etc etc
>
> TIA, Simon
>
>
>
>




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

Date: 13 Jun 2000 13:50:42 GMT
From: newsposter@cthulhu.demon.nl
Subject: Re: Easy CGI question
Message-Id: <8i5e7i$11f$1@internal-news.uu.net>

Simon H. <srh104@york.ac.uk> wrote:
> You'd never guess, but I'm new to Perl & CGI.

> http://www.pedlars.f2s.com/cgi-bin/first.cgi

> The script just has the #!/usr/bin/perl line, and what you see is a
> string wrapped in 'print'. So why won't the browser actually treat it as

> HTML, rather than plain text?

Looks like there is a problem with the Content-type. Seems the
server sends a text/plain one, thus your text/html one has no effect.

If you have a CGI question, a group like comp.infosystems.www.authoring.cgi
might be a more appropriate place.

Erik



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

Date: Tue, 13 Jun 2000 15:27:55 +0100
From: "Simon H." <srh104@york.ac.uk>
Subject: Re: Easy CGI question
Message-Id: <394644EB.EF69C05F@york.ac.uk>

Thanks guys, it was a combination of those problems, mixed with a good helping
of my own ineptitude.

Will trouble CIWAC next time...

Simon H.





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

Date: Tue, 13 Jun 2000 16:27:29 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Easy CGI question
Message-Id: <Pine.GHP.4.21.0006131617130.10517-100000@hpplus03.cern.ch>


First of all, CGI is not on-topic here.  Any answers offered 
should be treated with additional scepticism.

On Tue, 13 Jun 2000, Raphael Pirker wrote:

> The heading (content-type...) must be exactly as follows:

"must"?  "exactly"??

> print "Content-type: text/html\n\n";

CA-2000-02 says no.  Every text content-type needs a charset
explicitly specified in order to conform with this security advisory.

The Content-type: does not have to come last in the CGI response
headers.

So, what would be wrong with e.g this (aside from perl coding style):

print "Content-Type: text/html; charset=koi8-r\n";
print "Vary: *\n\n";

Looks to me to be a valid CGI response, but I could be mistaken.

Surely you'd be better advised to summarise the principles, or point
to the specification, than to write down one simple example of a
conforming response and claim that it "must" be "exactly" that.



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

Date: Tue, 13 Jun 2000 07:47:27 -0700
From: Bob Rock <bob.rockNOboSPAM@intelligencia.com.invalid>
Subject: Generating an excel page by submitting a form
Message-Id: <2271b8aa.52600547@usw-ex0104-033.remarq.com>

Hi,
I'd like to place like a button an a html page that when clicked
generates a excel file. I once did this on an Oracle web server:
I simply created a form that once submited generated and
returned a file with a csv extention so that excel and not the
browser would open it. How can the same thing be done on an IIS
web server. Any idea is welcome. Thanks.


Bob Rock







* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 13 Jun 2000 07:58:24 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help wtih Regular Expression
Message-Id: <slrn8kc8f0.29p.tadmc@magna.metronet.com>

On Tue, 13 Jun 2000 10:25:13 GMT, amitr@w-o-i.com <amitr@w-o-i.com> wrote:
>
>
>> > $string =~ s!<\!--(.*?)-->!<A NAME=\"$1\">!gi;
>>
>>     <!--  How about a comment which
>> 	spans lines? -->
>>
>
>Well.. one can always read the entire para or file in a single variable
>and use the regex. with $/ varibale. right?


Yes. (but $/ doesn't have anything to do with pattern matching, 
you need the s///s option, not $/)


<!--  How about a comment which
      has spaces in the "comment end"?  --    >

Then when you patch that one, we'll give you another one.

When you patch that, we'll give you yet another one.

It is futile to try and make regexes that can handle all legal
HTML. Use a module!


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


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

Date: Tue, 13 Jun 2000 06:34:24 -0700
From: Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid>
Subject: How do I...
Message-Id: <0a0133f8.1b365540@usw-ex0109-068.remarq.com>

I'm pretty much a newbie when it comes to CGI scripts. I'm
more of a web designer (see http://www.agentkhaki.com and
http://www.wyoung.org for some examples). I know some
JavaScript, but that's about all besides HTML. Here's what
I need to know.

1) If I want users to log into a website, or log into a
specific area (say a portal page, that would remember their
settings) how would I do this? It seems that I would use
htaccess but I can't figure out how to interact with this
file using forms on a page (ie, I don't want the stupid
little box popping up asking for a username and password).
Maybe I'm completely off base...

2) This is a little up in the air, but how do services like
ZDNetmail check other POP3 mail accounts. They ask for the
mail server address, user name and password, and then
BLAMO! they can check your email for you... I would imagine
this is a complicated script of some sort... any ideas?

Thanks for any and all help


* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


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

Date: Tue, 13 Jun 2000 15:53:25 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: How do I...
Message-Id: <8i5ecc$fcu$1@news.online.de>

answer for #2:

Check http://www.endymion.com/products/mailman


Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid> wrote in message
news:0a0133f8.1b365540@usw-ex0109-068.remarq.com...
> I'm pretty much a newbie when it comes to CGI scripts. I'm
> more of a web designer (see http://www.agentkhaki.com and
> http://www.wyoung.org for some examples). I know some
> JavaScript, but that's about all besides HTML. Here's what
> I need to know.
>
> 1) If I want users to log into a website, or log into a
> specific area (say a portal page, that would remember their
> settings) how would I do this? It seems that I would use
> .htaccess but I can't figure out how to interact with this
> file using forms on a page (ie, I don't want the stupid
> little box popping up asking for a username and password).
> Maybe I'm completely off base...
>
> 2) This is a little up in the air, but how do services like
> ZDNetmail check other POP3 mail accounts. They ask for the
> mail server address, user name and password, and then
> BLAMO! they can check your email for you... I would imagine
> this is a complicated script of some sort... any ideas?
>
> Thanks for any and all help
>
>
> * Sent from AltaVista http://www.altavista.com Where you can also find
related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is
Beautiful




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

Date: Tue, 13 Jun 2000 07:56:49 -0700
From: "Trevor Sky Garside" <trevor@trevorsky.com>
Subject: Re: How do I...
Message-Id: <bXr15.3572$qp.147684@nntp1.onemain.com>

comp.infosystems.www.authoring.cgi is the place to ask.  This is a CGI
problem, and not a Perl problem.

--Trevor

"Agentkhaki" <altavistaNOalSPAM@agentkhaki.com.invalid> wrote in message
news:0a0133f8.1b365540@usw-ex0109-068.remarq.com...
> I'm pretty much a newbie when it comes to CGI scripts. I'm
> more of a web designer (see http://www.agentkhaki.com and
> http://www.wyoung.org for some examples). I know some
> JavaScript, but that's about all besides HTML. Here's what
> I need to know.
>
> 1) If I want users to log into a website, or log into a
> specific area (say a portal page, that would remember their
> settings) how would I do this? It seems that I would use
> htaccess but I can't figure out how to interact with this
> file using forms on a page (ie, I don't want the stupid
> little box popping up asking for a username and password).
> Maybe I'm completely off base...
>
> 2) This is a little up in the air, but how do services like
> ZDNetmail check other POP3 mail accounts. They ask for the
> mail server address, user name and password, and then
> BLAMO! they can check your email for you... I would imagine
> this is a complicated script of some sort... any ideas?
>
> Thanks for any and all help
>
>
> * Sent from AltaVista http://www.altavista.com Where you can also find
related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is
Beautiful




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

Date: Tue, 13 Jun 2000 10:07:35 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <39464027.196736AD@attglobal.net>

Henry wrote:
> 
> 
> Microsoft's introduction of proprietary extensions has _crippled_ the
> web.  Internet Exploiter has probably set us back 4 years in the paltry
> 5 years that it has been in Microsoft's hands.  We'd be cruising the web
> with 2004 tech if it hadn't been for those bloody extensions.
> 

Maybe I'm not as web savy as you, but I haven't seen the web get
crippled by anything but its own growth.  What specific extensions
are you talking about here?


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

Date: Tue, 13 Jun 2000 10:13:52 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <394641A0.47AC9E87@attglobal.net>

Henry wrote:
> 
> I've said it before (at least 3 times) and I'll say it again:
> 
> NO approachable documentation ships with the standard distribution of
> Perl.
> 
> If it ain't there, it doesn't matter how good you OS skills are, you
> won't find it.
> 

I guess this begs the question as to what you consider approachable.
I find the perlfaq VERY informative and helpfull, and while it may
take a second for a new user to figure out how to type:

$ perldoc perldoc

I hardly see that as an obstacle.  The documentation is also handily
available on perl.com if you don't have your perl distro handy.  
The perldocs are MASSIVE.  While they may be somewhat technically 
complicated (perlxstut... ugh) they are topical and accurate.  So I 
ask again... is it the format of the documentation or the content 
that you speak against?


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

Date: Tue, 13 Jun 2000 08:43:20 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Length of an Array
Message-Id: <slrn8kcb38.29p.tadmc@magna.metronet.com>

On Mon, 12 Jun 2000 22:19:43 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>crazyCoder wrote:
> 
>> I'm trying to get the length of an array
>> stored in a hash, is there a short-cut
>> for this?
> 
>> I know that $#array will give the length of @array...
>
>Others have posted code snippets for you.
>
>* grins *
>
>Yes, $#array does give you a length of
>an array, just as $#array+1 gives you a
>length of an array.


"$#array" and "$#array + 1" are different numbers.

How can an array have two different lengths?


>It's all a matter of perspective and,
>perhaps a bit of imagination, a quality
                  ^^^^^^^^^^^
>often sorely lacking.


Mathematics is not fiction.


>If you are like me and think in terms
>of pure mathematics, 


If you are imagining that there are 2 lengths of an array,
then you are not doing mathematics.


>counting numbers
>begin with zero and end with nine. 


I think that mathemeticians are able to count beyond nine...


>All
>numbers beyond this, are variations on
>zero through nine, inclusive.


"characters" are not "numbers".

Mathematics uses symbols a lot.

You need to know what the symbols mean to make sense of it.


>For a casual human perspective, you 
>would add one to your array length
>to pacify the minds of the doltishly
>unimaginative and average people.


If you need to add one to get the length of the array, then
the original value was NOT the length of the array.


>However, this code will make you stand out
>in a conformist crowd; it's different.


So does wearing your underwear outside of your pants.


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


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

Date: 13 Jun 2000 14:53:34 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Length of an Array
Message-Id: <8i5hte$eel$2@nntp9.atl.mindspring.net>

Tad McClellan (tadmc@metronet.com) wrote:
: On Mon, 12 Jun 2000 22:19:43 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
: >Yes, $#array does give you a length of
: >an array, just as $#array+1 gives you a
: >length of an array.
: 
: 
: "$#array" and "$#array + 1" are different numbers.
: 
: How can an array have two different lengths?
: 
: 
: >It's all a matter of perspective and,
: >perhaps a bit of imagination, a quality
:                   ^^^^^^^^^^^
: >often sorely lacking.
: 
: 
: Mathematics is not fiction.

Anyone else here ever read _The Education of H*Y*M*A*N K*A*P*L*A*N_ by 
Leo Rosten (aka "Leonard Q. Ross")?



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

Date: Tue, 13 Jun 2000 16:46:40 +0200
From: "MAP" <map@usnavy.gov>
Subject: ls
Message-Id: <0E16861EE7BCD111BE9400805FE6841F107B3E8F@c1s5x001.cor.srvfarm.origin-it.com>

how can I get the files and directories (name and size) from PERL?






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

Date: Tue, 13 Jun 2000 14:49:57 GMT
From: invinfo@my-deja.com
Subject: perl system call problems, VSS cmd line
Message-Id: <8i5hmd$1io$1@nnrp1.deja.com>

I am working in a WinNT environment.

I am trying to replicate our Project directory structure ( tree ) in
VSS,
but I only need to store the .pm files.
There are 200 subdirectories that have .pm files.
The whole tree is 100 MB, the .pm's use 8 MB.
Using the VSS cmd line  ( ss ... )
I have tried the -R feature but it only works on projects ( get, etc. )

I have tried some command line / cmd line VSS commands. ( ss Add *.pm )

I have successfully run some scripts with system call.
i.e.
system "dir *.pm";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
But just about at wits end trying to find my problem.
Most of the script runs fine up until this line
system "E:\Progra~1\VSS\Win32\ss Add tiny.pm -Y -C";

Although I think this should work, I have tried numerous Variations:
Program Files	vs  Progra~1
Upper/lower case on  VSS and Win32
with or without  "E:" 	- I am on that drive.
( Full path/file qualification shouldn't hurt )

using the following:
$cmd = "....";
system $cmd;		or system "$cmd";

trying to add  *.pm 	I don't think the * needs to be \*


Any Suggestions ?  Clues ?  Am I doing something Foolish ?
Suggestions welcome ( Thanks in advance )

invinfo@enteract.com  	(708) 524-1922
rkattke@nar.com		(312) 329-8696


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 13 Jun 2000 12:57:10 GMT
From: chris2037@my-deja.com
Subject: reading a file
Message-Id: <8i5b2u$san$1@nnrp1.deja.com>

Hi, is there a simple way (minimum number of lines of code) of reading a
comma separated file where numbers are unquoted, strings are in double
quotes into an array. Obviously I want to ignore commas within double
quoted strings. Some code can be hacked together using regex but I
thought there has to be a cleverer way. Thanks.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 13 Jun 2000 13:52:58 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: reading a file
Message-Id: <7a1z21bscl.fsf@merlin.hyperchip.com>


chris2037@my-deja.com writes:

> Hi, is there a simple way (minimum number of lines of code) of reading a
> comma separated file where numbers are unquoted, strings are in double
> quotes into an array. Obviously I want to ignore commas within double
> quoted strings. Some code can be hacked together using regex but I
> thought there has to be a cleverer way. Thanks.

It is certainly doable, but still using regexps. And, guess what? It's a
FAQ! In perlfaq4:

	How can I split a [character] delimited string except when 
	inside [character]? (Comma-separated files) 

--Ala


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

Date: Tue, 13 Jun 2000 08:58:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: reading a file
Message-Id: <slrn8kcc0j.2kb.tadmc@magna.metronet.com>

On Tue, 13 Jun 2000 12:57:10 GMT, chris2037@my-deja.com <chris2037@my-deja.com> wrote:

>Hi, is there a simple way (minimum number of lines of code) of reading a
>comma separated file


Yes.

Use a module that understands the CSV file format.


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


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

Date: Tue, 13 Jun 2000 09:56:06 -0400
From: "Mike Rizzo" <mrizzo@ismd.ups.com>
Subject: Simulating a key press using PERL
Message-Id: <8i5ei1$9t1@innsrv.ismd.ups.com>

Is there a way to simulate a key press through perl.
The situation is as follows, a piece of code runs and
then it prompts the user with a Message box that needs
to be cleared in order to continue. I would like to have
the Perl code "press" the enter key so that the script
can continue.

Any ideas?






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

Date: Tue, 13 Jun 2000 09:04:45 -0500
From: Kefka_X <broberts@cbu.edu>
Subject: sorting algorithim
Message-Id: <Pine.GSO.4.05.10006130903150.1245-100000@sheba.cbu.edu>


Hello,

I need help creating a sorting algorithim in Perl that sorts data by Time
of day. The time is chosen from a drop-down menu.


Thank-you,

Brilund




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

Date: Tue, 13 Jun 2000 09:46:02 -0500
From: "Paul R. Andersen" <panderse@us.ibm.com>
Subject: Re: sorting algorithim
Message-Id: <3946492A.962BFC5F@us.ibm.com>

Kefka_X wrote:
> 
> Hello,
> 
> I need help creating a sorting algorithim in Perl that sorts data by Time
> of day. The time is chosen from a drop-down menu.

And the format of the data to be sorted is........?  (12/24 hour,
seconds included)

-- 
Paul Andersen
+++++++++++++
The difference between theory and practice is that in theory there is no
difference between theory and practice; but in practice there is.


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

Date: 13 Jun 2000 14:19:00 GMT
From: "D.W." <dpalmeNOSPAM@unitedtraffic.com>
Subject: sorting an array
Message-Id: <01bfd541$aae220c0$cf0114ac@raptor.unitedtraffic.com>

I have a problem in which I'm at a complete loss, so any help would be
appreciated.

I am taking some information from a mysql table (longitude and latitude
coordinates) and computing some distances on the fly.  I'm writing this
information including this computed distance to an array, but I need to be
able to sort this array on this mileage from lowest to highest.....

Can someone tell me how in the hell to sort this array? This is a numeric
field that I'm sorting on and I've been told that the sort command will
only work by using string data...is this true?

Douglas



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

Date: Tue, 13 Jun 2000 09:28:10 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: sorting an array
Message-Id: <394644FA.5A1B630E@texas.net>

"D.W." wrote:
> 
> Can someone tell me how in the hell to sort this array? This is a numeric
> field that I'm sorting on and I've been told that the sort command will
> only work by using string data...is this true?

If you RTFM, the likelihood of getting a correct answer to your question
is quite a bit higher than if you post to Usenet.

perldoc perldoc
perldoc perl
perldoc -q sort
perldoc -f sort

HTH.  HAND.

- Tom


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

Date: 13 Jun 2000 14:37:21 GMT
From: "D.W." <dpalmeNOSPAM@unitedtraffic.com>
Subject: Re: sorting an array
Message-Id: <01bfd544$202d5f00$cf0114ac@raptor.unitedtraffic.com>

Ok stupid question time, what the heck is RTFM?

Douglas


Tom Briles <sariq@texas.net> wrote in article
<394644FA.5A1B630E@texas.net>...
> "D.W." wrote:
> > 
> > Can someone tell me how in the hell to sort this array? This is a
numeric
> > field that I'm sorting on and I've been told that the sort command will
> > only work by using string data...is this true?
> 
> If you RTFM, the likelihood of getting a correct answer to your question
> is quite a bit higher than if you post to Usenet.
> 
> perldoc perldoc
> perldoc perl
> perldoc -q sort
> perldoc -f sort
> 
> HTH.  HAND.
> 
> - Tom
> 


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

Date: Tue, 13 Jun 2000 16:55:26 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: sorting an array
Message-Id: <39464B5E.C4A7836B@nospam.com>

Douglas,

"D.W." wrote:
> Ok stupid question time, what the heck is RTFM?

  Deadlock.  You can learn what RTFM means only RTFM, since RTFM stands
for Read The Fucking Manual and that is written only on those fucking
manuals... ;)

  Notice:  Although the "fucking" word could sound un-polite, nowadays
the RTFM acronymous, generally, does not imply an offense.

  Ah, the FM says about your question:

<cite>
	Q: How do I sort an array by (anything)?

	A: Supply a comparison function to sort() (described in sort 
	in the perlfunc manpage):

	    @list = sort { $a <=> $b } @list;

	The default sort function is cmp, string comparison, which 
	would sort (1, 2, 10) into (1, 10, 2). <=>, used above, is 
	the numerical comparison operator.

	If you have a complicated function needed to pull out the 
	part you want to sort on, then don't do it inside the 
	sort function. Pull it out first, because the sort BLOCK can 
	be called many times for the same element. Here's an example 
	of how to pull out the first word after the first number on 
	each item, and then sort those words case-insensitively.

	    @idx = ();
	    for (@data) {
        	($item) = /\d+\s*(\S+)/;
	        push @idx, uc($item);
	    }
	    @sorted = @data[sort { $idx[$a] cmp $idx[$b] } 0 .. $#idx];

		[snips]

	See http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html for 
	more about this approach.
</cite>


	Best regards,
		Marco


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

Date: Tue, 13 Jun 2000 08:02:27 -0700
From: "Trevor Sky Garside" <trevor@trevorsky.com>
Subject: Re: sorting an array
Message-Id: <60s15.4579$PZ5.156550@nntp3.onemain.com>

Try running a search on a term you are unfamiliar with.  I threw "RTFM" into
google (www.google.com) and the third result happens to be a very good
definition of RTFM:

http://www.tuxedo.org/~esr/jargon/html/entry/RTFM.html


--Trevor


"D.W." <dpalmeNOSPAM@unitedtraffic.com> wrote in message
news:01bfd544$202d5f00$cf0114ac@raptor.unitedtraffic.com...
> Ok stupid question time, what the heck is RTFM?
>
> Douglas
>
>
> Tom Briles <sariq@texas.net> wrote in article
> <394644FA.5A1B630E@texas.net>...
> > "D.W." wrote:
> > >
> > > Can someone tell me how in the hell to sort this array? This is a
> numeric
> > > field that I'm sorting on and I've been told that the sort command
will
> > > only work by using string data...is this true?
> >
> > If you RTFM, the likelihood of getting a correct answer to your question
> > is quite a bit higher than if you post to Usenet.
> >
> > perldoc perldoc
> > perldoc perl
> > perldoc -q sort
> > perldoc -f sort
> >
> > HTH.  HAND.
> >
> > - Tom
> >




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

Date: 13 Jun 2000 15:03:53 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: sorting an array
Message-Id: <8i5igp$eel$3@nntp9.atl.mindspring.net>

D.W. (dpalmeNOSPAM@unitedtraffic.com) wrote:
: Ok stupid question time, what the heck is RTFM?

Read The Free Manual.



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

Date: Tue, 13 Jun 2000 13:11:00 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: uses for PERL
Message-Id: <8i5bso$ss7$1@nnrp1.deja.com>

In article <skam18qhh5157@corp.supernews.com>,
  cberry@cinenet.net (Craig Berry) wrote:
> Rodney Engdahl (red_orc@my-deja.com) wrote:
> : The claim is made that Perl is 'Turing complete'.  As such, Perl
> :can be used for any purpose that any other 'Turing complete'
> :language can be used.
> :
> : You might as well ask the same question of any other language (C,
> :Java, . . .) that is used in the development of web sites.
>
> Of course, this argument is true but vacuous.

disagree

> Assembly is Turing-complete*, too, yet you don't see a lot of it
> getting used on the Web.

misses the point.

> In fact, you'd have to go to some fairly narrow-purpose languages
> (sed, for example) to find a non-TC language.

agree

>
> The real question to ask about a 'Web language' is how easy it makes
> the stuff that should be easy, while also enabling the big
> complicated stuff without too much big complication.  Perl and Java
> both do well on this metric, in different ways and (to a degree)
> different subfields of specialization.

From the OP, the real question is "Are there other uses for a language
that I know of primarily or only in association with CGI?"  While PHP
is relatively limited to web use and is not TC (AFAIK, and perhaps
displaying my ignorance of PHP), perl is not so limited and is TC.

>
> (*) Note that a true Turing-complete language demands infinite memory
> storage, a sticking point which is normally ignored.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 13 Jun 2000 14:28:57 GMT
From: ringo4269@my-deja.com
Subject: web page and serial port
Message-Id: <8i5gei$ia$1@nnrp1.deja.com>

Hi, Can someone tell me how to access the serial port from a web page on
a local machine? I have read FAQ8 and looked at the (CSPAN?) stuff
mentioned earlier on this NG, but need an example. I only need to
write to the port.
THanks
Ringo


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 3341
**************************************


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