[13806] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1216 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 29 00:16:18 1999

Date: Thu, 28 Oct 1999 21:16:03 -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: <941170562-v9-i1216@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 28 Oct 1999     Volume: 9 Number: 1216

Today's topics:
    Re: mod perl anomalies <tom@tnunn.demon.co.uk>
    Re: mod perl anomalies (Bill Moseley)
    Re: MS ACCESS and Perl <gellyfish@gellyfish.com>
    Re: MS ACCESS and Perl <cassell@mail.cor.epa.gov>
    Re: Newbie - ActivePerl - Including a web page <firstnamefirstletterlastnameANTISPAM@ANTISPAMnovell.com>
    Re: Newbie - ActivePerl - Including a web page <lr@hpl.hp.com>
    Re: Newbie - ActivePerl - Including a web page (Craig Berry)
    Re: Newbie - ActivePerl - Including a web page <lr@hpl.hp.com>
    Re: Newbie - ActivePerl - Including a web page <jon@midnightbeach.com>
    Re: No dos-to-unix  conversion needed when using  Net:: <maurice.maltbia@intel.com>
    Re: open FH, "+<&STDOUT" (Charles DeRykus)
        Outlook <samay1NOsaSPAM@hotmail.com.invalid>
    Re: Outlook (Martien Verbruggen)
    Re: Outlook (Tad McClellan)
    Re: Pack function in Active Perl (win32) buggy? (Bart Lateur)
        Perl and Excel <asquith@macconnect.com>
    Re: Perl disallowed at ACM programming contests? (Abigail)
    Re: perl lang parser <slanning@bu.edu>
    Re: perl lang parser (Ilya Zakharevich)
    Re: perl lang parser <slanning@bu.edu>
    Re: perl lang parser (Ilya Zakharevich)
    Re: perl lang parser <slanning@bu.edu>
    Re: perl lang parser <ltl@rgsun40.viasystems.com>
        Perl Mongers - Wellington NZ davem@web.co.nz
    Re: perl script for file uploading <gellyfish@gellyfish.com>
    Re: perl script for file uploading <lee@insync.net>
    Re: perl script for file uploading <cassell@mail.cor.epa.gov>
        Perl script to compile C program. KernelKlink@webtv.net
    Re: Perl script to compile C program. <cassell@mail.cor.epa.gov>
    Re: Perl script to compile C program. KernelKlink@webtv.net
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 29 Oct 1999 00:30:44 +0100
From: Thomas Nunn <tom@tnunn.demon.co.uk>
Subject: Re: mod perl anomalies
Message-Id: <1x+KmBAkyNG4Ew8p@tnunn.demon.co.uk>

In article <FKB178.IFr@csc.liv.ac.uk>, I.J. Garlick
<ijg@connect.org.uk> writes

>> However every so often when I submit the form, the record that is added
>> to the file is actually a repetition of a record added a few submits
>> before.
>
>I think this is because you are accessing an Apache httpd that you have
>accessed before which contains old info, ie. it's not been reset properly.
>

Hmm, okay..

>This happened to me when I first tried to use mod_perl (I just dived in
>and tried to run before I had even relised crawling may have been a better
>bet).
>

I wish I had time for crawling, I don't think my boss would be amused
however.

