[13860] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1270 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 3 18:10:33 1999

Date: Wed, 3 Nov 1999 15:10:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941670621-v9-i1270@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 3 Nov 1999     Volume: 9 Number: 1270

Today's topics:
    Re: More Than A Little Help Needed for a newbie.... <gellyfish@gellyfish.com>
        Need nifty code for displaying Web Graphics NOSPAMajm@antopia.com
    Re: Need nifty code for displaying Web Graphics (Alan Curry)
    Re: Need nifty code for displaying Web Graphics <linberg@literacy.upenn.edu>
    Re: Need nifty code for displaying Web Graphics (brian d foy)
    Re: Need nifty code for displaying Web Graphics (Antopia Herpes Network)
    Re: Need nifty code for displaying Web Graphics (Henry Penninkilampi)
        Newbie confusion about syntax (Newbie)
    Re: newbie in embedded perl (Kragen Sitaker)
    Re: perl and commonsense (Kragen Sitaker)
    Re: perl and commonsense (Kragen Sitaker)
    Re: perl and commonsense (Alan Curry)
    Re: perl and commonsense (brian d foy)
    Re: perl and commonsense (Kragen Sitaker)
    Re: perl lang parser <dan@tuatha.sidhe.org>
    Re: perl on ms PWS on win98 <jon@midnightbeach.com>
    Re: perldoc and the string "PI::" <rootbeer@redcat.com>
    Re: Premature End Of Script Headers <marcel.grunauer@lovely.net>
    Re: Premature End Of Script Headers (Kragen Sitaker)
    Re: Problems installing ActivePerl build 522 (Jan Dubois)
        Problems with email and windows NT (Lisa Ditzhazy)
    Re: Problems with email and windows NT <AgitatorsBand@yahoo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 3 Nov 1999 22:04:09 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: More Than A Little Help Needed for a newbie....
Message-Id: <7vqbgp$6bg$1@gellyfish.btinternet.com>

On Tue, 02 Nov 1999 13:31:51 +0000 Owen Dickenson wrote:
> 
> As part of the degree we gave to undertake a Multi Year team project for
> a real client. ours is a local college. They have a wind turbine and
> they want a live data feed to a website which produes graphs and
> compares the figures to historical data.  there web server is on UNIX
> and thier network is NT4.  basicaly the problem is that we have no idea
> how to do this, several people i know have suggested perl but i don't
> know anything about it.  ideally what i need is to be pointed in the
> direction of some resources that will be useful and maybe even a few
> good guide site's to perl.  since i don't really know what  need to know
> *boggles* then i can't really be more specific.  
> 

For myself I would say that I wouldnt be starting here.  The choice of an
implementation language is a detail that perhaps you shouldnt be considering
at this stage.  Perl *might* be an ideal language in which to implement
some of the parts of this but this decision should be set aside until you
have gained a clear understanding of the problem, the dataflows within the
system and the external constraints.  In a word analysis.

You will need to identify the separate subsystems involved in the overall
design : data capture  data storage, data analysis and display of results
would seem to be the main ones here.  You will almost certainly feel better
if you draw some nice diagrams of this at this stage - you might start
with an abstract view which may not relate to any physical aspects of the
existing situation, but you will find as you work it over that an obvious
structure will start to emerge:  links between subsystems will become
identifiable processes and perhaps even subsystems themselves with their
own inputs and outputs and their own set of constraints. You might iterate
over this several times until a clear view of the system will arise and at
this point you will be able to identify processes as being programs which
will admit of their own analysis - what data will they receive, how will
they process it and what data will they emit to where and in what form.  This
is the stage that you might begin to match the requirements of the process
with the capabilities of any candidate programming language (or protocol,
or database or web server ... ). 

Of course in real life we dont often get the opportunity to do things like
this, but hey you're a student you'll feel better and learn more by doing
things properly.

In the meantime however you might be wanting to find out about the
capabilities of Perl - reading this group for a while might give you
some idea of the wide range of applications to which the language is put.

Perl itself comes with very good documentation with includes a voluminous
FAQ that addresses many of the questions that people find themselves
asking when trying to solve a problem - a quick read through these in the
first instance to familiarise yourself will pay off later.  If you have
Perl on a machine that you use you can access this documentation by:

  man perl

