[18945] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1140 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 15 11:05:29 2001

Date: Fri, 15 Jun 2001 08:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <992617509-v10-i1140@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 15 Jun 2001     Volume: 10 Number: 1140

Today's topics:
    Re: 2 questions about flock <m.grimshaw@salford.ac.uk>
    Re: A simple pattern match problem? <leapius@hotmail.com>
    Re: A simple pattern match problem? (E.Chang)
    Re: And Thankyou again! <leapius@hotmail.com>
    Re: autoload troubles <der.prinz@gmx.net>
        Calling executables (Igal Corcos)
    Re: Calling executables <peter.sogaard@tjgroup.com>
    Re: Calling executables <jurgenex@hotmail.com>
    Re: Can't locate Slash.pm in @INC <gnarinn@hotmail.com>
    Re: Cookbook Socket 605 <bkennedy99@Home.com>
    Re: DBI does not get all rows in DB2 table <gnarinn@hotmail.com>
    Re: Design pattern for a generic functions dispatcher <bart.lateur@skynet.be>
    Re: Design pattern for a generic functions dispatcher <bart.lateur@skynet.be>
    Re: FAQ 7.27:   How do I clear a package? <newspost@coppit.org>
    Re: Generating WML content? <alan@headru.sh>
        Get info about stored procedures <Jenda@Krynicky.cz>
        Help with my perl scripts  <dbadba62@hotmail.com>
    Re: HTML input box variables? <alan@headru.sh>
    Re: Looking for Programmers - Numerous projects <alan@headru.sh>
    Re: Newbie Post : Flushing output for long scripts <alan@headru.sh>
    Re: Premature end of srcipt headers? <john.imrie@pa.press.net>
    Re: setting @INC at perl compile time <john.imrie@pa.press.net>
        simple scripts for automated web browsing? <j.a.t.dow@bio.gla.ac.uk>
    Re: Thankyou all very much for the help :) <leapius@hotmail.com>
    Re: Unsure about headers <alan@headru.sh>
    Re: Validation and escape \ requirement? <bart.lateur@skynet.be>
    Re: What is the ideal way to parse? (Anno Siegel)
    Re: Which C compiler to use for modules? (isterin)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 15 Jun 2001 11:55:33 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: 2 questions about flock
Message-Id: <3B29E9A5.68401A4@salford.ac.uk>



Samuel Kilchenmann wrote:
> 
> "Mark Grimshaw" <m.grimshaw@salford.ac.uk> schrieb im Newsbeitrag
> news:3B28C7D0.FB922302@salford.ac.uk...
> > Anyone for the sync() question at the bottom?
> >
> > > my $db = new my_DB;
> 
> So¨$db holds a reference to an instance of your package my_DB;
> 
> > >         $db->sync();    # flush output to DB
> 
> You probably have no sync() method defined in your package my_DB. So you
> call an undefined method which causes your script to abort.
> 
> > > open_db() is a db tie method I've defined in an external package:
> > >
> > > sub open_db     # tie %DB to db with supplied mode
> > > {
> > > shift;
> > > my @input = @_;
> > > my %DB;
> > >         tie(%DB, 'DB_File', $input[0], $input[1]) or return 0;
> 
> Here you need to store a copy of the object returned from the tie.
> (See the section "THE API INTERFACE" in the DB_File manpage)
> my $db_obj = tie(%DB, 'DB_File', $input[0], $input[1]) or return 0;
> 
> > >         return \%DB;
> and return it together with the tied hash reference
>   return ($db_obj, \%DB);
> and then change your call to db_obpen to
> ($db_obj, $DB) = $db->open_db($db_file, O_RDWR|O_CREAT)))
> then you should be able to call:
> $db_obj->sync()
> 
> another possibility would go along these lines:
> - store the object returned from tie in your my_DB instance
> - implement a proxy method sync() in your my_DB package which
>   forwards the sync() call to the object returned from tie and
>   stored in the my_DB instance.
> 
> something like:
> 
> sub open_db     # tie %DB to db with supplied mode
> {
>   my $self = shift;
>   my ($file, $flags) = @_;
>   my %DB;
> 
>   $self->{DB_OBJ} = tie(%DB, 'DB_File', $file, $flags) or return;
> 
>   return \%DB;
> }
> 
> sub sync()
> {
>   my $self = shift;
> 
>   return ${self->{DB_OBJ}}->sync();
> }
> 
> > > Any idea what's up?
> 
> You might want to take a look at the BerkeleyDB module which gives you
> access to the transactional and the builtin locking features of newer
> Berkeley DB versions.