>> 
>> I can see no pattern to this repetition, it just seems to randomly
>> remember a string that was used a little while before.
>
>Yep that's the clue that leads me too the above.
>
>> So.. Anyone have any Idea what might be going on? I'm quite confused
>> myself.
>
>What you need to do is run restart your Apache web server with a special
>command that limits it to only one daemon instead of 4 or 5. (I just read
>about it, but can't remember the command). Once you get effectively only
>one process to deal with it should be relatively easy to get debugging
>info out and track down what's going on/wrong.
>

That would probably be very useful, but I'm still confused. I was led to
believe that if I declare all my variables as being local, they should
all die as soon as that particular script has finished running. Why
would these values still be in memory? 

 ...Unless of course the script doesn't finish running.. Aha that could
be it.. Am I being a complete raging idiot? Is there something I should
be putting in my subroutines to tell the script to stop running? exit is
out, I know that. How about a goto that points to the end of a file?

Sorry, got a bit carried away there talking rubbish.

Am I on the right track? Could this be the problem? It's probably
something obvious. I'm fairly new to perl and a lot of the obvious
things aren't well.. obvious yet. 

Hmm..
-- 
Thomas Nunn


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

Date: Thu, 28 Oct 1999 17:22:06 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: mod perl anomalies
Message-Id: <MPG.1282888e78e7a224989824@nntp1.ba.best.com>

Thomas Nunn (tom@tnunn.demon.co.uk) seems to say...
> >> However every so often when I submit the form, the record that is added
> >> to the file is actually a repetition of a record added a few submits
> >> before.

Have you run the server with -X?

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: 27 Oct 1999 20:58:56 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: MS ACCESS and Perl
Message-Id: <7v7p2g$jqj$1@gellyfish.btinternet.com>

On Wed, 27 Oct 1999 12:13:18 -0700 oneill78 wrote:
> Does anybody know where I can get info on using Perl with
> MS access without using a server

You will use the modules DBD::ODBC or Win32::ODBC - the former is generally
recommended you can install it like:

C:\> ppm install DBD-ODBC

This will also install the documentation.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 28 Oct 1999 17:18:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: MS ACCESS and Perl
Message-Id: <3818E7B9.6FD6B183@mail.cor.epa.gov>

oneill78 wrote:
> 
> Do you know of any good books that I can follow to help me
> set up a database using perl.  We use coldFusion at work
> but I can not afford to buy it.

Go to www.perl.com and try the Search facility.  Try a 
keyword like 'tutorial' or 'database', and you'll find a
passel of web tutorials which can get you started.

Good luck,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 28 Oct 1999 13:37:28 -0600
From: "Jeff Pitman" <firstnamefirstletterlastnameANTISPAM@ANTISPAMnovell.com>
Subject: Re: Newbie - ActivePerl - Including a web page
Message-Id: <7va8ls$mbd$1@acs2.byu.edu>

sub page_header {
    open( READIT, "<$templatedir/header.html" );
    my( $header ) = <READIT>;   #This brings the whole file into the
variable.
    close READIT;
    print $header;
}
Check out perlfaq5 for more file info.  ActivePerl provides great indexed
docs.  You'll find
all the faqs and more there (plus any mods you install).

Enjoy,
Jeff


Paul Cook <qwe@qwe.com> wrote in message
news:941124746.19609.0.nnrp-13.9e980799@news.demon.co.uk...
> Hi, I've got a .pl script which is supposed to merge a html file with what
> it output (basically sticks a header on the page before outputting the
rest
> of the page). I'm using ActivePerl on PWS4 but this doesn't seem to work.
>
> sub page_header{
>   open (READIT,"$templatedir/header.html");
>   read (READIT, $header, 20000,0);
>   close (READIT);
>   print $header;
> }
>
> Any ideas? I'm no Perl expert but I've checked the docs and AFAIK this is
> correct.
>
> Thanks
>
> Paul.
>
>




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

Date: Thu, 28 Oct 1999 14:24:02 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie - ActivePerl - Including a web page
Message-Id: <MPG.12825ecb1d4e88ac98a154@nntp.hpl.hp.com>

In article <7va8ls$mbd$1@acs2.byu.edu> on Thu, 28 Oct 1999 13:37:28 -
0600, Jeff Pitman 
<firstnamefirstletterlastnameANTISPAM@ANTISPAMnovell.com> says...
> sub page_header {
>     open( READIT, "<$templatedir/header.html" );
>     my( $header ) = <READIT>;   #This brings the whole file into the
> variable.
>     close READIT;
>     print $header;
> }

Long right-hanging comments don't do well in Usenet.  In this case, the 
comment bears no relationship to reality.

What happens here is that, because of the list context, the entire file 
is read into a list, and then the first element of the list (the first 
line of the file) is assigned to the variable.

> Check out perlfaq5 for more file info.  ActivePerl provides great indexed
> docs.  You'll find
> all the faqs and more there (plus any mods you install).
> 
> Enjoy,

This is good advice, for you too.  :-)  BTW, your newsreader's line 
wrapping is screwed up.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 28 Oct 1999 22:43:37 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Newbie - ActivePerl - Including a web page
Message-Id: <s1hkcptr0825@corp.supernews.com>

