[7775] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1400 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 2 03:37:30 1997

Date: Tue, 2 Dec 97 00:00:38 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 2 Dec 1997     Volume: 8 Number: 1400

Today's topics:
     Access restriction and User names <clanger@csd.sgi.com>
     Alarm not working <efinch@vais.net>
     Re: dumb(?) question about arrays ... <westxga@ptsc.slg.eds.com>
     Re: dumb(?) question about arrays ... <rjk@coos.dartmouth.edu>
     Re: dumb(?) question about arrays ... <wtansill@erols.com>
     eliminating part of file (Steve)
     Re: Finding the longest common prefix over a list of st (Abigail)
     Re: How to download files using Perl? (brian d foy)
     Re: How To Test if number is ODD or EVEN? (Ken Fox)
     Re: Looking for better development envirement for PERL <wtansill@erols.com>
     Re: Modules for try/catch? (Charles DeRykus)
     Need to know how to somehow limit file sizes in file up <jonesb@wam.umd.edu>
     Re: open and whitespace <rjk@coos.dartmouth.edu>
     Re: perl-cgi frames (brian d foy)
     Re: PerlShop "invalid transmission" (Jeremy D. Zawodny)
     Re: PerlShop "invalid transmission" <witsend@ix.netcom.com>
     perlxstut(1) man page lamontg@bite.me.spammers
     Re: read from end of file (by line) (Ton Hospel)
     Re: Seems to be just another  5.004_* bug:-( (Abigail)
     Re: strange thing (Jeremy D. Zawodny)
     Re: Win32::internet (Jeremy D. Zawodny)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 01 Dec 1997 19:24:51 -0800
From: Christina Langer <clanger@csd.sgi.com>
Subject: Access restriction and User names
Message-Id: <34837F83.167E@csd.sgi.com>

Hi Guys !

Not sure if this is even the right group to post it to. 

I have the following problem:

I have a webpage which is access restricted to certain users with
passwords. They fill out a survey, then submit the form. Per cgi and
perl the data get written to a file. To prevent that a user submits the
form multiple times I want to capture the Username with which he logged
in to the page.  

I tried it with 
$ruser = $ENV{'REMOTE_USER'};

and later in the code
print TXTFILE "Name: $ruser\n";

but that gives me a blank field. Am I on the right track or what is the
correct way to do this ?

Christina


P.S: please send email to clanger@csd.sgi.com
-- 
__________________________________________________________________

Christina Langer                        clanger@csd.sgi.com
Technical Support Engineer              1-800-800-4744
Silicon Graphics Inc.
__________________________________________________________________


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

Date: Tue, 02 Dec 1997 00:38:41 -0500
From: Ed Finch <efinch@vais.net>
To: efinch@eos.hitc.com
Subject: Alarm not working
Message-Id: <34839EE1.BC0DA1E5@vais.net>

There is a loop around this code that processes directories on multiple
servers. This code is supposed to verify that each server is up and the
directory is accessible before trying to process it, in order to avoid
hangs:

print "$home_dir\n";
   # Make sure the host is alive
   $SIG{'ALRM'} = sub { print "died\n"; die } ;
   alarm(5);
   $ret = 0;
   eval <<'EOM' ;
#  system("cd $home_dir");
#  stat($home_dir);
#  -d $home_dir;
   $ret = 1;
EOM
   alarm(0);
   if ($ret == 0) {
      print "$host is unreachable\n";
      next;
   }

Of the 3 commented-out lines, only the "system..." one works. The other
2 are not terminated by the alarm.

Why don't they work?
Is there a better way to do this? I'm processing >1000 directories, and
the system() calls are slow.

Thanks!
Ed



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

Date: Mon, 01 Dec 1997 16:28:58 +0000
From: Glenn West <westxga@ptsc.slg.eds.com>
Subject: Re: dumb(?) question about arrays ...
Message-Id: <3482E5CA.77D6@ptsc.slg.eds.com>

DBlom wrote:
> 
> Hi,
> I am trying to write a Perl script to fix area codes in a Maximizer
> database export file &  have been banging my head against what is probably
> a very simple problem.  Each line in the file consists of quote-enclosed,
> comma-delimited fields - in other words it looks just like an array (to me,
> anyway).  I have been trying to read each line & convert it to an array
> with something like
>         @line = $_;
> but when I try to reference @line[25] I get nothing, even though there is
> information in the 25th field.

$line[25] is the 26th field as $line[0] is the first...

>  Is there some kind of type conversion that
> I have to do??  Any help would be greatly appreciated.
> 
> Thanks
> 
> David Blom


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

Date: Mon, 01 Dec 1997 22:28:51 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: dumb(?) question about arrays ...
Message-Id: <34838072.89ABE8F7@coos.dartmouth.edu>

DBlom wrote:
> 
> Hi,
> I am trying to write a Perl script to fix area codes in a Maximizer
> database export file &  have been banging my head against what is probably
> a very simple problem.  Each line in the file consists of quote-enclosed,
> comma-delimited fields - in other words it looks just like an array (to me,
> anyway).  I have been trying to read each line & convert it to an array
> with something like
>         @line = $_;
> but when I try to reference @line[25] I get nothing, even though there is
> information in the 25th field.  Is there some kind of type conversion that
> I have to do??  Any help would be greatly appreciated.

While it may look like an array to you, to Perl it's just lines of text it's
reading from a file.

What you doing is assigning to @line the string $_, which means @line looks
like this:
('whatever is in $_')
As you can see, @line only has one element.

I believe the Text::ParseWords module, available on CPAN, would be very
useful.  It should let you split the line into the separate pieces (based on
the quotes and commas), and then assign all the pieces to an array.

Chipmunk


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

Date: Mon, 01 Dec 1997 23:41:14 -0500
From: "William B. Tansill, III" <wtansill@erols.com>
Subject: Re: dumb(?) question about arrays ...
Message-Id: <3483916A.9F9@erols.com>

DBlom wrote:
> 
> Hi,
> I am trying to write a Perl script to fix area codes in a Maximizer
> database export file &  have been banging my head against what is probably
> a very simple problem.  Each line in the file consists of quote-enclosed,
> comma-delimited fields - in other words it looks just like an array (to me,
> anyway).  I have been trying to read each line & convert it to an array
> with something like
>         @line = $_;
> but when I try to reference @line[25] I get nothing, even though there is
> information in the 25th field.  Is there some kind of type conversion that
> I have to do??  Any help would be greatly appreciated.
> 
> Thanks
> 
> David Blom

A couple of things:

1) Instead of using the sntax: @line = $_ use this:
   @line = split ",";