Perfect - thanks!  Taken your first example and it seems to work (at
least doesn't exit after the sync() call).

I'm curious why strict would not complain if I attempted to call an
undefined method sync() as I originally did.


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

Date: Fri, 15 Jun 2001 12:59:08 +0100
From: "Leo Hemmings" <leapius@hotmail.com>
Subject: Re: A simple pattern match problem?
Message-Id: <9gct95$4pv$1@uranium.btinternet.com>

None of these methods seem to work for me. I think I should have been more
clear in my application; This data is coming from a textbox in a form and I
want to remove any blank lines the user inputs. These patern matches,
although working for a normal string will simply refuse to work for the hash
that is sent from the form. Is this something to do with "\r" as well?

Thankyou again,
Leo

"E.Chang" <echang@netstorm.net> wrote in message
news:Xns90C0E0CE92D1echangnetstormnet@207.106.92.86...
> cberry@cinenet.net (Craig Berry) wrote in
> <tiipve7too51a2@corp.supernews.com>:
>
> > Leo Hemmings (leapius@hotmail.com) wrote:
> > : I have a problem, which I think a pattern match might sort out
> > but don't : know how to do it. Basically I have a string with a
> > number of lines of text. : I want to remove any empty lines in this
> > string (i.e. when there are two or : more '\n' in a row). So the
> > following text:
> >
> >   $string =~ tr/\n//s;
>
> This is certainly the version to use, since it's much faster.
>
> Is this effect of /s  with a null replacement character documented
> anywhere?  I interpreted "If the /s modifier is specified, sequences of
> characters that were transliterated to the same character are squashed
> down to a single instance of the character." to mean squashed to a
> single instance of the replacement character, not the original, and
> that is certainly what happens with a non-null. Just hoping to learn
> something.
>
> --
> EBC




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

Date: Fri, 15 Jun 2001 14:20:16 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: A simple pattern match problem?
Message-Id: <Xns90C169B008FB2echangnetstormnet@207.106.92.86>

"Leo Hemmings" <leapius@hotmail.com> wrote in
<9gct95$4pv$1@uranium.btinternet.com>: 

>None of these methods seem to work for me. I think I should have
>been more clear in my application; This data is coming from a
>textbox in a form and I want to remove any blank lines the user
>inputs. These patern matches, although working for a normal string
>will simply refuse to work for the hash that is sent from the form.
>Is this something to do with "\r" as well? 

Yes, the end-of line sent by the form is a CRLF pair.  On some 
operating systems this is also the end of line character, but in Unix 
the end of line character is just the LF.  A modification of the 
revious suggestion Craig Berry would be 

    tr/\015\012/\n/s;

-- 
EBC


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

Date: Fri, 15 Jun 2001 12:24:46 +0100
From: "Leo Hemmings" <leapius@hotmail.com>
Subject: Re: And Thankyou again!
Message-Id: <9gcr8p$2vk$1@uranium.btinternet.com>

cheers,
Leo




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

Date: Fri, 15 Jun 2001 12:14:49 +0200
From: "Stefan Weiss" <der.prinz@gmx.net>
Subject: Re: autoload troubles
Message-Id: <3b29dfc4$1@e-post.inode.at>

Samuel Kilchenmann <skilchen@swissonline.ch> wrote:

> "Stefan Weiss" <der.prinz@gmx.net> schrieb im Newsbeitrag
>
> > require $self->{pkg} . ".pl";
> > my $coderef = eval '$XLib::'. $self->{pkg} . "::methods{$method}";
> > my $result = $coderef->($params);
> >
> > Is this an acceptable solution (assuming a package like "XLib::Foo")?

> What about exporting only the method dispatch table into callers
> namespace?

[code saved && snipped]

Yes, that way I could leave it to Exporter.pm to figure out how
to access that package. Thanks, I will try that.


cheers,
stefan





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

Date: 15 Jun 2001 06:34:05 -0700
From: corcos@metalink.com (Igal Corcos)
Subject: Calling executables
Message-Id: <23e89631.0106150534.347ac950@posting.google.com>

Is there another way to call executable programs from a Perl script
besides system(LIST) (or exec); ?


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

Date: Fri, 15 Jun 2001 15:43:30 +0200
From: "Peter Søgaard" <peter.sogaard@tjgroup.com>
Subject: Re: Calling executables
Message-Id: <9gd38t$b2t$1@news.inet.tele.dk>

> Is there another way to call executable programs from a Perl script
> besides system(LIST) (or exec); ?

Use backtics:
print `dir`;




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

Date: Fri, 15 Jun 2001 07:01:55 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Calling executables
Message-Id: <3b2a1554$1@news.microsoft.com>

"Igal Corcos" <corcos@metalink.com> wrote in message
news:23e89631.0106150534.347ac950@posting.google.com...
> Is there another way to call executable programs from a Perl script
> besides system(LIST) (or exec); ?

You could use `` (that is backticks).

jue




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

Date: Fri, 15 Jun 2001 10:13:13 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: Can't locate Slash.pm in @INC
Message-Id: <992599993.895246798638254.gnarinn@hotmail.com>

In article <Pine.A41.4.33.0106142027490.29492-100000@dante58.u.washington.edu>,
M. Scholz <msperrin@u.washington.edu> wrote:
>I know why I'm getting the message above (I think) but I don't know how to
>fix it.
>
>I have two separate trees for perl5 installed on my machine:
>/usr/lib/perl5/5.6.0
>& /usr/local/perl5/5.6.1
>
>CPAN has been installing new modules in the second tree.  However,
>according to Config.pm (in the 5.6.0 tree, which perl seems to be
>checking) the /usr/local/perl5/ directory doesn't exist.  Any great ideas
>on how to update Config.pm to include the second tree so I don't have to
>manually copy all of the files over?
>

how about running cpan from the 5.6.1 binary?
/usr/local/bin/perl -MCPAN shell
(assuming the 5.6.1 binary is in /usr/local/bin)

gnari


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

Date: Fri, 15 Jun 2001 13:08:07 GMT
From: "Ben Kennedy" <bkennedy99@Home.com>
Subject: Re: Cookbook Socket 605
Message-Id: <XMnW6.16102$Zt6.7735512@news1.rdc2.pa.home.com>


"spurcell" <skpurcell@hotmail.com> wrote in message
news:3b28e238$0$175@wodc7nh6.news.uu.net...

> without making $handle global, how to I pass it. I tried it just as a
> variable
> return $handle
> my $newhandle  = shift, but I get a 1, not a reference to some object
> handle?

That is a standard way of getting parameters into a subroutine - are you
absolutely sure that the handle is getting passed in?  Insert some debugging
statements to try to track down where the variable is getting lost.  There
is a good chance you are accidentally returning or passing a function call
that returns true, or somehow setting a scalar to the value of an array in
scalar context.  Also, try to boil the problem down to its simplest terms to
figure out whats wrong, start with:

my $string = make_string();
print_string($string);

sub make_string {
    my $return_string = "This is a string";
    return $return_string;
}

sub print_string {
    my $string = shift;
    print "You said: $string!\n";
}.

And substiute your code until it breaks.  Hope this helps --

--Ben Kennedy




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

Date: Fri, 15 Jun 2001 10:24:58 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: DBI does not get all rows in DB2 table
Message-Id: <992600698.0844346680678427.gnarinn@hotmail.com>

In article <74b11556.0106142119.3e258bf5@posting.google.com>,
andy standley <andrews@ecnetwork.co.nz> wrote:
>Hi,
>	When I run my script on a AIX with a DB2 table I don't get all the
>rows and the rows I do get are not all correct. Is there some cache
>issue here. I looked at the manuals but no clues.... or is it just me
>not looking hard enough???
>
>
>
>$statement = "SELECT * FROM devecndb.parameters;";
>$sth = $cls->prepare($statement);
>print "Query will return $sth->{NUM_OF_FIELDS} fields.\n\n";
>
>$sth->execute();
>while (my @row = $sth->fetchrow_array){
>  print "@row\n";
>}
>

explain what you get, and what you expect, and why you expect it.

maybe replacing the print with 
  print join("|",@row)."\n";
will make the output clearer, in case you are confused by NULL fields
or spaces in data.

you could use a fetchrow_hashref, and print out both keys and values,
in case the order of the fields is not what you expect.

gnari


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

Date: Fri, 15 Jun 2001 11:15:07 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Design pattern for a generic functions dispatcher
Message-Id: <ffrjit49us4p8kt4a08h653gog0udlavd1@4ax.com>

Benjamin Goldberg wrote:

>> >                       ${$subname}(); # symref call
>
>This should be:		  &{$subname}(); # symref call

Or 
	$subname->();

Looks neater. Works, apparently, both with sub names and with proper sub
refs.

-- 
	Bart.


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

Date: Fri, 15 Jun 2001 11:16:22 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Design pattern for a generic functions dispatcher
Message-Id: <blrjitktprl57p3ookk42riqp4u5scufju@4ax.com>

Abe Timmerman wrote:

>my %action_map = (
>	ACTION1 => 'MyModule::SubModule::Myfunction',
>	ACTION2 => 'MyOtherModule::MyOtherFunction',
>);

I prefer sub refs.

my %action_map = (
	ACTION1 => \&MyModule::SubModule::Myfunction,
	ACTION2 => \&MyOtherModule::MyOtherFunction,
);

-- 
	Bart.


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

Date: Fri, 15 Jun 2001 09:29:38 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: FAQ 7.27:   How do I clear a package?
Message-Id: <Pine.SUN.4.33.0106150926360.10481-100000@mamba.cs.Virginia.EDU>

On Fri, 15 Jun 2001, Benjamin Goldberg wrote:

> PerlFAQ Server wrote:
> > +
> >   How do I clear a package?
> >
> >     Use this code, provided by Mark-Jason Dominus:
> >
> >         sub scrub_package {
> >             no strict 'refs';
> >             my $pack = shift;
> >             die "Shouldn't delete main package"
> >                 if $pack eq "" || $pack eq "main";
> >             my $stash = *{$pack . '::'}{HASH};
> >             my $name;
> >             foreach $name (keys %$stash) {
> >                 my $fullname = $pack . '::' . $name;
> >                 # Get rid of everything with that name.
> >                 undef $$fullname;
> >                 undef @$fullname;
> >                 undef %$fullname;
> >                 undef &$fullname;
> >                 undef *$fullname;
> >             }
> >         }
> >
> >     Or, if you're using a recent release of Perl, you can just use the
> >     Symbol::delete_package() function instead.
> >
> > -
>
> Don't you also need to clear/close the filehandle, if there is one?
> I think this would be done as:
> 	undef *{$fullname}{IO};
> or
> 	close *$fullname;

And also clear %INC? I would think that without clearing %INC,
require() would think that the package was already loaded if you try
to require() it again.

This would be important if you loaded a module like CPAN, saw that
there was an update, automatically downloaded the update,
"uninstalled" the module, then require'd it.

David



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

Date: Fri, 15 Jun 2001 13:17:56 +0100
From: "alan@" <alan@headru.sh>
Subject: Re: Generating WML content?
Message-Id: <9gcuc0$p7v$1@newsg2.svr.pol.co.uk>

Ok, I have been working with perl generated wml pages.
If neccessary create temp files for the wml content when requested by the
browser. Failing that just read the content (as its only updated daily) and
format it for the browser in separate decks. Provide links to those decks in
each card.
Contention shouldn't be an issue if the content is the same all day. Each
user will be accessing data via a different process id anyway.
Use wml forms to request different parts of the data if neccessary.

Here are examples of wml forms and a script to update files from the phone
:-
http://www.taz1.com/files/index.wml.txt
http://www.taz1.com/files/score.cgi.txt

Please note these are written for the Upbrowser.

Cheers

Alan
alan@NOSPAMheadru.sh



Robert Nicholson <steffi@shell8.ba.best.com> wrote in message
news:yl3r8xam1kf.fsf@shell8.ba.best.com...
> OK, I'm forced to split my cards across multiple decks becuase of the
> phone limitations so since I'm generating dynamic data I'm asking what
> approach do people use when they have to generate .wml files from dynamic
> content to deliver to the browser?
>
> Specifically how to clean up your generated files and are you just using
> the process ID and including that in the url's to the documents?
>
> What's the typical way to handle contention issues for generated content?




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

Date: Fri, 15 Jun 2001 11:09:23 GMT
From: Jenda Krynicky <Jenda@Krynicky.cz>
Subject: Get info about stored procedures
Message-Id: <1104_992603363@JENDA>

I need to read information about stored procedures in a MS SQL database within a program.

I can get the list of procedures, their parameters, types and sizes of parameters via Win32::OLE
"SQLDMO.SQLServer".

I can't find a way to find out two more things.

1) I can't find how to check whether some parameter has a default value.
I don't mind what the value is, I just need to know what parameters are required.