or

  perldoc perl 

A vast wealth of supplementary material might be found by browsing 
<http://www.perl.com> Which has references to an even greater body of
material and resources around the 'net.

You will almost certainly want to familiarise your with CPAN (the
Comprehensive Perl Archive Network) which can be found at 
<http://www.cpan.org> - this is a truly gigantic archive of reusable
code (Modules in Perl parlance) that spans the majority of the applciation
areas that Perl touches.

If you have any particular questions about the capabilities of Perl that
are not addressed in the documentation or you are having difficulty with
some code and cannot find an answer - then feel free to post here, it can
get rough, but people really dont mind genuine questions that really are
about Perl. 

At the moment however I dont think that theres much more we can do for you.

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


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

Date: Wed, 03 Nov 1999 21:31:44 GMT
From: NOSPAMajm@antopia.com
Subject: Need nifty code for displaying Web Graphics
Message-Id: <7vq9k0$fr9$1@nnrp1.deja.com>

Hi:

I have an interesting question.

I have a web site that has lots of user pictures on it.   The pics are
all in an online graphics directory and in my perl script that calls up
the pictures on demand there is a simple

print "<IMG SRC=\"graphics/fred.jpg\">\n";

type of call.  Obviously, anyone can see the picture directly by going
to http://www.mydomain.com/graphics/fred.jpg .

Now, I want to hide the pictures from anyone so they can NOT be called
viewed directly, just via the page generated by the script.  I do NOT
want to password protect the graphics directory for other reasons.  What
I want to do is to have the picture files in some offline directory,
such as /home/mydomain/graphics/.

I can suck a picture into my script by calling:

open (PIC, "< /home/mydomain/graphics/fred.jpg");
$fred = <PIC>;

Is there then a way in perl to incorporate variable $fred into an HTML
statement such that it actually shows up as a .jpg picture?  The name of
the picture does NOT need to be preserved.  I just want to display the
JPG file that's now in variable $fred.

A new car and vacation in Hawaii to anyone who can answer this!!  Better
yet, a lifetime membership to my website, although I hope you don't need
it!

AJ
Webmaster
Antopia Herpes Network



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


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

Date: Wed, 03 Nov 1999 21:49:40 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Need nifty code for displaying Web Graphics
Message-Id: <U52U3.25490$23.1322564@typ11.nn.bcandid.com>

In article <7vq9k0$fr9$1@nnrp1.deja.com>,  <NOSPAMajm@antopia.com> wrote:
>Hi:
>print "<IMG SRC=\"graphics/fred.jpg\">\n";
>
>type of call.  Obviously, anyone can see the picture directly by going
>to http://www.mydomain.com/graphics/fred.jpg .
>
>Now, I want to hide the pictures from anyone so they can NOT be called
>viewed directly, just via the page generated by the script.  I do NOT

You have misunderstood the nature of HTML. The <IMG> tag is nothing more than
a suggestion to the user, that he go get this other file that exists
independently on the web. Oh, and it can also be suggestion that this image
might look nice if it's viewed in a particular place within the text of the
page.

If you want your text and pictures to be integrated in one document, try
using a language that supports that kind of thing, like postscript, instead
of HTML.

perl is irrelevant to the problem.
-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


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

Date: 03 Nov 1999 16:50:21 -0500
From: Steve Linberg <linberg@literacy.upenn.edu>
Subject: Re: Need nifty code for displaying Web Graphics
Message-Id: <m3puxrgs82.fsf@projdirc.literacy.upenn.edu>

NOSPAMajm@antopia.com writes:

> Is there then a way in perl to incorporate variable $fred into an HTML
> statement such that it actually shows up as a .jpg picture?

No.  HTML doesn't support in-line image data.

A more precise question might be: can I use Perl to write a CGI script to
return a JPEG image built from image data stored outside my web server's
document root?  And the answer is: "Sure."  And it's a great topic for
comp.infosystems.www.authoring.cgi. :)

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
slinberg@techlab.literacy.upenn.edu / http://techlab.literacy.upenn.edu
Be kind.  Remember, everyone you meet is fighting a hard battle.


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

Date: Wed, 03 Nov 1999 17:01:48 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Need nifty code for displaying Web Graphics
Message-Id: <brian-0311991701480001@123.new-york-73-74rs.ny.dial-access.att.net>

