[8555] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2172 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 24 13:17:55 1998

Date: Tue, 24 Mar 98 10:00:37 -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, 24 Mar 1998     Volume: 8 Number: 2172

Today's topics:
    Re: "Newbie" Crib Notes (Steve Linberg)
    Re: babelfish.altavista web client (enjoy) <jdf@pobox.com>
    Re: babelfish.altavista web client (enjoy) (Mike Heins)
    Re: Can PERL run in the background? (Tor Iver Wilhelmsen)
        Database vs. Flat-File Queue System <steve@prilnari.com>
    Re: debugging Perl (Andrew M. Langmead)
    Re: Fell at the last hurdle :( (Richard Bellavance)
    Re: Form Input (Andrew M. Langmead)
        GD.pm <d080048@ec.hokudai.ac.jp>
        Getting the elements in a form using Perl for ASP under <Mark_Stamps@scee.sony.co.uk>
    Re: Getting the elements in a form using Perl for ASP u <joneil@cks.ssd.k12.wa.us>
    Re: Getting the elements in a form using Perl for ASP u <Mark_Stamps@scee.sony.co.uk>
    Re: Going Rates for PERL Programming??? (Richard Bellavance)
    Re: Going Rates for PERL Programming??? <merlyn@stonehenge.com>
        How to attach files with Sendmail. jglopez@javercol.javeriana.edu.co
    Re: How to take the icecream from the trashbox? <ewinter@pop3.stx.com>
    Re: How to use the POST at Common.pm with a hash as arg <aas@sn.no>
    Re: mirror (LWP::Simple) is acting like getstore!!!! <aas@sn.no>
    Re: Novice RegExpr problem -- how to slurp down big chu (stephen benson)
        Perl module for (X)Fig files <rafael@dunite.icp.inpg.fr>
    Re: Perl on Win95 - CMD32 - File Length Restriction ? (Richard Bellavance)
        Strange behavior with NET:Ftp under Cron <abennett@stonehill.edu>
    Re: The use of Perl extensions (Stuart McDow)
    Re: trouble with \r (Stuart McDow)
    Re: udp (Andrew M. Langmead)
    Re: Wanted: Perl for Windows 3.x (Brian Sawert)
    Re: What's up with the debugger? (Mark Schmick)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 24 Mar 1998 10:18:01 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: "Newbie" Crib Notes
Message-Id: <linberg-2403981018010001@projdirc.literacy.upenn.edu>

In article <35174017.6A16BB8B@coos.dartmouth.edu>, rjk@coos.dartmouth.edu wrote:

> Steve Linberg wrote:
> > 
> > Abigail was pissed off for two entirely valid reasons:  (1) Referring
> > newbies to incomplete, poorly-thought-out solutions instead of the
> > easy-to-find and painstakingly developed FAQ, and (2) illegal and
> > unethical appropriation of her work.  I would be livid too.  Just because
> > you're a newbie doesn't mean you can ignore common sense and common
> > courtesy, to say nothing of copyright law.
> 
> But to (1), Abigail seemed to completely miss the fact that Mark himself is a
> newbie (self-proclaimed).  He was attempting to do a very good thing by
> creating a resource for himself and other newbies containing useful answers to
> questions.  If the text he was collecting contained incomplete,
> poorly-thought-out solutions, that is the fault of the posters.  As I said,
> Mark is a newbie - he may not be the best judge of a solution's correctness,
> but he found those answers useful.
> 
> > If you would get off your horse and read her innumerable posts to this
> > group, you would realize that Abigail knows more about Perl and
> > programming than 99% of the people here combined.
> > I've got a binder full of her posts.
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Which is exactly what Mark was trying to do.  A little hypocritical of you to
> condemn him for doing something you do, don't you think?  He just needs to
> include attributions, and determine which answers are worth saving and
which aren't.

Your last sentence is correct; your second I disagree with.  I collect
posts from many people (including you, Chipmunk), but it's for my own
study and edification.  I would never dream of posting any of it unless
(a) I was sure I *completely* understood it and I (b1) had permission from
the author or (b2) could express it completely in my own words, like
explaining something from the Camel.  That's the difference.  It's huge,
to me at least.

Passing off incomplete answers that you don't fully understand is
dangerous, don't you think?  And the material I keep from this group is
not FAQ-related, but stuff that goes beyond it or into areas that I don't
entirely understand (like the recent discussion on signals, for example),
or Abigail's recent math stuff that makes my head spin, but which I'm
determined to try to understand.  I would never (at this poing) try to
explain signals to anyone, or compile a makeshift newbie FAQ about it.  I
don't understand it well enough.  I know that.

> > You could learn a lot from her if you didn't have that
> > two-by-four on your shoulder.
> 
> Someone upset at being unfairly flamed has a chip on his shoulder?  Nonsense. 
> Abigail went too far, and Mark was rightfully offended.

It wasn't Mark who wrote what I responded to.  That was someone else. 
Mark apologized.  And although I think he probably meant well, I think he
absolutely deserved to be flamed.  I can't imagine that you wouldn't be
pissed off under the same circumstances.  I sure would.
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: 24 Mar 1998 10:21:32 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: babelfish.altavista web client (enjoy)
Message-Id: <ogywktc3.fsf@news.concentric.net>

opus@magibox.net (Brock Sides) writes:

> It takes the output of /usr/games/fortune (substitute something
> appropriate on your own machine), feeds it to
> babelfish.altavista.digital.com, then feeds the output back into the
> babelfish. You can run it through the babelfish as many times as you
> like with command line options: -f => French, -g => German, -p =>
> Portuguese, -s => Spanish, -i => Italian.

I've had a web page up for a couple of months that does a similar
thing.  You'll find it at

   http://www5.awa.com/~jonathan/nph-babel.cgi

Wishing you further s&g,
-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 24 Mar 98 16:30:54 GMT
From: mikeh@minivend.com (Mike Heins)
Subject: Re: babelfish.altavista web client (enjoy)
Message-Id: <3517dfbe.0@news.one.net>

Jonathan Feinberg <jdf@pobox.com> wrote:
> opus@magibox.net (Brock Sides) writes:

>> It takes the output of /usr/games/fortune (substitute something
>> appropriate on your own machine), feeds it to
>> babelfish.altavista.digital.com, then feeds the output back into the
>> babelfish. You can run it through the babelfish as many times as you
>> like with command line options: -f => French, -g => German, -p =>
>> Portuguese, -s => Spanish, -i => Italian.

> I've had a web page up for a couple of months that does a similar
> thing.  You'll find it at

>    http://www5.awa.com/~jonathan/nph-babel.cgi

Did you diddle the UserAgent or something in LWP? I get the
response "must be submitted by form" or the like.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Just because something is           131 Willow Lane, Floor 2  | ||  _ \
obviously happening doesn't         Oxford, OH  45056         | || |_) |
mean something obvious is           <mikeh@minivend.com>     |___|  _ <
happening. --Larry Wall             513.523.7621 FAX 7501        |_| \_\


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

Date: Tue, 24 Mar 1998 17:14:23 GMT
From: toriw@online.no (Tor Iver Wilhelmsen)
Subject: Re: Can PERL run in the background?
Message-Id: <3521dfca.31236539@news.eunet.no>

On Fri, 20 Mar 1998 13:23:01 -0800, "Charles Jaimet"
<webmaster@netminder.com> uttered:

>Does anyone know if it's possible to call a PERL script through CGI from a
>Web page form and not have to return a new page or reload the current one? 

Ever try reading the CGI FAQ, which has the answer?
<URL:http://www.htmlhelp.com/faq/cgifaq.html>, question 4-14.

-- 
"Between our dreams and actions lies this world."
   - Bruce Springsteen, "Dead Man Walking"
Tor Iver Wilhelmsen       toriw@online.no


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

Date: Tue, 24 Mar 1998 16:35:17 GMT
From: Steve Wells <steve@prilnari.com>
Subject: Database vs. Flat-File Queue System
Message-Id: <3517E23C.A02575CB@prilnari.com>

Without expressing where my own viewpoint leads me I would like to get
opinions from the PERL gurus as to what they would deem appropriate.

I'm designing a queue system that has over 100,000 lines in it.  The
system will run on UNIX machines and the data to perform the
processing is retrieved from an SQL database.  Now we need a queuing
system that is to be used to do the processing on separate machines.  

Do we build a separate table in the database and read and remove lines
from the database or do we use a flat file and read and remove lines
from a flat file.

I'm using PERL of course to put this together so if you want to back
up your viewpoints with code you would have the opportunity to display
your hubris while astounding others with your laziness as well... 

TIA,
STEVE


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

Date: Tue, 24 Mar 1998 14:56:10 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: debugging Perl
Message-Id: <EqBw5n.98L@world.std.com>

Uri Guttman <uri@sysarch.com> writes:

>William Wiley <wwiley@bedriver.com> writes:

>> Does anyone know of a usefull debugging environment for perl? Or am I
>> stuck using print statements.

>print statements are your friends. IMO the only guaranteed way to see
>what is happening. all other debuggers are helpers.

Which is why the perl debugger, is great. It allows you to set break
points and decide at runtime what and where you want to print.

-- 
Andrew Langmead


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

Date: 24 Mar 1998 10:22:55 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: Fell at the last hurdle :(
Message-Id: <6f8j4f$ni0@stratus.CAM.ORG>

In article <35174D22.988551E1@clear.net.nz>,
Jay and/or Blaise  <jay.blaise@clear.net.nz> wrote:
>
>I ran widget.bat OK... (only after saying couldn't find
>"c:\perl\bin\widget.bat.bat (note extra .bat)
>this happens if i try test.bat etc!
>Any ideas why I'm getting the extra .bat on the ends.
>

I don't know why an extra ".bat" gets appended, but here's a tip: you don't
have to type the ".bat".  Just use "widget", "perldoc", etc...

>Oh and when I click perl.bat, it just sits at the prompt, but I guess
>thats cause I havent sust the language yet and it's waiting for me to
>type something in ;o)
>

Yup !

Have fun !

Richard.
-- 
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
    "All along this path I tread  /  My heart betrays my weary head
     With nothing but my love to save / From the cradle to the grave"
                                 (Eric Clapton, "From the cradle")


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

Date: Tue, 24 Mar 1998 15:22:40 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Form Input
Message-Id: <EqBxDt.7I8@world.std.com>

"Dan J." <danjezek@pixi.com> writes:

>#!/usr/local/bin/perl
>##############################################

>$input = <STDIN>;

First problem, you are not following the CGI protocol correctly. Maybe
you should check the resources associated with the newsgroup
comp.infosystems.www.authoring.cgi to find out more about CGI.

>open (OUTFILE,">test.txt") || die ("Error, Output file not found\n");

Second problem, in your error message, you don't give yourself enough
information to diagnose what is going wrong. Maybe if you add the
contents of the $! variable to your error message, you can find out
the problem in creater detail. (Have you seen the document "Idiot's
Guide to Solving CGI problems" <URL:http://language.perl.com/CPAN/doc
/FAQs/cgi/idiots-guide.html> The type of the questions that it asks
you to ask "under what UID does the script run?", "what is the current
directory?", "who has permission to write in that directory?" may be
informative.)

There is a third issue, (its a little strong to call it a "problem"
but its close to one) is that you would probably be best off using the
CGI.pm module to handle some of the details of the CGI protocol.

By the way, since the script runs perfectly on the command line, it is
very unlikely that your problem has anything to do with perl.

-- 
Andrew Langmead


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

Date: Wed, 25 Mar 1998 00:55:47 +0900
From: Kazunori Nozaki <d080048@ec.hokudai.ac.jp>
Subject: GD.pm
Message-Id: <3517D782.4F2DEAAB@ec.hokudai.ac.jp>

I would like to know how to use GD.pm.
I could install GD-1.18, but couldn't use GD.
My script is

#!/usr/local/bin/perl5 -w
use lib qw(/home/soccer /home/soccer/lib /home/soccer/GD-1.18/blib
/home/soccer/GD-1.18);
use GD;

this result is

>perl pie.cgi
Can't find loadable object for module GD in @INC (/home/soccer
/home/soccer/lib /home/soccer/GD-1.18
/blib /home/soccer/GD-1.18 /usr/local/lib/perl5/sun4-solaris/5.00402
/usr/local/lib/perl5 /usr/local
/lib/perl5/site_perl/sun4-solaris /usr/local/lib/perl5/site_perl .) at
pie.cgi line 5
BEGIN failed--compilation aborted at pie.cgi line 5.

so,I can't solve this problem by myself.
Please teach me!!!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
soccer@ec.hokudai.ac.jp
Kazu Nozaki
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



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

Date: Tue, 24 Mar 1998 15:47:45 -0000
From: "Mark Stamps" <Mark_Stamps@scee.sony.co.uk>
Subject: Getting the elements in a form using Perl for ASP under IIS
Message-Id: <890754544.510.0.nnrp-03.c2d91211@news.demon.co.uk>

Hi,
I'm currently shifting the vast majority of my server scripts from VBScript
to Perl under IIS, but I'm having a bit of a problem.

I don't necesarily know what the name of variables being passed to the
script are, so under VBScript I would do something like the following.

<% For Each x In Request.Form %>
Request.Form( <%= x %> ) = <%= Request.Form(x) %> <BR><% Next %>

However, I just can't work out how to do this using Perl using the
$Request->Form object. I've tried all sorts of things, and can get the
values, the the names are somewhat more elusive :(

Thanks

Mark




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

Date: Tue, 24 Mar 1998 09:03:58 -0800
From: Jerome O'Neil <joneil@cks.ssd.k12.wa.us>
To: Mark Stamps <Mark_Stamps@scee.sony.co.uk>
Subject: Re: Getting the elements in a form using Perl for ASP under IIS
Message-Id: <3517E77D.CD17FAA0@cks.ssd.k12.wa.us>

Mark Stamps wrote:

> Hi,
> I'm currently shifting the vast majority of my server scripts from VBScript
> to Perl under IIS, but I'm having a bit of a problem.
>
> I don't necesarily know what the name of variables being passed to the
> script are, so under VBScript I would do something like the following.
>
> <% For Each x In Request.Form %>
> Request.Form( <%= x %> ) = <%= Request.Form(x) %> <BR><% Next %>
>
> However, I just can't work out how to do this using Perl using the
> $Request->Form object. I've tried all sorts of things, and can get the
> values, the the names are somewhat more elusive :(
>

If I gather what you are trying to do correctly, try

use CGI;
#blah blah blah
my(@parameters) = $cgi->param();

foreach(@parameters)
{
 # more blah with $_ set to the input name
}

---
Jerome O'Neil (joneil@cks.ssd.k12.wa.us)
Seattle Public Schools  (http://www.ssd.k12.wa.us)
Information Services    (Who I don't speak for)




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

Date: Tue, 24 Mar 1998 17:20:36 -0000
From: "Mark Stamps" <Mark_Stamps@scee.sony.co.uk>
Subject: Re: Getting the elements in a form using Perl for ASP under IIS
Message-Id: <890760119.17224.0.nnrp-08.c2d91211@news.demon.co.uk>

Hi Jerome,

>If I gather what you are trying to do correctly, try
>
>use CGI;
>#blah blah blah
>my(@parameters) = $cgi->param();
>
>foreach(@parameters)
>{
> # more blah with $_ set to the input name
>}
>

Yes, that's the general idea, but Perl for IIS throws an internal error if I
do that :(

The Request object is actually one of the IIS objects, I can do most of what
I want, for instance if I want the unparsed form field I would do...

    $x = $Request->Form;

which would give me xyz=1&xyz=2&abc=3

If I want to know how many elements (types) there are...

    $x=$Request->Form->Count;

Which gives me (quite rightly), 2.

I can always get the right hand side of the parameters, either by using the
position of element name. But actually getting the element name is what is
stumping me.

I know that I could just take the result of $Request->Form and parse these
out, but it's now a matter of principle to get this working the way I think
it should work :(

I'll probably give up in the end, but I would love to know if anybody out
there using ASP and Perl has managed to do this!

Mark






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

Date: 24 Mar 1998 09:51:41 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: Going Rates for PERL Programming???
Message-Id: <6f8h9t$ntp@ocean.CAM.ORG>

In article <6f6or3$o0s$2@usenet44.supernews.com>,
Peter Perchansky <fp@pmpcs.com> wrote:
>
>What I question is the pricing disctinction between tweeking another
>person's code and writing custom code.
>
>If it is the same programmer, why is their time worth less when tweaking?
>

Some people make a distinction between simple programming and designing an
application.

Richard, one of those people :-)
-- 
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
    "All along this path I tread  /  My heart betrays my weary head
     With nothing but my love to save / From the cradle to the grave"
                                 (Eric Clapton, "From the cradle")


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

Date: 24 Mar 1998 08:26:39 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: wef@wef.net
Subject: Re: Going Rates for PERL Programming???
Message-Id: <8ciup4hzyo.fsf@gadget.cscaper.com>

>>>>> "Wef" == Wef  <wef@N0SPAM_wef.net> writes:

Wef> Here's what my one and only client told me about the going rates for
Wef> PERL/CGI scripting for the WWW.

Wef> $45/hour for "tweaking" existing scripts.  Meaning the client wants ou
Wef> to change a few lines in a 'formmail.pl' script for instance...

Wef> $100/hour for custom scripting...  Meaning the client wants something
Wef> entirely different than what he/she can find on the web...

Wef> How do these rates compare....????

    my $compare = "45/hour" <=> "100/hour";
    print "looks like 45/hour is ",
	    ("less than","equal","greater than")[$compare + 1],
	    " 100/hour\n";

:-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 161 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Tue, 24 Mar 1998 10:17:16 -0600
From: jglopez@javercol.javeriana.edu.co
Subject: How to attach files with Sendmail.
Message-Id: <6f8m9d$5i8$1@nnrp1.dejanews.com>

Hi everybody, I am trying to attach a file to a E-mail message sent with send
mail directly from a script but I don't know how, do you know how, please help
me.

Thank you.

JG.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 24 Mar 1998 11:45:04 -0500
From: "Eric Winter" <ewinter@pop3.stx.com>
Subject: Re: How to take the icecream from the trashbox?
Message-Id: <6f8nvd$cmp@post.gsfc.nasa.gov>

$icecream_only = (split(/:/, $trashbox))[2];
$icecream_only =~ s/chocolate-//;

If you don't know where the entry is, save the split results:

foreach (split(/:/, $trashbox)) {
    if (/icecream/) {
        $icecream_only = $_;
        last;
    }
}

HTH
Eric Winter

Rossen Mikhov wrote in message
<351276EF.305F3D56@hikari-jhs.yamaguchi-u.ac.jp>...
>Hello. I have a problem and I would very much appreciate an advice.
>
>I have a long string and I want to get only a part of it. This is my
>script
>
>#Start
>$trashbox =":trash:trash:chocolate-icecream:arrow:trash:trash:trash";
>#The location of the icecream is just behind the ':arrow'
>$icecream_only = #What?
>#End
>
>Thanks in advance.
>
>Rossen.




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

Date: 24 Mar 1998 18:47:00 +0100
From: Gisle Aas <aas@sn.no>
Subject: Re: How to use the POST at Common.pm with a hash as argument
Message-Id: <m3u38o9e23.fsf@furu.g.aas.no>

algi-2@mdstud.chalmers.se (Lab. - konto Algi-2) writes:

> So it will differs from depening on which line I process from the infile,
> my idea was to create a hash with all entries that I want to post,
> so something like this:
> %tt = ( productcode  => $vara[0],
> 	prodweight => $vara[3],
> 	$vara[7] => $vara[7],
>         $vara[8] => $vara[8],
> 	$vara[9] => $vara[9],
> 	prodpagelayout =>layout2,)
> 
> $res= $ua->request(POST 'http://www.dxshop.com/admin/products-add.mhtml?ACTION=save&STORE=asd&PASSWORD=asd',
>        [%tt]);
> 
> 
> but that won't work.

As far as I can see, that should work.  How does it not work?  What
happens?

You should also be able to use the slightly more efficient (with
libwww-perl-5.17 or better):

   POST $url, \%tt;

-- 
Gisle Aas


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

Date: 24 Mar 1998 18:36:38 +0100
From: Gisle Aas <aas@sn.no>
Subject: Re: mirror (LWP::Simple) is acting like getstore!!!!
Message-Id: <m31zvsat3t.fsf@furu.g.aas.no>

"Fabiano Vanucci" <vanucci@sp.dglnet.com.br> writes:

> The problem is that (of course) I want to compar the new result of mirror
> with my file "yahoo", but mirror overwrites it and always result with
> success.
> 
> Can any one help me?

Something like this should do for you I think.

Regards,
Gisle


#!/usr/bin/perl -w
use strict;

my $url  = shift || "http://www.yahoo.com";
my $file = shift || "yahoo";

my $tmp = "$file-$$";
die "tmp file $tmp already exists" if -e $tmp;

use LWP;
my $ua = LWP::UserAgent->new;

my $req = HTTP::Request->new(GET => $url);
my $mtime = (stat $file)[9];
if ($mtime) {
   $req->if_modified_since($mtime);
} else {
   $tmp = $file;  # new file, no need for temporary
}

my $res = $ua->request($req, $tmp);

if ($res->is_success) {
    print "File downloaded\n";
    if (my $mod = $res->last_modified) {
	# make sure we agree on the modification time with the server
	utime $mod, $mod, $tmp;
    }
    if ($mtime) {
        rename($file, "$file~") || die "Can't rename $file: $!";  
        rename($tmp, $file) || die "Can't rename $tmp: $!";
        print "Changes are:\n";
        system("diff -u0 $file~ $file");
    }
} elsif ($res->code == 304) { # NOT_MODIFIED
    print "File unmodified, not downloaded\n";
} else {
    print $res->status_line, "\n";
}


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

Date: Tue, 24 Mar 1998 16:10:12 GMT
From: stephenb@scribendum.win-uk.net (stephen benson)
Subject: Re: Novice RegExpr problem -- how to slurp down big chunks of text for processing
Message-Id: <3517d926.30083167@nntp.ibmpcug.co.uk>

This works (Thanks Joseph N. Hall for the intelligent bit), but my
iteration is ridiculous; I'm still failing to grasp something -- I can
get it all in in one gulp, but how to iterate over it?

open(TESTFILE, "testPN_n.html") or die "Can't open testfile: $!\n";
@f = <TESTFILE>;
foreach (0..$#f) {
	if ($f[$_] =~ /<strong>(WW Notes* to)/) {
		$nm1 = $1;
		print "First 1 = $1\n";
		if ($f[$_+1] =~ /\s*(\d*.*\d+)<\/strong>/) {
			$nm2 = $1;
			print "Second 1 = $1\n";
			$lo = ($_ > 0) ? $_ - 1 : $_;
			$hi = ($_ < $#f) ? $_ + 1 : $_;
			print map { "$_: $f[$_]" } $lo .. $hi;
			print "\<A HREF=\"$nm1 $nm2\"\>$nm1
$nm2\</A\>";
			print "\n__________________________\n\n";
		}
	}
}

And why do I only get one match with this:
>open(TESTFILE, "testPN_n.html") or die "Can't open testfile: $!\n";
>local $/ = undef;
>while (<TESTFILE>) {
>    if ($_ =~ /<strong>(WW Notes* to)\s*(\d*.*\d+)<\/strong>/) {
>		print "\n__________________________\n\n";
>		print "\<A HREF=\"$1 $2\"\>$1 $2\</A\>";
>		print "\n__________________________\n\n";
>    	}
>}


-- stephen benson
stephenb@scribendum.win-uk.net || stephen_benson@watsonwyatt.co.uk
http://www.ibmpcug.co.uk/~2i/ || http://www.scribendum.win-uk.net/
__________________________________________________________________


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

Date: 24 Mar 1998 16:12:29 +0100
From: Rafael Laboissiere <rafael@dunite.icp.inpg.fr>
Subject: Perl module for (X)Fig files
Message-Id: <yaq90q086n6.fsf@dunite.icp.inpg.fr>


Before starting to reinvent the wheel:

Are there Perl modules for parsing and manipulating files in the Fig
format (as those generated by the XFig program) ?

Thanks for any info,

-- 
Rafael Laboissiere
Institut de la Communication Parlee / INP Grenoble, France
http://www.icp.inpg.fr/~rafael


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

Date: 24 Mar 1998 10:42:51 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: Perl on Win95 - CMD32 - File Length Restriction ?
Message-Id: <6f8k9r$o0l@stratus.CAM.ORG>

[ comp.lang.perl has been dead for a couple of years now.  If your ISP
  still "carries" it, please ask that it be removed ]

In article <3517C177.62A91873@sarnoff.com>,
James R. Matey <jmatey@sarnoff.com> wrote:
>
>I have a perl script which parses a data file.  It runs
>perfectly on a UNIX machine.  
>
>Under Win95, it fails to process the tail end of a ~24 MB
>file.  I am processing the file line by line, so that there
>is no issue of running out of memory.  There is no error 
>message - the program simply behaves as if it had run into
>an EOF before it reaches the end of file.
>

My guess is that there is a ^Z character in your data file, which is 
interpreted by DOS as EOF.  "binmoding" the filehandle will solve
this problem.  Use "binmode INFILE" right after opening it.

Richard.
-- 
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
    "All along this path I tread  /  My heart betrays my weary head
     With nothing but my love to save / From the cradle to the grave"
                                 (Eric Clapton, "From the cradle")


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

Date: Tue, 24 Mar 1998 12:15:46 -0500
From: Aaron Bennett <abennett@stonehill.edu>
Subject: Strange behavior with NET:Ftp under Cron
Message-Id: <3517EA42.6E6E4C03@stonehill.edu>

I'm having the strangest behavior:

when I run a script that uses NET:Ftp from the command line, it works
flawlessly.  However, when running from Cron, it occassionaly produces
this output:


>Your "cron" job
>
>  perl /export/service/www-home/https-www2/bin/registrar.pl
>
>  produced the following output:
>
>  Can't call method "login" without a package or object reference at >/export/service/www-home/https-www2/bin/registrar.pl line 43.


Here are the relevant lines:

#!/usr/local/bin/perl 

	use Net::FTP;


sub getfile
# retrieves file from remote site.
# Returns: full path name to retrieved local raw data file
{

	$ftp = Net::FTP->new($remote_site);
# this is the line that produces the error
	$ftp -> login($remote_user, $remote_password);
	$ftp -> cwd($remote_path);
	$ftp -> ascii;
	$local_temp=$local_destination . "craigtmp.txt";
	$ftp -> get($remote_file, $local_temp);
	$ftp -> quit;

	return $local_temp;
}


# main program body 
$filename=getfile();

$local_file=$local_destination . $local_finished_filename;
clean_file(ENROLL, $filename);
close ENROLL;


--

Am I having a context problem, or something else I don't understand? 
I'm using perl 5.004_04.

Regards,

Aaron Bennett
Internet Services Coordinator
Stonehill College


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

Date: 24 Mar 1998 16:32:43 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: The use of Perl extensions
Message-Id: <6f8n7b$h64$1@ns1.arlut.utexas.edu>

Paul Reilly <preilly@everest.spd.analog.com> writes:
> 
> I am currently wrestling with the strategy to use in interfacing an
> existing interactive C++ program to an encompassing Perl program being
> developed.

Neither SWIG or XS is that difficult to get going on. That fact that
the C++ code is already extant (legacy code) would push me in the
direction of SWIG. Others might disagree.

The examples in the books are simple because to cover all of what
could be done would take an entire book. A better approach is to take
advantage of the massive amount of on-line documentation. There is
ample documentation about XS in the perl distribution (perldoc
perlxstut would be the best way to get started), and very, very good
documentation for SWIG in its distribution. I'd start with that
documentation and then see if it's feasible to do your project that
way.

Good luck.

--
Stuart McDow                                      Applied Research Laboratories
smcdow@arlut.utexas.edu                       The University of Texas at Austin
  "It is obvious that about 750,000 people ago, Austin was a wonderful City."


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

Date: 24 Mar 1998 16:17:36 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: trouble with \r
Message-Id: <6f8mb0$edn$1@ns1.arlut.utexas.edu>

Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at> writes:
>
> You are assuming that STDOUT is the currently selected filehandle
> when you set $| - this may not always be true and thus $| isn't
> simply re-usable.

This fixes that little problem:

select((select(STDOUT), $|=1)[0]);

--
Stuart McDow                                      Applied Research Laboratories
smcdow@arlut.utexas.edu                       The University of Texas at Austin
  "It is obvious that about 750,000 people ago, Austin was a wonderful City."


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

Date: Tue, 24 Mar 1998 15:25:19 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: udp
Message-Id: <EqBxI7.BM7@world.std.com>

"Rodion Levotchka" <rodion@incoma.ru> writes:

>Please, help me with the following script. I need to send a string from one
>host to another (the daemon program on that host actually)  and get an
>answer string via UDP. How can i do that in perl?

Which part of the UDP section in the perlipc man page is confusing
you?
-- 
Andrew Langmead


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

Date: Tue, 24 Mar 1998 16:19:55 GMT
From: bas.nospam@dana.ucc.nau.edu (Brian Sawert)
Subject: Re: Wanted: Perl for Windows 3.x
Message-Id: <3518dbfb.64673024@usenet.nau.edu>

On 20 Mar 1998 10:11:01 -0500, charlot@CAM.ORG (Richard Bellavance)
wrote:

>>I am a computer eng student, I want to learn some perl. However
>>I don't have access to a UNIX box. Is there a perl version that
>>can be  run on  MS-Windows 3.1 or MS-Dos  ?.  I know that there
>>is a perl flavour for  MS-Windows NT but I am not in a position
>>to have access to a NT machine.

There is a DOS version available, with all the DOS limitations. You
can run only the tiniest scripts, due to the 640k barrier (There is no
support for extended or expanded memory). It does not support dbm
files, sockets and other useful and/or nifty stuff. However, if you
want to build it from the source code, you can tweak it to add certain
features.

My advice is that you beg, borrow, or steal access to a machine that
can run a full implementation of perl. Find a UNIX box, a WinNT
machine, or (God forbid) even a Win95 machine.

Good luck!

------------------------------------------------------------
Brian Sawert
Information Technology Services
Northern Arizona University


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

Date: Tue, 24 Mar 1998 16:23:17 GMT
From: mark@webz.com (Mark Schmick)
Subject: Re: What's up with the debugger?
Message-Id: <3517dd6a.39726260@news.flash.net>

On Tue, 24 Mar 1998 14:39:30 GMT, jgloudon@manitoba.bbn.com (Jason
Gloudon) wrote:

>Mark Schmick <mark@webz.com> wrote:
>>It looks like I should extend the last question to a full-on bug
>>report--I downgraded to 5.003 and the debugger buggery went away.
>>Still .. any comments? Is this repeatable on platforms other than
>>Linux?
>>
>>Perl 5.004_04
>>Redhat Linux, 2.0.27
>
>Hopefully you read the replies in your original post.
>I'd not recommend going backwards.

"in your original post"?

Do you actually mean "replies TO my original post" (of which
there are none so far but yours), or that the answer is really
in the question, in which case I still can't see it and would
welcome some enlightenment!

Thanx,
Mark



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

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

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