Jeff Pitman (firstnamefirstletterlastnameANTISPAM@ANTISPAMnovell.com) wrote:
: sub page_header {
:     open( READIT, "<$templatedir/header.html" );

or die $!

:     my( $header ) = <READIT>;   #This brings the whole file into the
: variable.

 ...if the whole file consists of a single newline-terminated line.

:     close READIT;

or die $!

:     print $header;
: }

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "They do not preach that their God will rouse them
      a little before the nuts work loose." - Kipling


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

Date: Thu, 28 Oct 1999 16:57:26 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie - ActivePerl - Including a web page
Message-Id: <MPG.128282c044db727798a156@nntp.hpl.hp.com>

In article <s1hkcptr0825@corp.supernews.com> on Thu, 28 Oct 1999 
22:43:37 GMT, Craig Berry <cberry@cinenet.net> says...
> Jeff Pitman (firstnamefirstletterlastnameANTISPAM@ANTISPAMnovell.com) wrote:

 ...

> :     my( $header ) = <READIT>;   #This brings the whole file into the
> : variable.
> 
> ...if the whole file consists of a single newline-terminated line.

Or a sequence of characters without a newline.  (This is not a valid 
'text file', though.)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 28 Oct 1999 17:52:04 -0700
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: Newbie - ActivePerl - Including a web page
Message-Id: <3818EFB4.65AF17CD@midnightbeach.com>

Paul Cook wrote:
 
> Hi, I've got a .pl script which is supposed to merge a html file with what
> it output (basically sticks a header on the page before outputting the rest
> of the page). I'm using ActivePerl on PWS4 but this doesn't seem to work.
> 
> sub page_header{
>   open (READIT,"$templatedir/header.html");
>   read (READIT, $header, 20000,0);
>   close (READIT);
>   print $header;
> }

"I'm no Perl expert", either, but this looks OK - are you sure that
$templatedir has the right value? The right directory, and not ending
with a '/'?

Btw, 

>   read (READIT, $header, -s READIT, 0);
>   # "-s VAR" returns file size of VAR

is a lot better than 

>   read (READIT, $header, 20000,0);

- no chance that you will truncate a long file.

-- 

http://www.midnightbeach.com    - Me, my work, my writing, and
http://www.midnightbeach.com/hs - my homeschool resource pages


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

Date: Thu, 28 Oct 1999 19:21:34 -0700
From: "Maurice Maltbia" <maurice.maltbia@intel.com>
Subject: Re: No dos-to-unix  conversion needed when using  Net::FTP
Message-Id: <7vb0b1$hqa@news.or.intel.com>


I appears that the file conversion from DOS to unix is handled automatically
when using the Net::FTP module.

>
>>Transfer 'stripped' (i.e., binary) files using binary mode.  Transfer
>>'text' files using 'ascii' mode.  FTP will then handle the line endings
>>correctly, in either direction.





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

Date: Fri, 29 Oct 1999 00:51:22 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: open FH, "+<&STDOUT"
Message-Id: <FKCADM.F7y@news.boeing.com>

In article <38188C87.DF3959BC@bellatlantic.net>,
James Tolley  <jtolley@bellatlantic.net> wrote:
>Hello All,
>
>[Sorry if this is a repost - I thought I sent this already, but it's not
>showing up...]
>
>I'm trying to copy any old filehandle, without first knowing whether
>that filehandle is open for reading, writing, or both... is there a way
>to find this information?
>I've tried to copy STDOUT as "+<&STDOUT", but get strange behavior,
>depending on whether I execute the script as 'test.pl' (works fine) or
>'test.pl | more' (dies on open()) - on win32. `perldoc -f open` only
>says that you 'should' copy in the same mode as the original. I'd like
>to follow that advice, if I can find out what that mode is...?
>