In article <7vq9k0$fr9$1@nnrp1.deja.com>, NOSPAMajm@antopia.com wrote:

>A new car and vacation in Hawaii to anyone who can answer this!!  Better
>yet, a lifetime membership to my website, although I hope you don't need
>it!

give me the car and the trip to Hawaii and you'll have a solution on
Monday morning.  or you could just save yourself the hassle and do it
yourself.  it's only about 15 lines of rather verbose code.  you've
already laid out the solution - just translate it into code.

>AJ
>Webmaster
>Antopia Herpes Network

sorry - don't need a membership to such a website.

-- 
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ 
  <URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>



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

Date: Wed, 03 Nov 1999 22:18:28 GMT
From: nospam.ajm@antopia.com (Antopia Herpes Network)
Subject: Re: Need nifty code for displaying Web Graphics
Message-Id: <3820b48e.20265621@news.compuserve.com>

On 03 Nov 1999 16:50:21 -0500, Steve Linberg
<linberg@literacy.upenn.edu> wrote:

>
>A more precise question might be: can I use Perl to write a CGI script to
>return a JPEG image built from image data stored outside my web server's
>document root?  And the answer is: "Sure."  And it's a great topic for
>comp.infosystems.www.authoring.cgi. :)
>

This is a great suggestion and I have implemented it!  Thanks :)



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

Date: Thu, 04 Nov 1999 09:16:14 +1030
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: Need nifty code for displaying Web Graphics
Message-Id: <spamfree-0411990916150001@d4.metropolis.net.au>

In article <m3puxrgs82.fsf@projdirc.literacy.upenn.edu>, Steve Linberg
<linberg@literacy.upenn.edu> wrote:

> NOSPAMajm@antopia.com writes:
> 
> > Is there then a way in perl to incorporate variable $fred into an HTML
> > statement such that it actually shows up as a .jpg picture?
> 
> No.  HTML doesn't support in-line image data.


Hmmm...


var fred = 'GIF89a\1\0\1\0\200[...]\1\0;'
 ...
<IMG SRC="javascript:fred">


<http://www.elf.org/colorcube/>

comp.lang.javascript


Henry.


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

Date: Wed, 03 Nov 1999 21:56:46 GMT
From: Newbie (Newbie)
Subject: Newbie confusion about syntax
Message-Id: <3820a64e.5166523@news.mindspring.com>

I'm just starting to write some Perl code using perl 5.004 on Windows
98.    I ran into a syntax problem and am not sure where this part of
the language is defined.   

The problem came up in the code below.   The syntax is 
   subroutine call (implemening the constant ARCHIVE) 
   followed by an operator (&) 
   followed by  the defined variable $returnedAttributes.    
This produced a compile time error.  It looks like the compiler
interpreted this as if the white space between the & and the variable
name did not exist.    

&   $returnedAttribues is interpreted as if it were
&$returnedAttributes.   Both produce the error 
   Undefined subroutine &main::32 called at c:\scripts\test.pl line 6.
32 is the value of $returnedAattributes here. 

Why is the syntax interpreted this way, and where should I look for
guidelines on  syntax such as this?   

Thanks.



use Win32::File;

$filename = 'c:/autoexec.bat';
$returnedAttributes = 0;
Win32::File::GetAttributes( $filename ,$returnedAttributes);
$problem = ARCHIVE &   $returnedAttributes;





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

Date: Wed, 03 Nov 1999 21:33:42 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: newbie in embedded perl
Message-Id: <WS1U3.25457$23.1320651@typ11.nn.bcandid.com>

In article <7vmea0$2udm$1@ulysses.noc.ntua.gr>,
Angel Kypriotis <kypriot@algo.com.gr> wrote:
>I have created a C++ class.The methods of the class are actually implemented
>as Perl subroutines. The subroutines reside in a module in a directory of
>mine.I have embedded Perl in my driver program which uses the aforementioned
>class.However when i run the program i get the error msg "undefined sub
>called ...".Am I right to assume that the symbol table of the perl module is
>not visible in my C++ main ?

Yes.  Read perldoc perlembed and perldoc perlcall, I think, for info on
things I have never done.