2) I'd like to know whether the function returns a recordset/resultset (call it however you like).

Is there any way to find out?

Or if I have to parse the procedure definition ... is there a parser?

Thanks for any suggestions, Jenda

P.S.: I'm autogenerating a COM wrapper around the procedures so that I can write
	err = obj.SomeStoredProcedure( 1, "Hello", world, rset)
in ASPs. The autogeneration script is of course Perl, the generated code is VB.
The client wants me to use VB so that's what he will see ;-)

P.P.S.: Mail CC is appreciated.



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

Date: Fri, 15 Jun 2001 10:30:48 GMT
From: "ff" <dbadba62@hotmail.com>
Subject: Help with my perl scripts 
Message-Id: <stlW6.2792$Ua3.599522@typhoon2.ba-dsg.net>

We have a perl scripts, part of it is drop index as follows
----------------------------------------------------------
my $failure = 1;
while ( $failure != 0 )
{
        my $sql = qq{ drop index index_1};
        $dbh->do ( $sql );
        if ( $dbh->state == 0 )
        {
                print "index_1 dropped\n";
                $failure = 0;
        }
        else
        {
                $failure = 1;
                print "error dropping index_1= $dbh->errstr and error value
$dbh->state\n";
        }
}
--------------------------------------------------------------------
But the script is not very successful.  One out of ten times, the index is
not dropped and the scripts will exit the loop and continue to run, which
will try to create the same index_1 which is suppose to be droped now.