Here's something that may help:

sub writable( $ ) {   
    my $handle = shift;
    my $rc;
    { local $^W = 0; $rc = print $handle "" } 
    return $rc;
}

my $dup_fh = $fh;    #  e.g, my $dup_fh = '+<&STDOUT';       

warn writable( $dup_fh ) ? "writable\n" : "read only\n"

__END__

--
Charles DeRykus


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

Date: Thu, 28 Oct 1999 14:13:40 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Outlook
Message-Id: <000b8d9b.ae897f55@usw-ex0101-002.remarq.com>

Hi, I get junk emails in a particular format..
I would like to delete the other content and only want to retain useful
content..

Is there any program which can help me..?
Thanks..



* 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: Thu, 28 Oct 1999 22:52:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Outlook
Message-Id: <bt4S3.70$fq3.2246@nsw.nnrp.telstra.net>

On Thu, 28 Oct 1999 14:13:40 -0700,
	Samay <samay1NOsaSPAM@hotmail.com.invalid> wrote:
> Hi, I get junk emails in a particular format..
> I would like to delete the other content and only want to retain useful
> content..

Depending on what exactly you want to do, Any of the modules on CPAN
starting with Mail:: might be good for this.

http://www.cpan.org/modules

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | Curiouser and curiouser, said Alice.
NSW, Australia                  | 


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

Date: Thu, 28 Oct 1999 16:55:13 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Outlook
Message-Id: <h7dav7.eih.ln@magna.metronet.com>

Samay (samay1NOsaSPAM@hotmail.com.invalid) wrote:
: Hi, I get junk emails in a particular format..
: I would like to delete the other content and only want to retain useful
: content..

: Is there any program which can help me..?


   You could write one in Perl.

   Or use a search engine for searching.


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


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

Date: Thu, 28 Oct 1999 20:42:21 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Pack function in Active Perl (win32) buggy?
Message-Id: <3818b4e8.516844@news.skynet.be>

Lars Soderstrom wrote:

>It seems that the pack-function converts %0D%0A (CR-LF) in IIS to _two_
>linefeeds when it is in UNIX converted to only one linefeed.
>Is this a bug? Makes porting UNIX->WIN a bit harder.

Are you sure? You're not forgetting about binmode(), are you?

If you print a plain "\012" to a text filehandle, it will be converted
to "\015\012".

-- 
	Bart.


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

Date: Thu, 28 Oct 1999 19:58:13 -0500
From: "Asquith" <asquith@macconnect.com>
Subject: Perl and Excel
Message-Id: <7varfa$2ph2@enews4.newsguy.com>

Looking for a 100% Perl module that can take an Excel file and convert it 
variously delimited files or open the Excel file, convert it, and pipe it
downstream.  I'm developing an application on Solaris and Linux and need to
interface transparently to Excel files sitting on the NFS.

Suggestions?

Thanks,
-wha


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

Date: 28 Oct 1999 17:40:04 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl disallowed at ACM programming contests?
Message-Id: <slrn81hk56.66b.abigail@alexandra.delanet.com>

Ala Qumsieh (aqumsieh@matrox.com) wrote on MMCCXLVII September MCMXCIII
in <URL:news:x3yyacq7z90.fsf@tigre.matrox.com>:
|| 
|| tadmc@metronet.com (Tad McClellan) writes:
|| 
|| > Keith did not merely win, he conquered. He solved five of
|| > the six problems   in the three hours allotted. The
|| > second-place two-person team solved only   three problems. 
|| > They, needless to say, were not using Perl.
|| 
|| This got me curious. I can see how Perl can tremendously cut down on
|| the programming time, but where there any limits as to how fast your
|| programs take to run? Do you also know what the nature of the
|| questions was?


Having competed [1] and organized such events, I can say yes, there
are limits on how long your program can run. However, those limits are
usually picked such that the difference in speed between a Perl solution
and a Pascal or C solution wouldn't matter. What would matter is picking
a stupid algorithm. Linear vs quadratic; a sample input in the order
of hundreds of thousands will make quite a difference.