-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 03 Nov 1999 21:13:16 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: perl and commonsense
Message-Id: <Mz1U3.25406$23.1317777@typ11.nn.bcandid.com>

In article <Pine.GSO.4.10.9911031347130.12955-100000@crusoe.crusoe.net>,
Jeff Pinyan  <japhy@pobox.com> wrote:
>On Nov 3, Kragen Sitaker blah blah blah:
>> Well, you can only create references to lvalues, and array slices
>> aren't lvalues.
>
>Array slices aren't lvalues?

No, they're lists of lvalues or lists of rvalues under normal
circumstances.

An lvalue is a location where you can store something.  It's a data
structure, a slot, a chunk of memory.

>It think the more pressing problem is you can only create references to
>specified data structures.  Lists are not data structures, they are just
>lists.  A scalar is a certain type of data structure.  An array is a
>certain type of data structure, a named sequence of data structures.  A
>hash is an unordered pairing of data structures.  A list is an unnamed
>sequence of data structures that are not related to each other in any way
>shape or form except for the fact they happen to be within parentheses,
>with commas between them.  (This is probably a super shitty way of putting
>it, but I'm sure there's a hint of logic here.)

I think you are absolutely correct (except lists are specifically
unnamed sequences of scalars).  The usual way of saying this is that
arrays, scalars, and hashes are denoted values -- i.e. they can be
denoted by variables -- and scalars and lists are expressed values --
i.e. they can be the values of expressions.

Oh, and lists can be created in a multitude of ways other than putting
things between parens with commas between them.

>If a function returns ($a,$b,$c), that is a list of values that are in
>some order, but are not related to each other.  If it returns @a, that is
>an array whose elements are related in that each element belongs to a
>bigger object, the array.  A list is just a grouping.  Therefore,
>operations on an array affect THE array, which in turn affects the
>elements.  Operations on a list directly affect the structures in the
>list, and the list remains there, letting you know that the structures are
>still in this grouping.

In general, operating on a list destroys it.

I think your explanation is better than mine.

>> 6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
>> <URL:http://www.pobox.com/~kragen/bubble.html>
>
>Kragen.... this URL... it baffles me. :)

It baffles me, too.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 03 Nov 1999 21:17:53 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: perl and commonsense
Message-Id: <5E1U3.25414$23.1318497@typ11.nn.bcandid.com>

In article <QG%T3.25245$23.1301844@typ11.nn.bcandid.com>,
Alan Curry <pacman@defiant.cqc.com> wrote:
>In article <7vpg8n$s8g$1@nnrp1.deja.com>,  <ajmayo@my-deja.com> wrote:
>>$c=\@a[0..2];
>>
>>will create a reference to the array slice. Except it doesn't work. It
>>seems to evaluate the slice in scalar context, returning 3 in this case.
>
>It creates an list of 3 references, then evaluates that list in scalar
>context, which results in the last element of the list being returnd. $c
>should be a reference to a scalar, not the number "3"...

This puzzles me a bit.  I thought you couldn't ever have a list in a
scalar context, ever, ever, ever.  So I'm a little puzzled about this.
Is this just a hack on the array-slicing operation so that @a[1] works
as you'd expect?

>>                                                         I know
>>what 'syntax' is
>
>Should we applaud?

Now, now, settle down.

>>My life isn't helped by perl's infuriating error reporting, which
>>assumes that printing the line number is sufficient. This is not the
>>case!
>
>Well here's one thing you got right. "Use of uninitialized value at (eval 8)
>line 20" is totally useless.

Yuck.  Is that really what mod_perl does?  I guess we need a #line
directive for Perl.

p.s. I like your bigotries.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 03 Nov 1999 21:44:12 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: perl and commonsense
Message-Id: <M02U3.25479$23.1322122@typ11.nn.bcandid.com>

In article <5E1U3.25414$23.1318497@typ11.nn.bcandid.com>,
Kragen Sitaker <kragen@dnaco.net> wrote:
>In article <QG%T3.25245$23.1301844@typ11.nn.bcandid.com>,
>Alan Curry <pacman@defiant.cqc.com> wrote:
>>It creates an list of 3 references, then evaluates that list in scalar
>>context, which results in the last element of the list being returnd. $c
>>should be a reference to a scalar, not the number "3"...
>
>This puzzles me a bit.  I thought you couldn't ever have a list in a
>scalar context, ever, ever, ever.  So I'm a little puzzled about this.
>Is this just a hack on the array-slicing operation so that @a[1] works
>as you'd expect?