2) Be aware that PERL arrays are 0-based.  An array having 25
elements    would have indices in the range of 0..24.
3) The "@" prefix is only used when referring to an array as a
whole.     In order to extract the scalar data contined in a single
array    element, use the "$" prefix. Ex: $line[24].
4) Remember to remove the trailing "\n" when you read each line. 
-- 

How do I set my laser printer to "stun"?


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

Date: Tue, 02 Dec 1997 03:23:49 GMT
From: syarbrou@ais.net (Steve)
Subject: eliminating part of file
Message-Id: <34836077.34362431@news.ais.net>

I have a file that is read in using a perl script.  It then places the
contents of a file back out to another file.  I want everything
outputted to the new file, except for the <jdie> and </jdie> tags, and
everything between them.  How do you go about that?  Thanks.

Steve


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

Date: 2 Dec 1997 04:18:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Finding the longest common prefix over a list of strings (summary)
Message-Id: <slrn68734p.175.abigail@betelgeuse.wayne.fnx.com>

Ken Fox (fox@pt0204.pto.ford.com) wrote on 1554 September 1993 in
<URL: news:65vo3f$g4i1@eccws1.dearborn.ford.com>:
++ 
++ abigail@fnx.com (Abigail) writes:
++ > Ken Fox (fox@pt0204.pto.ford.com) wrote:
++ > ++ I was taught that big-T is simply used to denote theoretical actual
++ > ++ run time, i.e. the sum of all operations an algorithm performs.
++ > 
++ > Well, you are displaying T here as a function working on functions
++ > (and if it would be similar as big-O, it would return an equivalence
++ >  class of functions). I guess you meant T (N) = O (k*N + f).
++ 
++ I see what you're saying, but that's not what I meant.  T is time, not an
++ equivalence function, so I guess the notation should really just be
++ T = k*N+f.  What notation is used to compare algorithms with the same big-O?