We would typically make a standard solution to the problem, run the
test suite on it, time it, and multiply it by a factor of 50 or so
for the allowed running time.


[1] *Growl* Getting #3 of Europe, and not going to the US for the world
    finals because the numbers #1 and #2 were from the same country, but
    the #4 went instead....


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 28 Oct 1999 16:21:18 -0400
From: Scott Lanning <slanning@bu.edu>
Subject: Re: perl lang parser
Message-Id: <kusemefgrsx.fsf@strange.bu.edu>

*@dragons.duesouth.net (Matthew Bafford) writes:
> slganzho@unity.ncsu.edu (Salem Lee Ganzhorn) enriched us with: 
> : I am looking for a package which can parse a perl script and
> : store the information in a structure.
> 
> Only perl can parse Perl.

yacc parses Perl, but the Perl install builds a special yacc
for different platforms. [ref. Chip Salzenberg, The Perl Journal,
Sp. 1998, p.56]

-- 
"It showed a lady, with a fur cap on and a fur stole, sitting upright
and holding out to the spectator a huge fur muff into which the whole
of her forearm had vanished!" --From Franz Kafka's Metamorphosis


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

Date: 28 Oct 1999 21:05:18 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: perl lang parser
Message-Id: <7vadqe$pe$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Scott Lanning 
<slanning@bu.edu>],
who wrote in article <kusemefgrsx.fsf@strange.bu.edu>:
> > Only perl can parse Perl.
> 
> yacc parses Perl

Nonsense.  Yacc is a compiler compiler, all it parses is a YACC grammar.

Perl uses some bison-generated parser, but it is only a small part of
Perl parsing engine.

One cannot parse (anything but simplest) Perl without actually
*running* some Perl code.

> but the Perl install builds a special yacc for different platforms.

???!!!!

Ilya


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

Date: 28 Oct 1999 20:54:09 -0400
From: Scott Lanning <slanning@bu.edu>
Subject: Re: perl lang parser
Message-Id: <kusso2vkmvi.fsf@bottom.bu.edu>

(qualification: I'm a dimwit, according to someone who just emailed me)


ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> <slanning@bu.edu>], who wrote
> > yacc parses Perl
>
> Nonsense.  Yacc is a compiler compiler, all it parses is a YACC grammar.
>
> Perl uses some bison-generated parser, but it is only a small part of
> Perl parsing engine.

I don't know the words well, so maybe my concept of "parse" is wrong,
or I have said the wrong words.
According to:

    http://www.perl.com/pub/doc/manual/html/pod/perlguts.html
        #Compile_pass_1_check_routines

the internal "code tree" is "created by the pseudo-compiler while yacc
code feeds it the constructions it recognizes". It is my understanding
that first "lexical analysis" takes place, which creates "tokens" from
the source code; then the perl yacc takes these tokens and parses them
according to the Perl grammar; then, according to the above, this is
fed into the "pseudo-compiler" during "compile pass 1". I haven't
looked at the perl code, so all that I say is hear-say (in addition to
the qualification at the top that I'm a dimwit).

> One cannot parse (anything but simplest) Perl without actually
> *running* some Perl code.

Then how do you write a Perl program if you don't know the
way it will work? I mean it as a rhetorical question. It seems
it should be possible to parse Perl given you know the rules.
(maybe all such processors are defined to be perl code?)

> > but the Perl install builds a special yacc for different platforms.
> 
> ???!!!!

Sorry, it seems I misunderstand something, or what I said is irrelevant.

-- 
"If lightning is the anger of the gods, the gods are concerned mostly
with trees." --Lao Tse


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

Date: 29 Oct 1999 02:14:40 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: perl lang parser
Message-Id: <7vavug$4db$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Scott Lanning 
<slanning@bu.edu>],
who wrote in article <kusso2vkmvi.fsf@bottom.bu.edu>:
> the internal "code tree" is "created by the pseudo-compiler while yacc
> code feeds it the constructions it recognizes". It is my understanding
> that first "lexical analysis" takes place, which creates "tokens" from
> the source code; then the perl yacc takes these tokens and parses them
> according to the Perl grammar; then, according to the above, this is
> fed into the "pseudo-compiler" during "compile pass 1".