If you don't like the phrase "list in scalar context", try "comma operator".
The conclusion is the same.

>>Well here's one thing you got right. "Use of uninitialized value at (eval 8)
>>line 20" is totally useless.
>
>Yuck.  Is that really what mod_perl does?  I guess we need a #line
>directive for Perl.

I've never tried mod_perl. That's what _any_ use of string eval does.
Including things like Safe->reval(). If you load any code at runtime, you're
gonna have a hard time tracking its error messages.
-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


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

Date: Wed, 03 Nov 1999 16:55:03 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: perl and commonsense
Message-Id: <brian-0311991655030001@123.new-york-73-74rs.ny.dial-access.att.net>

In article <5E1U3.25414$23.1318497@typ11.nn.bcandid.com>, kragen@dnaco.net (Kragen Sitaker) wrote:

>In article <QG%T3.25245$23.1301844@typ11.nn.bcandid.com>,
>Alan Curry <pacman@defiant.cqc.com> wrote:
>>In article <7vpg8n$s8g$1@nnrp1.deja.com>,  <ajmayo@my-deja.com> wrote:
>>>$c=\@a[0..2];
>>>
>>>will create a reference to the array slice. Except it doesn't work. It
>>>seems to evaluate the slice in scalar context, returning 3 in this case.
>>
>>It creates an list of 3 references, then evaluates that list in scalar
>>context, which results in the last element of the list being returnd. $c
>>should be a reference to a scalar, not the number "3"...
>
>This puzzles me a bit.  I thought you couldn't ever have a list in a
>scalar context, ever, ever, ever. 

that's why a conversion happens (but not according to any general
rule!).  assign a list to a scalar and you get the last element
in the list. try it:

   $n = ('a', 'b', 'c');
   print $n;

then go one step further:

   @n = ('a', 'b', 'c');
   $n = @n[0..2];
   print $n;

but realize, that since there is no general rule about this, that
assigning an array to a scalar is something completely different
(and now for something completely different):

   @n = ('a', 'b', 'c');
   $n = @n;
   print $n;

now, combine this with the fact that trying to get a reference to
a list really just gives you a list of references:

   \($a, $b, $c)  is the same as (\$a, \$b, \$c);

so if you do

   $n = \($a, $b, $c);

gives back \$c;

>So I'm a little puzzled about this.
>Is this just a hack on the array-slicing operation so that @a[1] works
>as you'd expect?

that depends on what you expect.  for those that try to make Perl
fit into some external set of rules (mis-named "common sense" in this 
thread) aren't likely to expect the right thing.  there's an aptly named
chapter in the Camel book that covers this sort of stuff. :)

-- 
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ 
  <URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>



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

Date: Wed, 03 Nov 1999 22:41:45 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: perl and commonsense
Message-Id: <JS2U3.25579$23.1330511@typ11.nn.bcandid.com>

In article <brian-0311991655030001@123.new-york-73-74rs.ny.dial-access.att.net>,
brian d foy <brian@smithrenaud.com> wrote:
>In article <5E1U3.25414$23.1318497@typ11.nn.bcandid.com>,
>kragen@dnaco.net (Kragen Sitaker) wrote:
>>This puzzles me a bit.  I thought you couldn't ever have a list in a
>>scalar context, ever, ever, ever. 
>
>that's why a conversion happens (but not according to any general
>rule!).  assign a list to a scalar and you get the last element
>in the list. try it:
>
>   $n = ('a', 'b', 'c');
>   print $n;

I always thought that was a sequence of expressions separated by the
comma operator, with the same meaning as in C: evaluate left operand,
throw away value, then evaluate right operand.  No lists involved.

Array-slicing giving a scalar context to its second arg when it's in a
scalar context would explain @n[0,1,2], because ,'s scalar-context
meaning would make sense.  But it wouldn't explain 0..2, because ..'s
scalar-context meaning is very different.

I wrote a script to see if I was right, but I can't understand the output:

perl -MO=Terse -e 'my $a = 4; my $x = (1, 2, 3, 4); my @y = (1, 2, 3, 4);'
-e syntax OK
LISTOP (0xc73b0) pp_leave
    OP (0x135a18) pp_enter
    COP (0xc73e0) pp_nextstate
    BINOP (0xc0780) pp_sassign
        SVOP (0xc0760) pp_const  IV (0xc7b7c) 4
        OP (0xc88f8) pp_padsv [1]
    COP (0xc75f0) pp_nextstate
    BINOP (0xc06e0) pp_sassign
        LISTOP (0xbfc70) pp_list
            OP (0x135aa8) pp_pushmark
            OP (0xc0720) pp_null [5]
            OP (0xc0700) pp_null [5]
            OP (0xc06c0) pp_null [5]
            SVOP (0xc06a0) pp_const  IV (0xc7bf4) 4
        OP (0xd2080) pp_padsv [2]
    COP (0xc7470) pp_nextstate
    BINOP (0x12fbc0) pp_aassign [4]
        UNOP (0xc7590) pp_null [141]
            OP (0x135a60) pp_pushmark
            SVOP (0xc0740) pp_const  IV (0xc7bd0) 1
            SVOP (0xc00c0) pp_const  IV (0xc7be8) 2
            SVOP (0xc07c0) pp_const  IV (0xc7bb8) 3
            SVOP (0x12fba0) pp_const  IV (0xc7bc4) 4
        UNOP (0xc74a0) pp_null [141]
            OP (0x135a78) pp_pushmark
            OP (0x135ac0) pp_padav [3]

It sure looks like I was wrong -- I see a pp_sassign with a child
LISTOP called pp_list, with children pp_pushmark, three pp_nulls, and a
pp_const pushing 4, and then a pp_sv, for the ... in $x = ... .  So I
guess it must be a list, right?  But wait!  The @y=...'s ... has an
UNOP pp_null for a child instead of a LISTOP pp_list, then the four
pp_consts in the list, then a pp_null, a pp_pushmark, and a pp_padav.

The problem is that I don't know what all these things are or how to
find out.

>then go one step further:
>
>   @n = ('a', 'b', 'c');
>   $n = @n[0..2];
>   print $n;

perl -MO=Terse -e 'my @n=qw(a b c); my @m=@n[0..2]; my $m=@n[0..2];'
-e syntax OK
LISTOP (0xc74a0) pp_leave
    OP (0x135910) pp_enter
    COP (0xc7590) pp_nextstate
    BINOP (0xc0720) pp_aassign [3]
        UNOP (0xc75f0) pp_null [141]
            OP (0xd2080) pp_pushmark
            LISTOP (0xc73b0) pp_split [2]
                PMOP (0xc81c0) pp_pushre /\s+/
                SVOP (0xc0760) pp_const  PVIV (0xbd9d8) "a b c"
                SVOP (0xc0780) pp_const  IV (0xc7ba0) 0
        UNOP (0xc7500) pp_null [141]
            OP (0x135a90) pp_pushmark
            OP (0xc88f8) pp_padav [1]

That looks like the qw.

    COP (0xc74d0) pp_nextstate
    BINOP (0xc06e0) pp_aassign [7]
        UNOP (0xc7560) pp_null [141]
            OP (0x135a30) pp_pushmark
            LISTOP (0xc7410) pp_aslice
                OP (0x135a18) pp_pushmark
                UNOP (0xc0740) pp_rv2av
                    SVOP (0xc07c0) pp_const  AV (0xc9c80) FILL 2

Looks like the .. is here.  What's the AV?

                OP (0x135a78) pp_padav [1]

That's @n, and

        UNOP (0xc7530) pp_null [141]
            OP (0x1359b8) pp_pushmark
            OP (0x135aa8) pp_padav [4]

here's where it's getting assigned to @m.

    COP (0x13d5f0) pp_nextstate
    BINOP (0xc0700) pp_sassign
        LISTOP (0x13d710) pp_aslice
            OP (0x1359a0) pp_pushmark
            UNOP (0x12fba0) pp_rv2av
                SVOP (0x12fbc0) pp_const  AV (0x14f480) FILL 2
            OP (0x135a60) pp_padav [1]
        OP (0x1359d0) pp_padsv [8]

