[7503] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1129 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 5 18:06:20 1997

Date: Sun, 5 Oct 97 15:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 5 Oct 1997     Volume: 8 Number: 1129

Today's topics:
     Re: $x = $y || $z - dangerous assumption? (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     accursed error message <bkelvis@yakko.cs.wmich.edu>
     Activestate Perl extension is not working <niteowl@hooked.net>
     Re: beginners help hash-of-hashes (Mike Stok)
     Re: beginners help hash-of-hashes (Hans Malmberg)
     Cookie Help! <aljohns@novice.uwaterloo.ca>
     Re: Cookie Help! (brian d foy)
     file open <muchnik@wpi.edu>
     Re: file open (Jeremy D. Zawodny)
     Re: Help: Regular Expression Substitution (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Re: MailTools-1.09 question (Mitch Kutzko)
     Re: Method not allowed? (brian d foy)
     Re: Newbie CGI question (brian d foy)
     Re: Newbie ques: How to concatenate two strings? (Chris Russo)
     Re: Perl Questions (Tad McClellan)
     Perl, NTFS or FAT <niteowl@hooked.net>
     Q : Files using question <ivanir@ilx334.iil.intel.com>
     Re: Question about module installation (Andrew M. Langmead)
     Re: sfio on Solaris Intel 2.5.1 (Stefan Reich)
     SGML-SPGrove-0.01: perl module for loading SGML, XML, H <ken@bitsko.slc.ut.us>
     WHERE TO GET & HOW TO INSTALL PERL5 <hamrick@alltel.net>
     Re: WHERE TO GET & HOW TO INSTALL PERL5 (Jeremy D. Zawodny)
     Re: Why don't 'require' variables count towards "used o (Andrew M. Langmead)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 05 Oct 97 12:48:29 -0400
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: $x = $y || $z - dangerous assumption?
Message-Id: <3437c83f$4$ofn$mr2ice@speaker>

In <617iop$42r$1@towncrier.cc.monash.edu.au>, on 10/05/97 at 08,
   damian@cs.monash.edu.au (Damian Conway) said:
+-----
| Not presuming to second-guess the Perl Gods (:-), but does it need to be
| anything fancier than:
| 	sub first_defined { map { return $_ if defined $_ } @_ }
| 	my $x = first_defined(shift, $default);
+--->8

It evaluates all its arguments (should the "shift" happen if it's the second
argument but the first argument is defined?  It will, with yours), and it
looks potentially troublesome in a list context:  what should the behavior be
when invoked as

    my ($x, $y) = first_defined(...);   ?

As defined above, first_defined() returns a scalar so $y ends up undef no
matter what; but there may be reasons to prefer that the builtin version
return e.g. a list with "undef" values removed.

(You've got me half-tempted to get on the mailing list for such things to see
what's going on, but I haven't dealt with Perl internals since sometime in the
Perl4 era; I'd probably be totally lost.  :-)

-- 
brandon s. allbery              [Team OS/2][Linux]          bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)                 KF8NH
Warpstock '97:  OS/2 for the rest of us!  http://www.warpstock.org
Memo to MLS:  End The Burn Scam --- Doug Logan MUST GO!  FORZA CREW!



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

Date: 5 Oct 1997 19:47:20 GMT
From: nectar  quash  transparent <bkelvis@yakko.cs.wmich.edu>
Subject: accursed error message
Message-Id: <618qs8$jht$1@news.wmich.edu>

I'll keep this short and sweet.  Heres the message.

Modification of a read-only value attempted at (eval 203) line 11.

apparently im mucking with something that doesnt want to be
mucked with, but where is it at?  
Basically, what does the " at (eval 203) line 11"  refer to?

thanks and toodles
Phillias


-- 
"I am mighty!  I have a glow you cannot see.  I have a heart as big as the
moon, as warm as bathwater.  We're superheroes, man!  We don't have time to
be charming!  The boots of evil were made for walking.  We're watching the
big picture, friend.  We know the score.  We are a public service, not
glamour boys!  Not captains of industry!  Not makers of things!  Keep your
vulgar moneys.  We are a justice sandwich, no toppings necessary!  Living
rooms of America, do you catch my drift?  Do you...dig?"
-Tick rambling during a television interview


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

Date: 5 Oct 1997 16:28:16 GMT
From: "Rick" <niteowl@hooked.net>
Subject: Activestate Perl extension is not working
Message-Id: <01bcd1ab$c32313c0$710b50ce@odyssey>

I'm attempting to learn how to create Perl C++ extensions.  Presently I
plan to embed the Activestate's win32 port so I am using this source.  It
appears that I'm missing somthing because I get the following message.

Can't find loadable object for module Hello in @INC at test.pl line 2

Well, I know it's finding the PM file because I added a simple subroutine
to it and called if from my test PL file and it ran fine.  It seems the
extension that is exported in the PM module is not set up correctly.

Here is the C++ file.  I remove the extern "C" from the headers because
Activestates source is not a C build but is a C++ build.  But I left it on
the extension fuction and it's boot function so their names would not be
mangled by C++.  The following file was initially created from an XS file
using XSUBPP from the standard perl 5.004_03 build but I modified it as the
Activestate dll is C++, not C.  I didn't see any extern "C" blocks in the
Activestate headers so I assumed they are using C++ mangled names.  But i
assumed that the names to be recognize as Perl commands could not be name
mangled... thus the extern "C" in front of the XS_Hello_Hello and
boot_Hello functions. 

#line 1 "hello.xs"
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
extern "C" XS(XS_Hello_Hello)
{
    dXSARGS;
    if (items != 0)
		croak("Usage: Hello::hello()");
    {
#line 13 "hello.xs"
    printf("Hello, world from the hello C++ extension!\n");
#line 24 "hello.c"
    }
    XSRETURN_EMPTY;
}

extern "C" __declspec(dllexport) XS(boot_Hello)
{
    dXSARGS;
    char* file = __FILE__;
    XS_VERSION_BOOTCHECK ;
    newXS("Hello::Hello", XS_Hello_Hello, file);
    ST(0) = &sv_yes;
    XSRETURN(1);
}

The __declspec(dllexport) modifier just tells VC++ to export the function
so I don't need a .DEF file.

I added this file to my dll project and built it.

My module PM file is as follows

package Hello;

require Exporter;
require DynaLoader;

# test sub to see if module is being found
#sub Hello 
#{
#	print "Hello world.\n";
#}

@ISA = qw(Exporter DynaLoader);
@EXPORT = qw(&Hello);
$VERSION = '0.01';
#bootstrap Hello $VERSION;  
# when the above statement didn't work, I tried the following
$module = "Hello";
DynaLoader::bootstrap($module); 
1;

My test PL script is as follows

use hello;
Hello::Hello();

I am wondering are there any obvious errors here?  

If anyone has a simple example of how to do this without using the canned
make file generating tools I'd appreciate it if you could email it to me,
or post it.  I'm using win NT and these tools often don't complete their
builds when using NMAKE so I'd rather just modify my dll project by hand.  
h2xs and xsubpp seem to work fine.  Since I'm using the VC++ developer
studio project make utilities, the Perl make file tools do me little good. 
I'm sure that in a unix environement that these tool are excellent. I
suspect my problem is in the Hello.pm file since when I go into debug mode
and put break point in the boot_Hello function it never gets called. 

Any advice would be greatly appreciated.

Thanks

Rick Hennegan

send email to...niteowl@hooked.net




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

Date: 5 Oct 1997 15:18:51 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: beginners help hash-of-hashes
Message-Id: <618b4r$8bi@news-central.tiac.net>

In article <199710051646511660315@du39-93.ppp.algonet.se>,
Hans Malmberg <hansmbg@algonet.se> wrote:
>I am trying to get a hash of hashes list to 'work'.
>I have typed the examples of 'Programming Perl' but I
>can't get this code to get me the result I expect.
>
>This is my first steps...
>-------------------------------------------------------------------
>#!/usr/bin/perl
>
># hoh.pl
># 97-10-05  16:09
>
>    
>%LISTA = (
>
>   M10 => {
>           name      => "Bult M10",
>           numbers   => 2606,
>           price     => 5.85,
>           },

This is effectively the same as the following sequence of assignments,
assuming that $LISTA{M10} was empty or didn't exist before:

  $LISTA{M10}{name} = "Bult M10";
  $LISTA{M10}{numbers} = 2606;
  $LISTA{M10}{price} = 5.85;

  [...]

>$i = 1;
>
>foreach $type ( keys %LISTA) {
>   print "$i. $type is    : @{ $LISTA{$type}{name} }\n";
>   print "   Numbers  : @{ $LISTA{$type}{numbers} }\n";
>   print "   Price    : @{ $LISTA{$type}{price}  }\n";
>   $i += 1;
>   }

Here the @{ ... } says you expect the stuff between the {}s to evaluate to
an array reference as the @{ ... } is used to dereference.  As you're just
stashing scalars in the second level you migth want to say something like:

  foreach $type (keys %LISTA) {
    print "$i. $type is    : $LISTA{$type}{name}\n";
    print "   Numbers  : $LISTA{$type}{numbers}\n";
    print "   Price    : $LISTA{$type}{price}\n";
    $i++;
  }

One way to get a handle on what's going on is to use the debugger and
break at the statement after the assignment to %LISTA, the X command
pretty prints complex structures e.g.

%LISTA = (
   'M10' => HASH(0x805fd90)
      'name' => 'Bult M10'
      'numbers' => 2606
      'price' => 5.85
)

The reason that it worked at all is that perl has 2 kinds of references,
and if strict refs aren't in force then perl will yry and use the scalar
that $LISTA{$type}{name} evaluates to as the name of an array when it's
inside @{ ... }.  Modifying your code a little to this:

#!/usr/local/bin/perl -w

use strict;

my %LISTA = (
   M10 => {
           name      => "Bult M10",
           numbers   => 2606,
           price     => 5.85,
           },
);

my $i = 1;
my $type;

foreach $type (keys %LISTA) {
  print "$i. $type is    : @{$LISTA{$type}{name}}\n";
  print "   Numbers  : $LISTA{$type}{numbers}\n";
  print "   Price    : $LISTA{$type}{price}\n";
  $i++;
}

and trying to run it gives this:

bash$ ./try.pl
Can't use string ("Bult M10") as an ARRAY ref while "strict refs" in use at ./try.pl line 17.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Sun, 5 Oct 1997 20:25:32 +0100
From: hansmbg@algonet.se (Hans Malmberg)
Subject: Re: beginners help hash-of-hashes
Message-Id: <19971005202532626745@du159-92.ppp.algonet.se>

Mike Stok <mike@stok.co.uk> wrote:

> inside @{ ... }.  Modifying your code a little to this:
> 
> #!/usr/local/bin/perl -w
> 
> use strict;
> 
> my %LISTA = ( M10 => { name      => "Bult M10", numbers   => 2606, price
> => 5.85, }, );
> 
> my $i = 1; type;
> 
> foreach $type (keys %LISTA) { 
> print "$i. $type is    : @{$LISTA{$type}{name}}\n";
> print "   Numbers  : $LISTA{$type}{numbers}\n";
> print "   Price    : $LISTA{$type}{price}\n"; $i++; }
> 
> and trying to run it gives this:
> 
> bash$ ./try.pl Can't use string ("Bult M10") as an ARRAY ref while "strict
> refs" in use at ./try.pl line 17.
> 
> Hope this helps,

Sorry Mike,
I get more confused.
Invoking 'use strict;' stopped the code from working at all,
I got these lines and a lot more of the same content...

# Global symbol "i" requires explicit package name.
File 'AX3-TX:Internet:MacPerl:cgi-bin:hoh_2.pl'; Line 9
# Global symbol "LISTA" requires explicit package name.
File 'AX3-TX:Internet:MacPerl:cgi-bin:hoh_2.pl'; Line 11
# Variable "%LISTA" is not imported.
File 'AX3-TX:Internet:MacPerl:cgi-bin:hoh_2.pl'; Line 12
# Global symbol "LISTA" requires explicit package name.
File 'AX3-TX:Internet:MacPerl:cgi-bin:hoh_2.pl'; Line 12
# Variable "%LISTA" is not imported.

I don't know what '# Global symbol "i" requires explicit package name.'
demands of my code. I tried the other declaration of the variables you
wrote, but I still can't understand why the output is empty.
1. M12 is    :
   Numbers  : 
   Price    : 

But, if I declare 
$LISTA{M12}{name} = [ qw(Bult M12)];
then
I get an output of just that only field. Not of the others.

My question still is   How to declare 
>%LISTA = (
>
>   M10 => {
>           name      => "Bult M10",
>           numbers   => 2606,
>           price     => 5.85,
>           },
>     ...
>
>        );

to get 
foreach $type (keys %LISTA) {
    print "$i. $type is    : $LISTA{$type}{name}\n";
    print "   Numbers  : $LISTA{$type}{numbers}\n";
    print "   Price    : $LISTA{$type}{price}\n";
    $i++;
to work and give an output?

Thanks for your support,
-- 
/Hans   ---   LUND   13.10'30(E   55.43'24(N


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

Date: Sun, 05 Oct 1997 13:40:31 -0400
From: Alison Johns <aljohns@novice.uwaterloo.ca>
Subject: Cookie Help!
Message-Id: <3437D10E.E4B92083@novice.uwaterloo.ca>

I'm after information about how to ADD or SUBTRACT to already placed
information in a cookie. Almost like a little shopping cart.

Any help would be great...


Steve:)



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

Date: Sun, 05 Oct 1997 17:36:28 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Cookie Help!
Message-Id: <comdog-ya02408000R0510971736280001@news.panix.com>

[follow ups set]

In article <3437D10E.E4B92083@novice.uwaterloo.ca>, aljohns@novice.uwaterloo.ca wrote:

>I'm after information about how to ADD or SUBTRACT to already placed
>information in a cookie. Almost like a little shopping cart.

see the resources in the CGI Meta FAQ.  further questions should go
to a more appropriate newsgroup :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Sun, 5 Oct 1997 13:33:13 -0400
From: Rostislav Muchnik <muchnik@wpi.edu>
Subject: file open
Message-Id: <Pine.OSF.3.95q.971005133033.3258A-100000@ernie.WPI.EDU>


Hi

I need create a program in pearl that will create a file
and write something to it. I have to trigger that program from
web page. How can I do that?

Thanks a lot.





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

Date: Sun, 05 Oct 1997 20:25:30 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: file open
Message-Id: <3438f767.610805932@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Sun, 5 Oct 1997 13:33:13 -0400, Rostislav Muchnik <muchnik@wpi.edu>
wrote:

>I need create a program in pearl that will create a file
>and write something to it. I have to trigger that program from
>web page. How can I do that?

Write it as a CGI script and call it using the proper HTML syntax from
the page in question.

You may find the CGI.pm module helpful. You may also want to read some
introductory material about CGI programming, since it's kind obvious
that you haven't already done so.

Good Luck,

Jeremy
-- 
Jeremy D. Zawodny
WCNet Technical Geek & Web Stuff
<URL:http://www.wcnet.org/~jzawodn/>

"That's an example of how Perl can bring school yard cruelty to new heights."
    -- Jon Orwant at the 1st Annual Perl Conference


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

Date: Sun, 05 Oct 97 13:12:37 -0400
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: Help: Regular Expression Substitution
Message-Id: <3437cc42$5$ofn$mr2ice@speaker>

In <875988995.8473@dejanews.com>, on 10/04/97 at 01,
   kai@webexpert.net said:
+-----
|  3) Anyone have any thoughts of how to parse out comments in PERL?!? :-P
| Comments are started with #, unless if # are within quotes or regular
| expression delimiters... unfortunately, those delimiters can be ANYTHING as
| long as the regular expression starts with m, s, y, tr,... anything ELSE?!
+--->8

Not to mention q/qq, and here documents introduce yet another complication. 
And you can embed comments in regexps with the "x" option.  Fun stuff, indeed
:-)

-- 
brandon s. allbery              [Team OS/2][Linux]          bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)                 KF8NH
Warpstock '97:  OS/2 for the rest of us!  http://www.warpstock.org
Memo to MLS:  End The Burn Scam --- Doug Logan MUST GO!  FORZA CREW!



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

Date: Sun, 05 Oct 1997 15:00:52 GMT
From: mitch@ncsa.uiuc.edu (Mitch Kutzko)
Subject: Re: MailTools-1.09 question
Message-Id: <3437ab84.583713125@news.cso.uiuc.edu>

Bingo!  This does exactly what I want -- Thanks!!

Mitch

On 3 Oct 1997 12:11:58 -0700, mcravit@best.com (Matthew Cravit) wrote:

>In article <343528e0.155249406@news.cso.uiuc.edu>,
>Mitch Kutzko <mitch@uiuc.edu> wrote:
>>difficulty figuring out how to accomplish.  I have to write a Perl
>>utility that can be sent mail, and then have it strip off all the
>
>>Any suggestions?  Hints?  Anything would be greatly appreciated!
>
>The Mail::Internet and MIME::Entity modules might help. Here's a short
>chunk of code (from a mailbot I wrote) to grab header stuff. This might
>be a good start for you:
>
>    use Mail::Internet;
>
>    $message = new Mail::Internet(\*STDIN);
>
>    $from = $message->head()->get('From');
>    $to   = $message->head()->get('To');
>    # etc.
>
>Hope this helps.
>
>/MC
>
>-- 
>Matthew Cravit, N9VWG               | Experience is what allows you to
>E-mail: mcravit@best.com (home)     | recognize a mistake the second
>        mcravit@taos.com (work)     | time you make it.



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

Date: Sun, 05 Oct 1997 17:37:37 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Method not allowed?
Message-Id: <comdog-ya02408000R0510971737370001@news.panix.com>

In article <34378b25.50841734@news.gatech.edu>, deanmao2@hotmail.com wrote:

>Hi, I'm a newbie to perl & html interaction and ran into a problem when I 
>tried to use a form to execute my perl script.  It showed the following 
>error:
>
>Method Not Allowed
>The requested method POST is not allowed for the URL /cgi-bin/mine.pl

have you gone through the troubleshooting steps in 

   <URL:http://language.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>

?

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Sun, 05 Oct 1997 17:28:29 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Newbie CGI question
Message-Id: <comdog-ya02408000R0510971728290001@news.panix.com>

In article <34343118.8C5FE1C4@simplex.com>, David Barr <dbarr@simplex.com> wrote:

>Would someone please send me a code fragment that shows me the basic basic
>read and write capabilities of perl when receiving from and sending to a
>web client.   Also, I'm not certain of the interaction between the web
>client, the web server, and the actual script, so hints there would also be
>helpful.

CGI.pm [1] will take care of all the hard work for you.  it comes with 
plenty of examples and lots of documentation.

>Oh, and please reply by email, as I rarely get time to surf USENET looking
>for responses.

if you can't read the response in the newsgroup, then it must not be that
important.


[1] 
Comprehensive Perl Archive Network
find one near you at <URL:http://www.perl.com>

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Sun, 05 Oct 1997 13:02:03 -0700
From: news@russo.org (Chris Russo)
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <news-0510971302030001@buzz.alink.net>

In article <3436ca50.336964@news.one.net>, over@the.net wrote:

>tadmc@flash.net (Tad McClellan) wrote:
>
>
>>Do you see how folks might get annoyed to see it yet again?
>
>Then let someone else answer them.

Right, and encourage the amount of noise to even higher levels so that the
people who best understand perl, like Tom C, Randal, Tad, and others don't
even bother to read this group.

No thanks.

Chris Russo

--
Chris Russo                          A-Link Network Services, Inc.
news@russo.org                       Bolo me
http://www.alink.net/~crusso


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

Date: Sun, 5 Oct 1997 08:38:13 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl Questions
Message-Id: <585816.dm.ln@localhost>

Kuntal Daftary (daftary@cisco.com) wrote:
: Matt wrote:

: > I can't even get a perl file to execute when a user wants it to.......maybe
: > you can help me with that, everytime I hit the submit button, the browser
: > tries to download the script.  The registry is ok, I've checked that
: > out....

: this shud be typically your problem:

: servers execute programs as CGI only when they have certain specific
                                  ^^^^^^^^^                   ^^^^^^^^
: extensions.
  ^^^^^^^^^^

Not 'only'.

Some are configured that way.

Some are configured a different way.


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 5 Oct 1997 16:54:27 GMT
From: "Rick" <niteowl@hooked.net>
Subject: Perl, NTFS or FAT
Message-Id: <01bcd1af$6b3ea1c0$710b50ce@odyssey>


I'm building perl using the 5.004_03 and the win32 make file and the perl
modules that are called by NMAKE often fail.  One error is that it can't
perform a split.  Is it possible that my FAT disk format is not compatible
with these file operations and that maybe I need to format to NTFS to get
the scripts to run completely.  The complier always finishes building the
executables but the files that are supposed to be copied to this  

INST_DRV=d:
INST_TOP=$(INST_DRV)\perl5

directory never get copied there.  

Later on when I try to run other scripts like Makefile.pl I get weird
results unless I specify the INST_DRV to be the original perl source
directory becuase the config file which points to INST_DRV is telling the
scripts to look for files in destinations that don't exist.  Anyone run
across this problem?  What is the least painful solution?  By the way, I
hate the hassle NTFS causes me.  It forces me to reboot to access those
file areas when I'm in Win95 and is the reason I went back to FAT years
ago.

Thanks

Rick


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

Date: 05 Oct 1997 17:01:43 +0200
From: Efi Ivanir <ivanir@ilx334.iil.intel.com>
Subject: Q : Files using question
Message-Id: <xqu4t6w6yp4.fsf@ilx334.iil.intel.com>


Hi

When I read file with :

open(FILE,what-ever) ;
while(<FILE>) {

}

Can I , In the middle of the while loop, go back one line ? Or maybe
can I reset the while loop identifier so he re-read the file ?

Thanks

 Efi Ivanir 
 ivanir@iil.intel.com 


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

Date: Sun, 5 Oct 1997 15:54:04 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Question about module installation
Message-Id: <EHL5I4.13I@world.std.com>

plambert$1@plambert.org writes:

>Specifically, we have perl installed at our site in one place, and I need
>to install the modules in another, and force users to add something to
>@INC before using the modules, to make the point that they are 
>unsupported:

<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq8/
How_do_I_kep_my_own_module_libr.html>

once you install the unsupported modules with a prefix of
/usr/local/unsupported/perl/, or something like that, the users can
either add the directory to the PERLLIB environment variable, or use
the "use lib" pragmatic module to add the unsupported directory to
their search path.

>  How do I keep my own module/library directory?
>
>    When you build modules, use the PREFIX option when generating
>    Makefiles:
>
>        perl Makefile.PL PREFIX=/u/mydir/perl
>
>    then either set the PERL5LIB environment variable before you run
>    scripts that use the modules/libraries (see the perlrun manpage) or
>    say
>
>        use lib '/u/mydir/perl';
>
>    See Perl's the lib manpage for more information.

-- 
Andrew Langmead


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

Date: 5 Oct 1997 16:41:12 GMT
From: 1reich@informatik.uni-hamburg.de.fuck-spam (Stefan Reich)
Subject: Re: sfio on Solaris Intel 2.5.1
Message-Id: <618fv8$hvk$1@heinz.home.de>

In <617nvh$j71$1@alanya.m.isar.de> Lupe Christoph wrote:
> portinfo@best.com (Gene Gotimer) writes:
> 
> >Has anyone gotten sfio to build on Solaris Intel 2.5.1?

I had the same problem some time ago. The trick is: the configuratation 
script relies on cc beeing the c compiler. If you don't have an cc alias for 
gcc the script won't produce output, since it can't compile the tests.

So, make cc an alias for gcc and it should work.

Stefan



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

Date: 05 Oct 1997 11:21:08 -0500
From: Ken MacLeod <ken@bitsko.slc.ut.us>
Subject: SGML-SPGrove-0.01: perl module for loading SGML, XML, HTML
Message-Id: <m3afgoyydm.fsf@biff.bitsko.slc.ut.us>



                            SGML::SPGrove

                   A Perl 5 module for loading SGML,
                   XML, and HTML document instances
                       using James Clark's SP.


                             Ken MacLeod
                         ken@bitsko.slc.ut.us

INTRODUCTION

    The SGML::SPGrove module links with James Clark's SGML Parser (SP)
    to load SGML, XML, and HTML document instances.

    This is version 0.01.  This release is simple, solid, and usable,
    but features to be added over the next few weeks will make it
    incredibly more useful.  See FUTURE for current status and
    upcoming changes.

    Newer versions of this module can be found at
    <ftp://ftp.uu.net/vendor/bitsko/gdo/>.

    Copyright (C) 1997 Ken MacLeod
    SPGrove is distributed under the same terms as SP.  See the file
    COPYING for distribution terms.

OVERVIEW

    SGML::SPGrove takes a system identifier and passes it to SP to
    parse, as each element is parsed from the document SPGrove builds
    Perl objects to match.  When done parsing, SPGrove returns an
    SGML::SPGrove object that contains the root element of the parsed
    document and an array (hopefully empty :-) of parser errors.

    Elements of the document are SGML::Element objects.  Elements
    have a generic identifier (or name), attributes, and the contents
    of the element.  Attributes are stored as a Perl hash, with the
    values as an array of scalars and SGML::SData objects.  The
    contents of an element may be more Elements, scalars, SData
    objects, or processing instruction (PI) objects.

    SGML::SData objects are replacements for character entity
    references within the document.  The Text::EntityMap perl module
    can be used to map SData replacements from common character entity
    sets to common output formats.

<ftp://ftp.uu.net/vendor/bitsko/entity-map/>

    SGML::PI objects are processing instructions contained within the
    document.

    See the pod/man pages for SGML::SPGrove, SGML::Element,
    SGML::SData, SGML::PI for more info.

INSTALLATION

    SGML::SPGrove requires Perl 5 and James Clark's SP (from the Jade
    distribution).  SP requires a C++ compiler.