This is sufficiently vague to contain no obvious contradictions.  ;-)

> > One cannot parse (anything but simplest) Perl without actually
> > *running* some Perl code.
> 
> Then how do you write a Perl program if you don't know the
> way it will work? I mean it as a rhetorical question. It seems
> it should be possible to parse Perl given you know the rules.
> (maybe all such processors are defined to be perl code?)

???  [Nobody can predict how a given Perl code will work (with a few
      exceptions).  Things change a lot, almost nothing is documented.]
      "Rules" exist, but are not yet written down.
         
On the more helpful side: Perl "compilation" is fact a series of
alternating compile/execute phases.  Each "execute" phase (may)
affect(s) what the lexer will feed into the the yacc-generated
grammar-parser.

Ilya


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

Date: 28 Oct 1999 23:13:25 -0400
From: Scott Lanning <slanning@bu.edu>
Subject: Re: perl lang parser
Message-Id: <kusemeeluzu.fsf@bottom.bu.edu>

ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> This is sufficiently vague to contain no obvious contradictions.  ;-)

Damn, I missed my calling as a politician... if only I weren't
so shy that I could be considered socially retarded...

> > > One cannot parse (anything but simplest) Perl without actually
> > > *running* some Perl code.
> > 
> > Then how do you write a Perl program if you don't know the
> > way it will work? I mean it as a rhetorical question. It seems
> > it should be possible to parse Perl given you know the rules.
> > (maybe all such processors are defined to be perl code?)
> 
> ???  [Nobody can predict how a given Perl code will work (with a few
>       exceptions).  Things change a lot, almost nothing is documented.]
>       "Rules" exist, but are not yet written down.