Looks like the .. is being turned into the same ops in both contexts.
It looks very different in scalar context:

perl -MO=Terse -e 'my $x = 0..2; print "<$x>\n"'
-e syntax OK
LISTOP (0xbfc70) pp_leave
    OP (0x135a60) pp_enter
    COP (0xc73b0) pp_nextstate
    BINOP (0xc06c0) pp_sassign
        UNOP (0xc06e0) pp_null
            UNOP (0xc0720) pp_flop
                UNOP (0xc0740) pp_flip [3]
                    CONDOP (0xc73e0) pp_range [2]
                        SVOP (0xc0780) pp_const  IV (0xc7b7c) 0
                        SVOP (0xc07a0) pp_const  IV (0xc7ba0) 2

I was always told it was like a flip-flop; now I see the flip and the flop.

        OP (0xc88f8) pp_padsv [1]
    COP (0xc7590) pp_nextstate
    LISTOP (0xc7500) pp_print
        OP (0x135ac0) pp_pushmark
        UNOP (0xc75f0) pp_null [67]
            OP (0x135a48) pp_null [3]
            BINOP (0xc07e0) pp_concat [5]
                BINOP (0xc00c0) pp_concat [4]
                    SVOP (0xc0700) pp_const  PV (0xc7bd0) "<"
                    OP (0x135aa8) pp_padsv [1]
                SVOP (0xc0760) pp_const  PV (0xc7bf4) ">\n"

OK, so in $x=@y[expr], expr gets list context.  So the array-slice
operation must be doing the job.  perldoc perldata says nothing about
how array slices behave when evaluated in scalar context, but it does
have this little gem:

     If you evaluate a named array in a scalar context, it returns the
     length of the array.  (Note that this is not true of lists, which
     return the last value, like the C comma operator, . . .

>>So I'm a little puzzled about this.
>>Is this just a hack on the array-slicing operation so that @a[1] works
>>as you'd expect?
>
>that depends on what you expect.  for those that try to make Perl
>fit into some external set of rules (mis-named "common sense" in this 
>thread) aren't likely to expect the right thing.  there's an aptly named
>chapter in the Camel book that covers this sort of stuff. :)

I suppose I should go back and read the Camel again.  Is it in the
second edition?  That's the one I have.  (I learned perl4 from the man page.)
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 03 Nov 1999 20:12:13 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: perl lang parser
Message-Id: <xG0U3.1072$c06.12097@news.rdc1.ct.home.com>

Salem Lee Ganzhorn <slganzho@unity.ncsu.edu> wrote:
> : I am looking for a package which can parse a perl script and store the 
> : information in a structure.
> : 
> : This is for creating and managing code dependancies.
> : TIA

> Whew, thanks for the information all.
> I guess my answer is I need to learn another language... YACC

If all you're doing is scanning the code to handle dependencies, you most
definitely don't need yacc. It's *way* overkill, and won't do what you
want.

Just scan through for require, do, and use, and you should be able to get
the info you need. You may need to go walk the perl install tree to check
module dates and such, but that's about it.

					Dan


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

Date: Wed, 03 Nov 1999 12:07:32 -0800
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: perl on ms PWS on win98
Message-Id: <38209604.F51681CB@midnightbeach.com>

Chris Mannings wrote:
 
> Any body know an easy way to get perl to run on a web located on a ms
> Personnal Web Server running on w98?  tried mapping to perl exe in regedit,
> tried file assoc in control panel, still getting 'server error 505'. Any
> good ideas?

If PWS under Win98 is anything like PWS under NT Workstation, there's an
"Internet Service Manager" in the Start menu's PWS submenu. Bring that
up, and right click on the directory your Perl scripts are in. Bring up
the Properties dialog, then click on the Configure button and Add a new
file association between .pl and perlis.dll.

-- 

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


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

Date: Wed, 3 Nov 1999 14:24:01 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: perldoc and the string "PI::"
Message-Id: <Pine.GSO.4.10.9911031414080.29670-100000@user2.teleport.com>

On Wed, 3 Nov 1999, Alan Curry wrote:

> pod2man is converting the word "PI" to the greek letter.