<http://www.perl.com>
<http://www.jclark.com>

    1)  SPGrove needs SP's `libsp.a' and include files.  SP's `make
        install' does not install these [I'm working on that, I should
        have an RPM available soon].  Create a workarea for compiling
        SP, compile it and keep the workarea until SPGrove is done.

        Edit SPGrove's Makefile.PL to point `LIBS' to SP's `lib'
        directory and `INC' to SP's three include directories.  I've
        left my templates in to point the way.

    2)  standard Perl module after that,

            perl Makefile.PL
            make
            make check
            make install

        Just so you know, SPGrove's copy of SP's library is included
        in the install, that's over a megabyte and a half.

        FYI, a statically linked perl executable (`make perl') appears
        to run significantly faster, in one test, 17 seconds instead
        of 25 seconds.

FUTURE

    This release is the first eight hours of work, the next eight
    should bring a whole lot more.  This module is not a completly new
    design but is just part of a larger library I've been working on.

    The next two release should support the rest of the ESIS
    information that is available and include iterator classes to help
    walk around the grove.

    Releases after that will be merged back into the library and will
    include transformation, formatting, and other utility classes.


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

Date: Sun, 05 Oct 1997 11:51:07 -0600
From: Don Hamrick <hamrick@alltel.net>
Subject: WHERE TO GET & HOW TO INSTALL PERL5
Message-Id: <3437C57A.37697C65@alltel.net>