Could some body help me to improve my script to make sure it will not exit
while loop until the the index_1 is dropped for sure?

Thanks




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

Date: Fri, 15 Jun 2001 14:43:58 +0100
From: "alan@" <alan@headru.sh>
Subject: Re: HTML input box variables?
Message-Id: <9gd3d8$g62$1@newsg3.svr.pol.co.uk>


Jonathan Drever <jonathan.drever@amsjv.com> wrote in message
news:3B14E2B3.909A94A4@amsjv.com...
> Hello,
> Does anybody know how to use a perl script to insert a string variable
> into an html input box. I can not find any examples anywhere on how to
> do this.

Hi, here you go :-

#!/usr/bin/perl

################################################################
&demo;

##############################
sub demo
{

$terms = "your string";
@test = ("one", "two", "three");

print "Content-type: text/html\n\n";

print <<EOM;
<html>
<head>
<title>variable into form field</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<center>
<form method="post" action="">
  <input type="text" name="test0" value="$terms"><br>
<input type="text" name="test2" value="$test[0]"><br>
<input type="text" name="test3" value="$test[1]"><br>
<input type="text" name="test4" value="$test[2]">
</form>
</center>
</body>
</html>
EOM

}

########################

Upload, chmod 755, call it from your browser.
Simple, no sweat, glad I could help.