The fact that PI happens to be the name of a Greek letter shouldn't make
one iota of difference. Does this also affect alpha test versions of
software to monitor the effects of gamma ray bombardment on beta-format
videos starring Catherine Zeta-Jones?

-xi-

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 03 Nov 1999 21:58:39 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: Premature End Of Script Headers
Message-Id: <I70gOLLI6rNQN0nV1Z+ZypGuuG3F@4ax.com>

On Tue, 02 Nov 1999 23:46:57 GMT, kragen@dnaco.net (Kragen Sitaker)
wrote:

> In article <ZEMfOOVhwxRIiVD=iIjFK5nUPin=@4ax.com>,
> Marcel Grunauer  <marcel.grunauer@lovely.net> wrote:
> >
> >That sounds like an Abigailism :-)
> 
> Wow.  Abigail actually followed up to the same post and responded
> exactly the same way, except that she didn't point lovely Marcel at the
> Idiot's Guide.

Ahem, but *I* didn't actually ask the original question... But the
comment wasn't meant to be disparaging, quite the opposite.


-- 
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;


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

Date: Wed, 03 Nov 1999 22:47:21 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Premature End Of Script Headers
Message-Id: <ZX2U3.25595$23.1331768@typ11.nn.bcandid.com>

In article <I70gOLLI6rNQN0nV1Z+ZypGuuG3F@4ax.com>,
Marcel Grunauer  <marcel.grunauer@lovely.net> wrote:
>On Tue, 02 Nov 1999 23:46:57 GMT, kragen@dnaco.net (Kragen Sitaker)
>wrote:
>> Wow.  Abigail actually followed up to the same post and responded
>> exactly the same way, except that she didn't point lovely Marcel at the
>> Idiot's Guide.
>
>Ahem, but *I* didn't actually ask the original question... But the
>comment wasn't meant to be disparaging, quite the opposite.

Um, oops.  Sorry.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 03 Nov 1999 21:51:20 +0100
From: jand@activestate.com (Jan Dubois)
Subject: Re: Problems installing ActivePerl build 522
Message-Id: <38209bc6.3182916@news3.ibm.net>

[mailed & posted]

"Peter Steele" <psteele@opticalnetworks.com> wrote:

>I just downloaded the new ActivePerl build 522 from activestate.com and at
>about 80% through the installation process I get the error
>
>    "cannot create Perl interpreter"
>
>and it aborts the installation. I ran the installer on a just booted system
>with no other apps running. Does anyone know what might be causing this
>error?

I believe if you actually read the installation notes that the install program
shows you at the very beginning, then you might get an explanation why/how
this can happen. :-)

You are probably trying to install into a versioned directory structure build
using 5.005_02 (AP522 is based on 5.005_03).

-Jan



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

Date: Wed, 03 Nov 1999 22:14:31 GMT
From: ditzhazy@mitre.org (Lisa Ditzhazy)
Subject: Problems with email and windows NT
Message-Id: <3820b2c3.22086899@newsflash.mitre.org>

I am having problems with a simple program that takes in the name of a
file to email and then emails it to a valid address.  This is being
executed on a Windows NT 4.0 workstation system.  The code, simple
though it may be is below.

print "what file to send  ";
$file=<STDIN>;
chop ($file);
print "you said the file is $file\n";
open (WORDSLIST, $file) || die "can't open $file: $!";
print "file now opened \n";
print <WORDSLIST>;
open MAIL, "|mail ditzhazy\@mitre.org";
print MAIL <WORDSLIST>;
print "message printed\n";
close MAIL;
print "end or program";
END


I can run the program but the email never seems to be sent.  I
downloaded the debugger and received the following error at the end of
the program

END {Win 32: : OLE ---> uninitialized (305414945)


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

Date: Wed, 03 Nov 1999 22:59:30 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: Problems with email and windows NT
Message-Id: <m73U3.632$Yr1.153278@news.shore.net>

Lisa Ditzhazy <ditzhazy@mitre.org> wrote:
: I am having problems with a simple program that takes in the name of a
: file to email and then emails it to a valid address.  This is being
: executed on a Windows NT 4.0 workstation system.  The code, simple
: though it may be is below.

: open MAIL, "|mail ditzhazy\@mitre.org";

Do you have a program called "mail" installed on your NT machine? That's
probably your problem. 

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


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

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


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