http://www.metronet.com/perlinfo/perl5.html
perl5.001 is Released!
Pick up the Latest Stable perl5 source, perl5-latest.tar.gz
Or, get the Latest source, in this directory
=================================================

If perl5-latest.tar.gz above is not the stand alone perl5.exe I am
looking for to run on my Win95 computer then where can I find it? And,
how will I install it?

Thanks.

Don




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

Date: Sun, 05 Oct 1997 20:21:54 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: WHERE TO GET & HOW TO INSTALL PERL5
Message-Id: <3437f69b.610601398@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Sun, 05 Oct 1997 11:51:07 -0600, Don Hamrick <hamrick@alltel.net>
wrote:

>http://www.metronet.com/perlinfo/perl5.html
>perl5.001 is Released!
>Pick up the Latest Stable perl5 source, perl5-latest.tar.gz
>Or, get the Latest source, in this directory
>=================================================
>
>If perl5-latest.tar.gz above is not the stand alone perl5.exe I am
>looking for to run on my Win95 computer then where can I find it? And,
>how will I install it?

Please post this type of message to the appropriate newsgroup.
comp.lang.perl.misc is the *only* one you needed to send it to.
Furthermore, comp.lang.perl doesn't exist anymore.

To get Perl for Win32, visit http://www.activestate.com/