That is extremely hard. Then you need to take the actual constants into
account, and they can depend on a large range of variables, including
processor type and the compiler used to compile perl. It wouldn't be
unpossible to have 2 algorithms A1, A2 with the same upperbound, where A1
is faster for any input than A2 on one machine, but on an other machine,
A2 beats A1. What if one algorithm has actual run time 10 * int (n/2),
the other 5 * n - 2? Which one is "better"? What if the run time isn't
continuous? Not to mention the actual runtime is highly dependent on
the input. For a specific input, sometimes the one, sometimes the other
will be faster. Quicksort and bubblesort have the same worst case
complexity. Quicksort has a way better expected runtime; but on a
sorted array, bubblesort can outperform quicksort. Which one is better?
How do you express T if the expected run time is O (n log n), but
the worst case run time is quadractic?

How you express the running time T of the following algorithm:

@array = ( .... );  # Some set of values.
foreach (@array) {last if $_ eq 7; $_ ++;}

Certainly not as T = c * N + d, as the actual running time highly depends
on the distribution of 7's over the input.

Now, you might be give an upperbound, T <= c * N + d, and find appropriate
c and d. But how do you compare T1 and T2, where T1 <= c1 * N + d1,
T2 <= c2 * N + d2? Is T1 better than T2 iff c1 <= c2? Maybe, but what
if we compare the above algorithm with:

@array = ( .... );  # As above.
foreach (@array) {last unless $_ == 713812345124; "aaaab" =~ /^((((a+)*)*)*)c/;}

Clearly T2 <= c2 * N + d2, and c1 <= c2. But which will run better
in practise?

++ Certainly O(2*N) should be worse than O(N), but big-O doesn't mean that.

Writing O (2*N) is a sign of not understanding big-O. ;)

The nice thing about a tight big-O complexity is that it will show
you how well an algorithm scales. Even if the regex algorithm was
ten times faster, the quadratic dependency would still make it to
perform worse than the other algoritms for larger inputs.

++ Here's some more raw data.  It's interesting to see how different
++ algorithms perform so inconsistently on different input -- and this
++ is a trivial problem too!  All these tests were run 20_000 times.

Interesting results, but for completeness, you should also include
cases were all the words are relatively large.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Mon, 01 Dec 1997 20:11:17 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to download files using Perl?
Message-Id: <comdog-ya02408000R0112972011170001@news.panix.com>

In article <34835B94.D56B5257@internetdevices.com>, Gangadhar Vaddepalli <ganga@internetdevices.com> wrote:

>How to download a .tar file using Perl?
>I tried with the following CGI code, but no use.
>-------------------
>#!/usr/local/bin/perl
>
>print "Content type: application/x-tar\n\n";

print "Content-type: application/x-tar\n\n";

btw, cgi questions should go to whatever newsgroup does that sort of 
thing :)

-- 
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: 2 Dec 1997 02:29:53 GMT
From: fox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: How To Test if number is ODD or EVEN?
Message-Id: <65vrr1$g4i2@eccws1.dearborn.ford.com>

branderr@cuug.ab.ca (Roy Brander) writes:
> Ken Fox (fox@pt0204.pto.ford.com) wrote:
> : jay@dixonssurgical.co.uk (Jay Dixon) writes:
> : > I want to test if a variable is Odd (or Even)
> : 
> : As inspired by abigail:
> : 
> : perl -wle 'print "Even" if (1 x shift) =~ /^(1+?)\1$/'
> : 
> 
> It's now official.  I will never be a perl guru.  I've been
> staring at that one for a minute and still can't figure it.

Hmm, if I interpret the geek code properly, P+++++ would be a guru
and that's reserved for Larry, Tom, and Randall.  True gurus need no
last name. ;)  Am I mistaken?  Can mere mortals achieve guru
status?  I've always thought "CAST AND CREW" was the highest plane
achievable in this world. :)

I just noticed that the only geek category to actually use the word
guru is for Macintosh losers.  And it only takes ++ to get to guru
status.  How sad.