Well, I meant it for general Perl code. Obviously perl can lex/parse
Perl code, so I just meant that you should be able to write a non-perl
program which lex/parses a Perl program for dependencies, which is what
the original poster wanted--something to create a structure which tracks
dependencies in the Perl code; e.g., etags in emacs which can show which
modules use what functions. It would probably be easier to write one
in Perl, though. I just think it shouldn't be necessary to run perl
to do it (says he who hasn't tried to implement it).

-- 
qualification: I'm a dimwit according to someone who emailed me


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

Date: 29 Oct 1999 03:13:16 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: perl lang parser
Message-Id: <7vb3cc$16b$1@rguxd.viasystems.com>

Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
[snip]
:>???  [Nobody can predict how a given Perl code will work (with a few
:>      exceptions).  Things change a lot, almost nothing is documented.]
:>      "Rules" exist, but are not yet written down.
:>         

Bullshit.  I may not be able to prove mathematically that a
given Perl program will yield a specific result, but I live
in the real world and the emperical evidence is good enough
for me.  The Perl code I write works the way I predict based
on what I read in the documentation (mostly  :-).

Whether or not the rules are written down, the p5p compatibility
police don't let anybody change them very often.

The sky is not falling.  Perl is not so unpredictable as you imply.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: Fri, 29 Oct 1999 02:57:49 GMT
From: davem@web.co.nz
Subject: Perl Mongers - Wellington NZ
Message-Id: <7vb2fc$tpo$1@nnrp1.deja.com>

Here are the details for the next meeting of the Wellington Perl
Mongers:

Wednesday 3 November 1999, 5:30 PM
at
The Web Limited
Level 8, 86 Lambton Quay
Wellington

Speaker: Roger de Salis of Cisco Systems
Topic: Web-based customer management using Perl

Please note the revised location (same place as last time).  Beer and
Nibblies graciously provided by Cisco.

Please RSVP to Dave Moskovitz, davem@web.co.nz

See you there!


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


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

Date: 28 Oct 1999 20:59:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl script for file uploading
Message-Id: <7vadep$111$1@gellyfish.btinternet.com>

On Thu, 28 Oct 1999 18:55:28 GMT n.thiyagarajan wrote:
> i'm new to perl so go easy on me...
> 
> i have an html form that will be used for uploading a file.  i want to
> write a perl script to upload the file and place the file in a specific
> directory.  i'm having troble with enctype= multipart-formdata.
> 

You should use the module CGI.pm that ships with Perl - working with
file upload fields is explicitly discussed in the documentation.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Thu, 28 Oct 1999 15:53:58 -0500
From: "Lee Sharp" <lee@insync.net>
Subject: Re: perl script for file uploading
Message-Id: <GJ2S3.10819$Ph7.74332@insync>

n.thiyagarajan wrote in message <38189F3D.177A881@yahoo.com>...
|i'm new to perl so go easy on me...
|
|i have an html form that will be used for uploading a file.  i want to
|write a perl script to upload the file and place the file in a specific
|directory.  i'm having troble with enctype= multipart-formdata.

   Try http://www.perlarchive.com/guide/File_Uploading/ for lots of good
stuff.  Pre canned, and ready to go.  cpan is also very good, but daunting
to a beginner.

            Lee

--
SCSI is *NOT* magic. There are *fundamental technical reasons* why it is
necessary to sacrifice a young goat to your SCSI chain now and then. * Black
holes are where God divided by zero. - I am speaking as an individual, not
as a representative of any company, organization or other entity.  I am
solely responsible for my words.






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

Date: Thu, 28 Oct 1999 17:27:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perl script for file uploading
Message-Id: <3818E9F0.CBCAAA45@mail.cor.epa.gov>

Lee Sharp wrote:
> 
> n.thiyagarajan wrote in message <38189F3D.177A881@yahoo.com>...
> |i'm new to perl so go easy on me...
> |
> |i have an html form that will be used for uploading a file.  i want to
> |write a perl script to upload the file and place the file in a specific
> |directory.  i'm having troble with enctype= multipart-formdata.
> 
>    Try http://www.perlarchive.com/guide/File_Uploading/ for lots of good
> stuff.  Pre canned, and ready to go.  cpan is also very good, but daunting
> to a beginner.

Yes, perlarchive is definitely aimed at the non-Perlite and the
rank beginner.  They consider the use of *any* module to be 'advanced'.  
That strikes me as less-than-sterling advice, but YMMV.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 28 Oct 1999 15:56:58 -0400 (EDT)
From: KernelKlink@webtv.net
Subject: Perl script to compile C program.
Message-Id: <14651-3818AA8A-29@storefull-215.iap.bryant.webtv.net>

I am able to compile a C program using a shell script to call "cc" on
BSDI. Is Perl capable of compiling a C program by calling "cc" in a Perl
script to perform the compile?



 

==============================
Have MySQL questions but can't find a
newsgroup to post them to? Post to the newsgroup comp.databases
==============================



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

Date: Thu, 28 Oct 1999 17:25:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl script to compile C program.
Message-Id: <3818E975.4A4D0E00@mail.cor.epa.gov>

KernelKlink@webtv.net wrote:
> 
> I am able to compile a C program using a shell script to call "cc" on
> BSDI. Is Perl capable of compiling a C program by calling "cc" in a Perl
> script to perform the compile?

Sure.  What happened when you tried it?

If you hit some trouble with your syntax, you may want to
consider how Perl and your shell interact in an ugly
system() statement.  Ofttimes there's a problem with quotes
or Perl's $-whatever variables vs. the shell's.

If you can't get it fixed, show us the code where you have
the system() statement, and someone may spot the problem.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 28 Oct 1999 22:49:14 -0400 (EDT)
From: KernelKlink@webtv.net
Subject: Re: Perl script to compile C program.
Message-Id: <12816-38190B2A-52@storefull-211.iap.bryant.webtv.net>

Thanks David for the response. I haven't written a line of it yet. I
wanted to verify first that it can be done with. Thanks also for the
logic tips. 

I'll post the code as soon as I am done.

Best Regards.


==============================
Have MySQL questions but can't find a
newsgroup to post them to? Post to the newsgroup comp.databases
==============================



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

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


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