Alan
alan@NOSPAMheadru.sh






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

Date: Fri, 15 Jun 2001 13:31:29 +0100
From: "alan@" <alan@headru.sh>
Subject: Re: Looking for Programmers - Numerous projects
Message-Id: <9gcv5c$d6a$1@newsg3.svr.pol.co.uk>


> In article <759114d.0105280448.7f12106e@posting.google.com>, William
> Cross wrote:
> > PerlCoders dot com currently has 2 openings for perl programmers.
>
David H. Adler <dha@panix2.panix.com> wrote in message
news:slrn9h5fpu.99b.dha@panix2.panix.com...
> You have posted a job posting or a resume in a technical group.
>

So why add to the problem by replying ?

gnaarf





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

Date: Fri, 15 Jun 2001 15:50:45 +0100
From: "alan@" <alan@headru.sh>
Subject: Re: Newbie Post : Flushing output for long scripts
Message-Id: <9gd7ad$ikl$1@newsg4.svr.pol.co.uk>


Ben Holness <bholness@nortelnetworks.com> wrote in message
news:9fg6uu$if$1@qnsgh006.europe.nortel.com...

> It's a real pain, because I have a perl script that reads a file,
processes
> it, prints a line of text, then reads the next file and so on...
>
> The problem is that the user gets bored waiting, or I get a timeout before
> the script has finished, so it would be nice to be able to feed them a
line
> at a time...