> Mine was the too-obvious ' print "even" if ($var%2==0) '.
> Obviously, my early FORTRAN years have permanently damaged
> my brain for more elegant solutions.

I personally use the ($var&1) solution; most programmers arriving at perl
from C probably do. [1]  I'd expect Fortran programmers to use your
technique. [2]  About the only programmer I'd expect to use the regex is
a Prolog programmer who thinks arithmetic is implemented using the sucessor
function. ;) [3]

As far as elegant solutions go, if you think (1 x shift) =~ /^(1+?)\1$/
is elegant, I'd say Fortran really has damaged your brain.  Do you
instinctively wrap your Perl programs before you hit column 73?  Pine for
the good ole' three-way branch?  Name all your variables with six letters?

If so, you've found a good home 'cause Perl likes everybody. :)

- Ken

[1] C programmers don't care that it's broken on negative numbers -- it'll
    be fast and mostly right.

[2] Fortran programmers don't care if it's slow on lots of machines -- real
    programs run on Crays.

[3] Prolog programmers don't care if it takes O(N) to compute the result
    or even if it's broken on zero and negative numbers -- hey, we can
    *reason* over this baby.

P.S. Don't flame me about this.  I openly admit to writing production
     software in all of these!  Sometimes we just gotta laugh at
     ourselves...

-- 
Ken Fox (kfox@ford.com)                  | My opinions or statements do
                                         | not represent those of, nor are
Ford Motor Company, Powertrain           | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section             | "Is this some sort of trick
                                         |  question or what?" -- Calvin


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

Date: Mon, 01 Dec 1997 23:53:09 -0500
From: "William B. Tansill, III" <wtansill@erols.com>
Subject: Re: Looking for better development envirement for PERL
Message-Id: <34839435.20E8@erols.com>

Edris Abzakh wrote:
> 
> Hello ..
> 
> I was wondering if any body knows about a better developing envirement
> for Perl than using Emacs and the primitive debugger of Perl .
> If there is any thing close to the modern envirements then please
> let me know about it . I'm willing to pay for it .
> please contact me at : edris@canaan.co.il
> 
> P.S : I'm working under unix operating system but moving to PC is still
>       an opened option .
> 
> Thanks
> 
> Edris
Try this:

http://www.lancs.ac.uk/people/cpaap/pfe/

This is the home page for Programmers File Editor, a very nice
Windows-based text editor that has (for the most part) supplanted my use
of BRIEF.  On top of being a good editor, the price is right (it's
free).

Afer creating the PERL script, use either the DOS or Windows version of
PERL (available from CPAN, also free) to execute/debug (nope, the
debugger's no better) on your local PC.  After debugging, FTP to your
UNIX platform for final testing.

I find that I can take care of most of my PERL programming requirements
this way.  Admittedly I'm not a "UNIX Wizard", and there are some things
that don't work under Win '95 (flock() has been discussed much of late),
but this setup is adequate for the vast majority of the work that I do.
-- 

How do I set my laser printer to "stun"?


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

Date: Tue, 2 Dec 1997 03:02:02 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Modules for try/catch?
Message-Id: <EKJKFF.3Ap@bcstec.ca.boeing.com>

In article <65vmd6$avk@netline.jpl.nasa.gov>,
Peter Scott <psa@euclid.jpl.nasa.gov> wrote:
 > Hi.  I seem to remember reading somewhere recently (CPAN? TPJ? I forget)
 > about a module which implemented try { } catch { } blocks for Perl.
 > I've found Tom's exceptions.pl, but it doesn't look like what I thought
 > I saw.  I've searched all over CPAN for something else.  I can make
 > exceptions.pl work for me but before I go down that road would like to
 > know about other possibilities that are out there.  
 > 
 > (I plan on doing something as close as possible to the Java model of 
 > creating new classes of exception, etc, to see how well it works.)
 > 

There's a try/catch thingy using function prototypes on pg. 120 
of the Blue Camel. You may need to try reading several times in 
order to catch on though :)   

Regards,
--
Charles DeRykus


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

Date: Tue, 02 Dec 1997 00:59:01 -0500
From: Bryan Jones <jonesb@wam.umd.edu>
Subject: Need to know how to somehow limit file sizes in file uploads with Perl
Message-Id: <3483A3A5.C0E2AC5B@wam.umd.edu>