Jeremy
-- 
Jeremy D. Zawodny
WCNet Technical Geek & Web Stuff
<URL:http://www.wcnet.org/~jzawodn/>

"That's an example of how Perl can bring school yard cruelty to new heights."
    -- Jon Orwant at the 1st Annual Perl Conference


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

Date: Sun, 5 Oct 1997 16:05:15 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Why don't 'require' variables count towards "used only once"?
Message-Id: <EHL60r.54J@world.std.com>

felix@crowfix.com (Felix Morley Finch) writes:

>Name "main::xyzzy1" used only once: possible typo at ./xyzzy.pl line 3.

>I understood that I've only "used" it once; on the other hand, I've
>only "used" $xyzzy2 not at all.

Its a side effect of the way perl is parsed/compiled/interpreted/whatever.

The  perl interpreter  parses your  perl  script ("compile time") , at
which point "require" is only  notification of something that is going
to happen later   (at "run time")  once  the compilation finishes,  it
emits the "only used  once" warnings. Then it  starts to run, and when
it hits  the  "require" statement,  finds  what   it is  supposed   to
"require", fires up the perl interpreter again,  and compiles and runs
the require'd stuff.

As an extreme example, how would perl know about the variables in this
case:

$required_file = 'xyzzy-lib.pl';
require $required_file;

Luckily, there is a wordaround, there is a special pragma "vars", that
tells the perl interpreter about variables, so that they aren't
considered a "possibly typo".

use vars qw($xyzzy1 $xyzzy2);


-- 
Andrew Langmead


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1129
**************************************

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