Hi,
Write the lines to an array, then do it like this. Not clever but it works.
test at http://www.taz1.com/test2.cgi

#!/usr/bin/perl

################################################################
&demo;

##############################
sub demo
{

open (INPUT,"<terms.dat");
 @thelist = <INPUT>;
close (INPUT);

print "Content-type: text/html\n\n";
print "Here we go then<br><br>";

  foreach $em (@thelist)
   {
     print "$em: Done<br>";
   }
   print"\n<B>Processing completed!</B>\n";

}

Alan






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

Date: Fri, 15 Jun 2001 11:30:08 +0100
From: "John Imrie" <john.imrie@pa.press.net>
Subject: Re: Premature end of srcipt headers?
Message-Id: <EulW6.1432$h45.8805@news.uk.colt.net>


Benjamin Goldberg <goldbb2@earthlink.net> wrote in message
news:3B29C9DA.269C3D4B@earthlink.net...
> Unbelievable!  An intelligent, useful post by Kira!  I'm having a heart
> attack from shock!
>

This is the second one I've seen today.
Are you feeling all right Kira <g>




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

Date: Fri, 15 Jun 2001 11:49:18 +0100
From: "John Imrie" <john.imrie@pa.press.net>
Subject: Re: setting @INC at perl compile time
Message-Id: <AMlW6.1433$h45.8823@news.uk.colt.net>


> I've ended up pushing a bunch of stuff into the config.sh
> "otherlibdirs" variable, but is that the right way? And how
> much of a bad thing is it to have a directory appear multiple
> times in @INC? I've still got my PERL5LIB environment variable
> for now...

use lib( 'dir', 'dir')

will push the directories onto @INC

If you want to compleatly rewrite @INC then

BEGIN {
  @INC=('new directory list')
}

Note I *STRONGLY* advise *NOT* using thesecond option unless you know
*EXACTLY* what you are doing and why






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

Date: Fri, 15 Jun 2001 11:54:41 +0100
From: "Julian Dow" <j.a.t.dow@bio.gla.ac.uk>
Subject: simple scripts for automated web browsing?
Message-Id: <9gcq24$rm6$1@singer.cent.gla.ac.uk>

Sorry this is a newbie question, but:
You know how some web pages give you stuff in batches of 10, when you want
to download 1000?
I wanted to write a simple routine that accesses a web page and prints it to
output (or whatever). I could then adapt it to automatically generate the
'next page' url and download it.
I know this should be really simple, but the modules I saw (WebFS::FileCopy
? )were already documented above my level :-(
Many thanks for any advice you can offer,
Julian
j.a.t.dow@bio.gla.ac.uk




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

Date: Fri, 15 Jun 2001 12:24:16 +0100
From: "Leo Hemmings" <leapius@hotmail.com>
Subject: Re: Thankyou all very much for the help :)
Message-Id: <9gcr7q$b09$1@plutonium.btinternet.com>