Please someone help!

I'm trying to put together a perl script which will allow me to upload
files to a Msql database.  I need to know how I might be able to limit
the size of the files which are being uploaded to the server.  I
understand that it might probably take uploading it first then looking
at the file size.  BUT HOW DO YOU DO THIS IN PERL?

Any response would be greatly appreciated!
Thanks!

Bryan Jones
----------------------------------------------------
jonesb@wam.umd.edu




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

Date: Mon, 01 Dec 1997 22:10:57 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: open and whitespace
Message-Id: <34837C40.1C04337A@coos.dartmouth.edu>

Niall O Broin wrote:
> 
> I need to process files generated by Macintosh users who quite often use
> filenames with leading spaces (deliberately because space sorts to the
> top of a Finder file list) and trailing spaces (probably accidentally).
> I was trapping for this as suggested in the Camel and it was working,
> but I've now encountered other problems where code I didn't write opens
> these files. I don't really want to have to modify the filenames
> everywhere I might need to.
> 

Is the other code called from your code, or is it a separate script?

Perhaps you could do:

$filename = "\Q$filename\E";

Chipmunk


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

Date: Mon, 01 Dec 1997 20:09:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl-cgi frames
Message-Id: <comdog-ya02408000R0112972009410001@news.panix.com>

In article <3483435e.10308582@news.columbia.edu>, ss492@columbia.edu (Sameer Shroff) wrote:

>I need help using frames in cgi-perl. 

>If it is possible I would like a response in english.

it's in plain english in the Frames documentation listed in the CGI
Meta FAQ. :>

-- 
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: Tue, 02 Dec 1997 04:15:16 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: PerlShop "invalid transmission"
Message-Id: <348589c1.209504801@woody.wcnet.org>

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

On Mon, 01 Dec 1997 16:02:45 -0500, daveSTOP*SPAMreed@webshowplace.com
(Dave Reed) wrote:

>I'm trying for the first time to install and use PerlShop.cgi in a virtual
>hosting situation where the script is located at
>
>www.mydomain.com/cgi-bin/TheStore/PerlShop.cgi  

I'm not sure how many people on this group have *any* idea what
PerlShop.cgi is. I've done a fair amount of CGI hacking in Perl, and
I've never run across it.

So, I'm forced to make some assumptions.

(1) You've read the docs and they didn't help.
(2) You contacted the script's author/maintainer and that didn't help.
(3) You've read the CGI FAQs and they didn't help.
(4) You've searched the web and usenet for references to
"PerlShop.cgi" to see if anyone else has published material related to
it, and that hasn't helped.
(5) You have nowhere else to turn.

If the above are *not* true, I suggest you consider those options as
well.

I spent the 30 seconds worth of effort needed to search AltaVista and
found: http://elaine.teleport.com/support/webweave/cgi/perlshop.html

The documentation appears to be semi-complete, and there is
information about contacting the author. Have you?

>but  when referred to with a web browser the format must be (according to
>my virtual host)  
>
>www.mydomain.com/cgi-bin/vr?TheStore/PerlShop.cgi
>
>When I use Netscape 4.03 and try to enter the store from the entry page
>with a form posting to  
>
>www.mydomain.com/cgi-bin/vr?TheStore/PerlShop.cgi
>
>PerlShop.cgi executes but gives me "transmission error #1" or #3.
>
>The relevant code in the script appears to be:
>
>if (lc $use_cookies eq 'yes')
>   {
>   &create_cookie('orderid', $unique_id, $cookie_expire_days);
>   print "\n";    }
>   }
>   else
>         {&Transmission_error(1);}
>}
>
>generating transmission error #1 most of the time, regardless of whether I
>have the $use_cookies option set for 'yes' or 'no',  and then occasionally
>
>if (($unique_id eq '!ORDERID!') || ( $unique_id !~ /\d{$id_length}?/ ))
>      {&Transmission_error(3);}
>
>generating transmission error #3.
>
>The problem seems to be related to creating the unique ID.
>
>Any ideas what is causing the transmission error messages?

You don't seem to have posted enough code to make the problem easily
solvable. I have no idea what it in most of those variables or what is
supposed to be.

Have you tried sticking in some debugging code to see what is
happening?

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 01 Dec 1997 22:42:03 -0800
From: Dave Godwin <witsend@ix.netcom.com>
To: Dave Reed <daveSTOP*SPAMreed@webshowplace.com>
Subject: Re: PerlShop "invalid transmission"
Message-Id: <3483ADBA.601D@ix.netcom.com>

Sparky,

	You chopped out the wrong chunk of Perl code.  Transmission
error #1 simply means that you did not call the script correctly in
the first place.  My best guess is that the !ORDER_ID! field in
the calling form is not put together correctly.

	Drop me a direct note telling me the URL of your stuff so
I can take a quick look at it.

Dave Godwin
Co-owner and Tech Guy
Snapdragon Gifts
http://www.snapdragongifts.com

Dave Reed wrote:
> 
> I'm trying for the first time to install and use PerlShop.cgi in a virtual
> hosting situation where the script is located at
> 
> www.mydomain.com/cgi-bin/TheStore/PerlShop.cgi
> 
> but  when referred to with a web browser the format must be (according to
> my virtual host)
> 
> www.mydomain.com/cgi-bin/vr?TheStore/PerlShop.cgi
> 
> When I use Netscape 4.03 and try to enter the store from the entry page
> with a form posting to
> 
> www.mydomain.com/cgi-bin/vr?TheStore/PerlShop.cgi
> 
> PerlShop.cgi executes but gives me "transmission error #1" or #3.
> 
> The relevant code in the script appears to be:
> 
> if (lc $use_cookies eq 'yes')
>    {
>    &create_cookie('orderid', $unique_id, $cookie_expire_days);
>    print "\n";    }
>    }
>    else
>          {&Transmission_error(1);}
> }
> 
> generating transmission error #1 most of the time, regardless of whether I
> have the $use_cookies option set for 'yes' or 'no',  and then occasionally
> 
> if (($unique_id eq '!ORDERID!') || ( $unique_id !~ /\d{$id_length}?/ ))
>       {&Transmission_error(3);}
> 
> generating transmission error #3.
> 
> The problem seems to be related to creating the unique ID.
> 
> Any ideas what is causing the transmission error messages?
> 
> Thanks.
> 
> -Dave Reed . . . . . . . . . . . . . davereed@webshowplace.com
> 
> WEBSHOWPLACE, Box 819, Assonet, MA 02702 . . . ph 508-763-8050
> 
> Award-winning Website Design . . Online Shopping Cart Commerce
> 
> http://www.webshowplace.com


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

Date: 2 Dec 1997 05:28:42 GMT
From: lamontg@bite.me.spammers
Subject: perlxstut(1) man page
Message-Id: <6606aa$1eci$1@nntp6.u.washington.edu>

Going through the perlxstut(1) man page I noticed what might be some
problems.  The first thing is that shouldn't the typemap file be included
in the MANIFEST to make things nice+neat?  That's not a big deal, though.

The second thing is that when doing 'perl Makefile.PL' I get the following
output:

  MakeMaker (v5.42)
  Warning (non-fatal): Target 'dynamic' depends on targets in skipped section 'dynamic_lib'
  Warning (non-fatal): Target 'static' depends on targets in skipped section 'static_lib'
  Writing Makefile for Mytest2::mylib
  Writing Makefile for Mytest2

Okay, so it's non-fatal, still there's no mention of this in the man pages.

And finally a 'make test' produces:

  PERL_DL_NONLAZY=1 /usr/local/bin/perl -I./blib/arch -I./blib/lib -I/usr/local/lib/perl5/alpha-dec_osf/5.00404 -I/usr/local/lib/perl5 test.pl
  1..4
  ok 1
  ok 2
  ok 3
  ok 4
  Make: Don't know how to make pure_all.  Stop.
  *** Exit 1
  Stop.

Which is somewhat more problematic.  I am running:

> perl -v

This is perl, version 5.004_04 built for alpha-dec_osf
[...]
> uname -a
OSF1 lager V4.0 564 alpha

shar archives of exactly what I did to get these errors are available 
upon request...