Thankyou all very much for the help. Great stuff! :)

cheers,
Leo




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

Date: Fri, 15 Jun 2001 14:59:40 +0100
From: "alan@" <alan@headru.sh>
Subject: Re: Unsure about headers
Message-Id: <9gd57p$hfe$1@newsg3.svr.pol.co.uk>

How come there is so much about etiquette and  f*  all about the guys
question ?
If you don't like the way he posts, don't read them !

Sad lonely people.




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

Date: Fri, 15 Jun 2001 11:20:42 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Validation and escape \ requirement?
Message-Id: <8rrjitc33u8vhl92ivk6vcvj1mokrtp1k6@4ax.com>

David Soming wrote:

>if ($message =~ tr/a-zA-Z0-9?',.\-\!\n\t //c) {  #The escape is needed for
>characters after the period "." (full stop char)? otherwise what ever char
>follows it - trips $errormessage

"-" is special for tr, just as it is in a character class for regexes.
It indicates a range. Since "!" has an Ascii code smaller than "." has,
this is not a valid range.

Barring exceptions (begin or end of enumeration, i.e. far left or far
right), you need to escape a hyphen to get a literal hyphen.

-- 
	Bart.


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

Date: 15 Jun 2001 10:39:37 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: What is the ideal way to parse?
Message-Id: <9gcol9$ms5$1@mamenchi.zrz.TU-Berlin.DE>

According to Frank Dessing <F.J.Dessing@siep.shell.com>:
> Hi,
> 
> I am looking for a way to parse variables into a scripts. The scripts can be
> unix or another language.
> 
> What I want to do looks like this. I have a long script with here and there
> a variable at a certain position in the line. The variables should be
> sometimes of a fixed format. The script can have the following structure.
> 
> === START_OF_SCRIPT
> command1 $variable1 remainder_of_command1
> command2
> $variable3 command3
> === END_OF_SCRIPT
> 
> At the moment I read the base script and search for $variable1, $variable2
> etc. and replace them with a s/// command. Subsequently I write the replaced
> lines to a new file. This is perfectly doable as long as the number of
> variables is small. If the number of variables gets larger the substitution
> approach starts to become more problematic.
> 
> Any ideas on more efficient solutions.

More efficient than what?  Since you don't show what you are doing
and what you think is inefficient it's hard to come up with suggestions.

You may want to check the Text::Template module.

Anno


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

Date: 15 Jun 2001 07:38:16 -0700
From: isterin@hotmail.com (isterin)
Subject: Re: Which C compiler to use for modules?
Message-Id: <db67a7f3.0106150638.4e69bd69@posting.google.com>

Any module that does not use XS for extensions can just be copied and
pasted in your site/perl directory.  To compile a module that uses XS
you must use the same compiler which was used to compile perl. 
ActiveState was compiled with VC++, so that is what you must use. 
Compilers produce different .obj code, so if you compile one with one
compiler and one with another in most cases they cannont be linked
together.  You can try to compiler perl with cygwin's gcc, never tried
it before, then you can install all you modules using gcc and their
make.

Ilya


"John Imrie" <john.imrie@pa.press.net> wrote in message news:<Gc3W6.1421$h45.8569@news.uk.colt.net>...
> Godzilla! <godzilla@stomp.stomp.tokyo> wrote in message
> news:3B27C7F0.45A299D4@stomp.stomp.tokyo...
> > isterin wrote:
> >
> > (topic is compiling modules for Win 32)
> >
> > > On Windows you should have ActiveState and install binary packages
> > > through ppm utility that comes with it.  If you ever need to compile a
> > > module that is not  available through activestate binaries, you must
> > > use VC++, because this is what ActiveState perl is compiled with.  You
> > > must compile all packages with the same compiler that you perl was
> > > compiled with.
> >
> 
> If you are going to get the free compiler talked about in this thread then
> the first thing you need to do is get the Perl source code and compile it
> with your program.
> 
> The source will compile for unix and windose


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.announce, send your article to
clpa@perl.com.

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

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


------------------------------
End of Perl-Users Digest V10 Issue 1140
***************************************


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