-- 
Lamont Granquist (lamontg at u dot washington dot edu)
ICBM: 47 39'23"N 122 18'19"W
"It all comes from here, the stench and the peril."--Frodo (from Perl5/toke.c)


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

Date: 2 Dec 1997 03:35:01 GMT
From: thospel@mail.dma.be (Ton Hospel)
Subject: Re: read from end of file (by line)
Message-Id: <65vvl5$jjg$1@news2.xs4all.nl>

Ok, so here is an attempt to do it using seek and tell.
My first posting in this group, so I hope I didn't miss anything obvious :-)


#! /usr/bin/perl -w

# Reverse a file line by line with reasonable efficiency and memory usage
# Author: Ton Hospel (thospel@mail.dma.be)
# GNU copyleft or Perl Artistic, your choice

use strict;
use integer;
use Carp;

# We don't want to jump around in the file too much. So set some measure 
# of how big the file chunks we handle in one go are
$::chunk = 1024;

for (@ARGV) {
    reverse_file($_);
}

sub reverse_file {
    my ($file) = @_;
    my ($high, $step, $here, @lines);
    local(*FILE);

    open(FILE, $file) || croak "Could not open $file: $!";
    eval {
        $here = (stat(FILE))[7];
        $step = $::chunk;

        while ($high = $here) {
            do {
                $here -= $step;
                $step *= 2;
                $here = 0 if $here < 0;
                seek(FILE, $here, 0) || croak "Somebody is truncating $file";
                goto edge unless $here;	# I want last on a do loop !
                defined(<FILE>)	     || croak "Somebody is truncating $file";
                $here = tell(FILE);
            } until ($here < $high);
          edge:

            @lines = ();
            do {
                defined($_ = <FILE>) || croak "Somebody is truncating $file";
                push(@lines, $_);
            } while (tell(FILE) < $high);
            print reverse @lines;

            $step = (2*$::chunk+$step)/4;
        }
    };
    close FILE;
    die $@ if $@;
}


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

Date: 2 Dec 1997 05:47:18 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Seems to be just another  5.004_* bug:-(
Message-Id: <slrn6878al.175.abigail@betelgeuse.wayne.fnx.com>

Vladimir Sovetov (sova@kpbank.ru) wrote on 1554 September 1993 in
<URL: news:199712020221.JAA08673@arf.hq.kem>:
++ > 
++ 
++   The correct approach seems to be.
++ 
++      undef $/;
++        $_=<>;
++          s/<(?:[^>'"]+|(['"]).+?\1)*>//gs;

Just put a <!-- ' --> on the top and bottom of you document,
and see what happens....



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Tue, 02 Dec 1997 04:07:51 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: strange thing
Message-Id: <34848910.209327466@woody.wcnet.org>

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

On 1 Dec 1997 20:48:46 GMT, woltetch@aol.com (WOLtetch) wrote:

>I have encountered satatements like this:
>$variable if /pattern/
>
>could someone explain how this works? Do only the matches end up in &variable?

Taken out of context like that, it's hard to imagine why one would do
that. But my lack of imagination probably has little bearing on the
original programmer's intent.

I would have expected a change to the variable or some other action
based on the pattern match.

Maybe: $var++ if /^increment$/oi;

Who knows...

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Tue, 02 Dec 1997 04:03:05 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Win32::internet
Message-Id: <34838830.209103484@woody.wcnet.org>

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

On Mon, 1 Dec 1997 21:57:38 GMT, Eric Bohlman <ebohlman@netcom.com>
wrote:

>Mark E. Owen <meo@enterprise.net> wrote:
>
>: Is there any web pages about that has some useful examples on how to
>: use the Win32::internet (internet.pm) module?
>
>: I'm specifically looking to be able to download various GIF/JPEG files
>: from web sites (eg. http://host/foo.jpg)
>
>Actually, your best bet would be to use the LWP::Simple module for this, 
>as it will make it absolutely trivial:
>
>use LWP::Simple;
>my $url='http://host/foo.jpg';
>my $fname='bar.jpg';
>getstore($url,$fname);

And that likely entails an upgrade from the ActiveState Perl to the
native 5.004 Win32 port.

One *can* make LWP work under ActiveState's build, but it's much less
hassle to just get the native port. It's "built in" that way.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

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

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