[13406] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 816 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 16 07:07:18 1999

Date: Thu, 16 Sep 1999 04:05:08 -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: <937479907-v9-i816@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 16 Sep 1999     Volume: 9 Number: 816

Today's topics:
    Re: CGI cannot open relative path <jdupayrat@webraska.com>
    Re: CGI cannot open relative path <jdupayrat@webraska.com>
        Debuging problem with delete <cal99@math.ist.utl.pt>
    Re: Help! .pm did not return a true value (Roman Prokhorov)
        Hor can i distinguise betwen a file or a directory? <abel.almazan@ogilvyinteractive.es>
    Re: Hor can i distinguise betwen a file or a directory? <abel.almazan@ogilvyinteractive.es>
    Re: How to validate a URL? <Mark@Mark.Com>
        Is there any CTlib.pm documentation ? c_j_marshall@my-deja.com
    Re: Link CGI to microsoft Access <andriani@singnet.com.sg>
    Re: Link CGI to microsoft Access <andriani@singnet.com.sg>
    Re: Link CGI to microsoft Access <gellyfish@gellyfish.com>
    Re: need to write www search engine <noreply@address.com>
    Re: need to write www search engine <contact@citizenz.org>
    Re: Parsing Tab Delimited File <skilchen@swissonline.ch>
    Re: passing "=" as an argument to CGI <gellyfish@gellyfish.com>
    Re: Please help a newbie! - sorry for the mistake! makau@my-deja.com
    Re: Please help a newbie! makau@multimania.com
    Re: Reading files on a remote server ???????? <stewart@xcs.com.au>
    Re: Reading files on a remote server ???????? <gellyfish@gellyfish.com>
    Re: script to dynamically produce standard calender <gellyfish@gellyfish.com>
    Re: Searching subdirs with unknown names in known dirs. <Nicholas.Dragotas@Motorola.com>
        SHAREWARE: txt2pdf 2.3 <sanface@sanface.com>
    Re: Splitting a line and honoring "strings" (Remco Gerlich)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Thu, 16 Sep 1999 10:47:23 +0100
From: "JduPayrat" <jdupayrat@webraska.com>
Subject: Re: CGI cannot open relative path
Message-Id: <7rqalf$4q3$1@minus.oleane.net>



>Otherwise, there is no simple solution.  The CGI specs do not define what
>the default directory should be so each webserver (and even different
>releases of the same server) may behave slightly differently in this
>regard.


What surprise me is that the current working directory reported by getcwd()
(Cwd.pm) is the directory where my script is stored. My cgi simply refuse to
use it when opening a file. So I wonder if it is a normal behavior or a bug
?




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

Date: Thu, 16 Sep 1999 10:52:30 +0100
From: "JduPayrat" <jdupayrat@webraska.com>
Subject: Re: CGI cannot open relative path
Message-Id: <7rqav3$4sd$1@minus.oleane.net>


>How do you require it?  Either using a relative pathname (which,
>according to the original poster, doesn't work to open files, so it
>probably won't work to require them either) or using an absolute
>pathname.  Which will have to be changed.  In every file that requires
>rootdir.pl.



That's exactly my problem. I don't see any solution that don't need a change
in each script.





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

Date: Thu, 16 Sep 1999 11:40:59 +0100
From: Computer Assisted Learning <cal99@math.ist.utl.pt>
Subject: Debuging problem with delete
Message-Id: <37E0C93A.18CB5A13@math.ist.utl.pt>

I'm a newcomer to perl and I've been having many problems with debuging
my programs.

when using perl -d, the command line donesn't allow me to edit  the line
with delete or the arrows.

What should I do to fix this?

Thank you in advance and please mail me back the answer.

Claudio Valente

cvalente@math.ist.utl.pt



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

Date: Thu, 16 Sep 1999 14:59:22 +0400
From: roma@stalker.gamma.ru (Roman Prokhorov)
Subject: Re: Help! .pm did not return a true value
Message-Id: <roma-1609991459220001@node4.stalker.gamma.ru>

In article <slrn7tvodg.hj3.abigail@alexandra.delanet.com>,
abigail@delanet.com wrote:

> ``   On one of my customer's machine my scripts don't run:
> `` ---
> `` CLI.pm did not return a true value at ./ListAccounts.pl line 13.
> `` BEGIN failed--compilation aborted at ./ListAccounts.pl line 13.
> `` ---
> `` 
> ``   Line 13 is "use CLI.pm;". The CLI.pm has "1;" on its end and it works
> `` fine on all platforms except that particular machine.
> 
> use doesn't just scan to the end of the file and checks whether it has "1;"
> there. For some reason, the true value was never returned. I guess you have
> a bug. Now, without seeing any code, that's hard to say what bug.

<http://www.stalker.com/CGPerl>. Any comments welcomed.
 
> But don't post hundreds of lines of code. Try running perl -wc CLI.pm and
> see if it returns any bugs. If not, run perl -w CLI.pm.

The output was:
---
Name "*****" used only once: possible typo at CLI.pm line **.
CLI.pm syntax OK
---

The "name used only once" errors are constant definitions (not used yet)
and shouldn't cause any error.

I repeat: on my setup it works (so I doubt my Perl interpreter will find
any error). Maybe I'm using some nonstandard thing in Perl syntax that
can't be understood by other interpreters?

  Should I write explicitly:
BEGIN {
  retrun 1;
}
???


> ``   What can I do about it? Please answer by e-mail if possible.
> 
> Why? If you cannot be bothered to read the group, the question isn't
> really important to you, now is it?

  My local news server uses to skip messages.

-- 

  Roma


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

Date: Thu, 16 Sep 1999 10:09:19 +0200
From: Abel =?iso-8859-1?Q?Almaz=E1n?= <abel.almazan@ogilvyinteractive.es>
Subject: Hor can i distinguise betwen a file or a directory?
Message-Id: <37E0A5AF.34721820@ogilvyinteractive.es>





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

Date: Thu, 16 Sep 1999 10:10:20 +0200
From: Abel =?iso-8859-1?Q?Almaz=E1n?= <abel.almazan@ogilvyinteractive.es>
Subject: Re: Hor can i distinguise betwen a file or a directory?
Message-Id: <37E0A5EC.DF717E9@ogilvyinteractive.es>



You should have posted this to the group, I prefer to answer questions
there.

To answer your question - you carry out a file test on the file you are
looking at (look these up they're very useful). If -d is true then the
file is a directory.

if (-d "$dir" . "$_") {print "This is a dir"};

or a more useful way of putting it for your script may be

unless (-d "$dir" . "$_") {print "<A ......>...</A>"};

HTH,

Jeremy





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

Date: Thu, 16 Sep 1999 09:03:07 +0100
From: Mark <Mark@Mark.Com>
Subject: Re: How to validate a URL?
Message-Id: <37E0A43A.CC063AB8@Mark.Com>



Tom Phoenix wrote:

> On Wed, 15 Sep 1999, Mark wrote:
>
> > > My friends Fred and Barney would like you to write to them at this
> > > (valid) address:
> > >
> > >     <"fred and barney"(.@..@,,)@redcat.com>
> >
> > Bad and all as the check is, it does look for double @'s so this
> > address would fail.
>
> That's my point; the address is valid.
>

Sorry, I thought you implied that it was invalid, which if it was, which it
isn't you say, then the RE would have caught it, which it did, althought it
shouldn't have...maybe?

Anyway, to hell with it. The check is crap (which was my point) and it is
pointless trying to decide between it getting right ones wrong and wrong
ones right.

- Mark





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

Date: Thu, 16 Sep 1999 09:47:38 GMT
From: c_j_marshall@my-deja.com
Subject: Is there any CTlib.pm documentation ?
Message-Id: <7rqebo$1b1$1@nnrp1.deja.com>

Hi - can anyone please point me in the direction of some
documentation/faq for the CTlib module for Sybase access from Perl?

Cheers,
Chris


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 16 Sep 1999 18:38:09 +0800
From: Andriani Siau <andriani@singnet.com.sg>
To: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Link CGI to microsoft Access
Message-Id: <37E0C890.E2C0C54B@singnet.com.sg>

i tried to save my data that i get from the  form submission. After i read
and parse the data , i want to store to database using this following
command

 $sql = "INSERT INTO test_table (name, password) VALUES
($form{'name'},'$form{'password'}')";
   $db->Sql($sql);
how to insert the variable data to database ????

i  run the program . i got error message. can you help me
sorry for disturbing you
thank you in advance
bye

andriani


Bob Walton wrote:

> Andriani Siau wrote:
>
> > anyone know how to retrieve and save data from microsoft access using
> > perl.
> > Thank you in advance.
> >
> > bye
> > andriani
>
> Here is one way, courtesy of the perl2exe folks.  Works in CGI scripts,
> too.
>
> # ODBC test program
>
> # Seting up an ODBC database
>
> #a) Click Settings/ControlPanel
> #b) Click 32-Bit ODBC
> #c) Select "System DSN" tab
> #d) Click Add, select "Microsoft Access Driver", click Finish
> #e) Enter the following properties
> #   Data Source Name:  test_dsn  (This is the most important field)
> #   Description: Anything
> #f) Click on Create... and choose a filename, eg. c:\database\test.mdb
> #g) Next time Click on Select ... and choose a filename, eg.
> c:\database\test.mdb
>
> use Win32::ODBC;
>
> &insertData;
> &getData;
>
> exit(0);
>
> sub insertData {
>    $dsn = "test_dsn";
>
>    $db = new Win32::ODBC($dsn);
>    die "ERROR: Failed to open database\n" if(!$db);
>
>    $sql = "CREATE TABLE test_table (";
>    $sql .= "id char(02), ";
>    $sql .= "name char(04), ";
>    $sql .= "city char(03) )";
>
>     $db->Sql($sql);
>    ($ErrNum, $ErrText, $ErrConn) = $db->Error();
>
>    $sql = "DELETE FROM test_table";
>    $db->Sql($sql);
>
>    $sql = "INSERT INTO test_table (id, name, city) VALUES ('01', 'Jack',
> 'NY')";
>    $db->Sql($sql);
>
>    $sql = "INSERT INTO test_table (id, name, city) VALUES ('02', 'John',
> 'Lon')";
>    $db->Sql($sql);
>
>    $sql = "INSERT INTO test_table (id, name, city) VALUES ('03', 'Mike',
> 'HK')";
>    $db->Sql($sql);
>
>    $sql = "INSERT INTO test_table (id, name, city) VALUES ('04', 'Carl',
> 'LA')";
>    $db->Sql($sql);
> }
>
> sub getData {
>
>    $sql = "SELECT * from test_table order by id";
>
>    $db->Sql($sql);
>    while ($db->FetchRow()) {
>       ($id, $name, $city) = $db->Data("id", "name", "city");
>       print $id, " - ", $name, " - ", $city, "\n";
>    }
>    $db->Close();
> }
>
> --
> Bob Walton





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

Date: Thu, 16 Sep 1999 18:40:06 +0800
From: Andriani Siau <andriani@singnet.com.sg>
To: Clinton Carr <ccarr@websocket.com>
Subject: Re: Link CGI to microsoft Access
Message-Id: <37E0C905.FC9CFFF4@singnet.com.sg>

sorry, i am not using UNIX. i just run on my PC.
thanks

Clinton Carr wrote:

> If you are searching for an UNIX to Wintel solution then I developed two
> approaches.  One is an Internet database server (IDBS) and the other uses
> an ASP page for database accesses.  Both options include a Perl object
> that runs on the client, UNIX in this case, and handles the
> communications and data transfers.
>
> Let me know if you are interested.
>
> Clinton
>
> Andriani Siau wrote:
>
> > anyone know how to retrieve and save data from microsoft access using
> > perl.
> > Thank you in advance.
> >
> > bye
> > andriani





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

Date: 16 Sep 1999 11:37:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Link CGI to microsoft Access
Message-Id: <37e0c851_1@newsread3.dircon.co.uk>

Andriani Siau <andriani@singnet.com.sg> wrote:
> i tried to save my data that i get from the  form submission. After i read
> and parse the data , i want to store to database using this following
> command
> 
>  $sql = "INSERT INTO test_table (name, password) VALUES
> ($form{'name'},'$form{'password'}')";
>    $db->Sql($sql);
> how to insert the variable data to database ????
> 
> i  run the program . i got error message. can you help me

And the error message is ?

/J\
-- 
"It's easier for a man to enter a camel is he stands on a box" -
Jonathan Creek


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

Date: Thu, 16 Sep 1999 11:49:33 +0200
From: "Todd A. Wood" <noreply@address.com>
Subject: Re: need to write www search engine
Message-Id: <37E0BD2D.CE803793@address.com>

Roger Jacques wrote:
> 
> I want to write a robot program that will search all www sites by
> domain type and return the <title>.
> 
> For example I want to pull into a two column database the <title>s
> and URL's of all .gov sites.
> 

Step #1: Forget Perl, DNS, HTTP and read on being a responsible
         robot developer.

http://info.webcrawler.com/mak/projects/robots/robots.html

Step #2: After reading the above URL... pick a new project.

A search engine based on url's and titles seems like a waste of
your time and everyone's internet resources.

What business case could be met with this project?  To follow
your line of thought - an index of url and <meta keywords> might
be more useful.  This to would be a waste.

Play with some Perl LWP and search http://www.altavista.com with
a search criteria of "url:.gov".

I am positive that altavista's robot is better than anything you could
hatch.

Todd.


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

Date: Thu, 16 Sep 1999 11:19:27 +0100
From: "Martin" <contact@citizenz.org>
Subject: Re: need to write www search engine
Message-Id: <Vs3E3.519$cm.14933@wards>

Ok, well I'm doing something similar BUT (before you all throw your hands up
in the air) I'm doing it on the following basis:

1. The topic area is minute in comparison to the web itself
2. The submissions are spidered and receive a score which will kill the site
spider within a set number of pages if nothing relevant to the topic comes
up.
3. Again porn, MLM content will kill the spidering process for a given site
4. Any links to external sites are referred for spidering by a human admin
so that obvious no use sites are screened out.
5. The indexed throws out a LOT of words that are non essential which means
the site is not natural language capable as such but those same words can be
screened out of queries to avoid bollixed searches.


I'm not denying that it's an absolute pig to write and I'm probably right in
noting that resources will be a problem but I'd recommend sincerely that
anyone tackling this issue visit the following site:
http://www.searchtools.com/
It's a useful starting block, but you will need to develop all manner of
skills in Perl, LWP, DBI and an SQL database to get it to work at all...

Don't be dissuaded but for gods sake start small!!!

All the best

Martin
------
contact@websnail.org


Todd A. Wood <noreply@address.com> wrote in message
news:37E0BD2D.CE803793@address.com...
> Roger Jacques wrote:
> >
> > I want to write a robot program that will search all www sites by
> > domain type and return the <title>.
> >
> > For example I want to pull into a two column database the <title>s
> > and URL's of all .gov sites.
> >
>
> Step #1: Forget Perl, DNS, HTTP and read on being a responsible
>          robot developer.
>
> http://info.webcrawler.com/mak/projects/robots/robots.html
>
> Step #2: After reading the above URL... pick a new project.
>
> A search engine based on url's and titles seems like a waste of
> your time and everyone's internet resources.
>
> What business case could be met with this project?  To follow
> your line of thought - an index of url and <meta keywords> might
> be more useful.  This to would be a waste.
>
> Play with some Perl LWP and search http://www.altavista.com with
> a search criteria of "url:.gov".
>
> I am positive that altavista's robot is better than anything you could
> hatch.
>
> Todd.




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

Date: Thu, 16 Sep 1999 10:15:35 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Parsing Tab Delimited File
Message-Id: <br3E3.16887$m4.69065090@news.magma.ca>

<brian_fredette@vnet.ibm.com> wrote in:
news:7ro7uu$dge$1@nnrp1.deja.com...
>
> I'm having some trouble finding information on how to parse a tab
> delimited text file.  Any pointers would be appreciated.
>
You may want to take a look at:
http://search.cpan.org/search?module=Text::CSV_XS
Neither regexps nor split are particularly useful for simple things like
parsing csv files, so this extension module is exactly the right thing
to use.




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

Date: 16 Sep 1999 09:16:03 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: passing "=" as an argument to CGI
Message-Id: <37e0a743_1@newsread3.dircon.co.uk>


Larry Rosler <lr@hpl.hp.com> wrote:
> [Posted and a courtesy copy mailed.]
> 
> In article <7rp43h$11f$1@gellyfish.btinternet.com> on 15 Sep 1999 
> 21:46:25 -0000, Jonathan Stowe <gellyfish@gellyfish.com> says...
>> On Wed, 15 Sep 1999 20:30:19 GMT stampede wrote:
>> > is there a way to pass an "=" as an argument to CGI?
>> > 
>> > e.g.,
>> > 
>> > http://www.foo.org/perl.cgi?url=http://www.foo.com/perl.cgi?x=y
> 
> That second '?' should be an '&'.
> 

I'm not sure see later ...

> But it's not clear why one wants to duplicate in 'url' a value that can 
> be accessed by CGI::script_name() or $ENV{SCRIPT_NAME}.
> 

But it isnt - I assumed that foo.com wasnt merely a braino there.

>> > so that foo.com/perl.cgi processes the value "y" as param('x')?
>> 
>> I'm not sure what you mean ...
>> 
>> If you mean that you want to post that second URL as a parameter to
>> the first CGI program then you will want to encode it like:
>> 

<snip URL encoding>

> 
> Yes, it will hurt.  It is destructive.  The parser will see the escaped 
> '?' (which should be '&' as stated above) and '=' as part of the data, 
> rather than as separators.  They must be there literally.
> 

That is the point.  I think that he *may* have been wanting to pass all
of the second URL *including the parameters* as a parameter to the first
CGI program - in which case the '?' before 'x=y' is part of the data
and therefore must be escaped.

Of course this is second guessing the original poster and I did say I wasnt
sure what he meant :)

/J\
-- 
"I'm not Carol Vorderman - you wouldn't see me getting drunk in a kebab
shop" - Lily Savage


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

Date: Thu, 16 Sep 1999 07:56:52 GMT
From: makau@my-deja.com
Subject: Re: Please help a newbie! - sorry for the mistake!
Message-Id: <7rq7s0$t0v$1@nnrp1.deja.com>


> But still worth improvement.
> You certainly didn't test it at all before posting it.

Yep, i didn't.
I thought it would work.
But seems it doesn't? :-(

> Why do you accumulate the output strings here instead of just printing
> them out a line at a time?

Because I wanted the code to be as clear as possible.
I am not a one-liner. Far from that.

> >         while (<INPUT>) {
> >                 m!^(.{180})(\d{2})(\d{2})(\d{2})(.*)!;
>
> What happens if the data are faulty and this match fails?

If the data is faulty, it's not my fault :)
The guy said all the lines used this format.

> >                 $data .= "$1$2/$3/$4$5";
>
> Where, oh, where, has my little newline gone?

Oups... I thought the pattern matching caught it!
Yeah, I should have written $data .= "$1$2/$3/$4$5\n"

> WHY, oh why, do you quote the whole article, *after* your response to
> it?

1- The more interesting part is the reply, NOT the former post.
2- Because it takes on one's nerves to scroll the original post down to
the reply (when the original post is indeed put before the reply).

Ain't I right?

Bye bye.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 16 Sep 1999 08:38:31 GMT
From: makau@multimania.com
Subject: Re: Please help a newbie!
Message-Id: <7rqaa6$uk1$1@nnrp1.deja.com>

Seems some people are much too serious here :-)

In fact, I did right an incorrect code on purpose! It was to test the
reactivity of the group and to know if you would flame me or not...

Indeed, any newbie knowing what regexps are would have noticed the
incorrect matches. I tried to make the irony of that post even more
obvious by inserting "print 'Makau is a great coder'" at the end of the
example code. But you didn't notice it either :-(

Anyways, I am greatly surprised that you, contributors of CLPM, did
neither flame me, nor take a lot of time to correct my mistakes.

I have posted the CORRECT sample code in another thread.
The only mistake to it is that I put something like :

$data = "$1$2/$3/$4$5"
instead of
$data = "$1$2/$3/$4$5\n"

Hope you understand much better now :)

And all my excuses to whom took my post too seriously!
Like I said, a new member of this group, I wanted to test its general
"atmosphear".

Once more sorry dudes.

Makau.

> >#!/usr/local/perl -w
>
> Your Perl is where?  Good -w.
>
> >use strict;
>
> Good for you.
>
> >open (FILE,"./file.txt");
> >while (<FILE>) {
> >	print FILE s!^.{180}(\d{2})(\d{2})(\d{2}).*!$1/$2/$3!;
>
> 0. You forgot to check for errors on opening FILE.
> 1. You're deleting the first 180 characters on each line, and
>    everything after the date, too.  This was not what the poster
asked.
> 2. You're trying to write to a filehandle opened for reading.  That
>    doesn't work.
> 3. The return value of s/// is not the modified string.  It is the
number
>    of substitutions made.  This will try to output '1' or '0' to the
file.
> 4. If all of the above bugs were fixed, you'd be overwriting the next
>    record in the file with the expanded version of the current record.
>
> Also, it's likely that the input data doesn't have newlines in it.
> We'd probably need to use read instead of <>.
>
> >};
>
> This semicolon doesn't belong here.
>
> >close (FILE);
> >
> >print "Makau is a great coder\n";
>
> Great coders verify that they understand the specification, and then
> they test their code.  It's been a while since I saw a program with
six
> bugs in six lines of code.
>
> >Have a nice day.
> >
> >Makau.
> >
> >In article <7rokdr$ndp$1@nnrp1.deja.com>,
> >  sg95m476@dunx1.ocs.drexel.edu wrote:
> > [Makau quotes entire post he's replying to, like an inconsiderate
boor]
>
> Wow.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 16 Sep 1999 19:40:03 +1000
From: "Stewart Pitt" <stewart@xcs.com.au>
Subject: Re: Reading files on a remote server ????????
Message-Id: <937474566.706532@diddley.primus.com.au>

All this is great but does any one have some code examples?


Kragen Sitaker <kragen@dnaco.net> wrote in message
news:jhrD3.9856$N77.766753@typ11.nn.bcandid.com...
> In article <937306569.498055@diddley.primus.com.au>,
> Stewart Pitt <stewart@xcs.com.au> wrote:
> >Apologies for being a bit vague in my initial message.
> >
> >What I want to do is execute a perl script on my local server that opens
and
> >file on a remote server for either read, write or append.  Then perform
> >actions against the file while it still resides on the remote server.
>
> There are several protocols that will let you do this: NFS, SMB, HTTP
> (with DAV), FTP, Netware's filesystem protocol, etc.  You can probably
> use any of them from Perl.
>
> Kragen
> --
> <kragen@pobox.com>       Kragen Sitaker
<http://www.pobox.com/~kragen/>
> Mon Sep 13 1999
> 56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
> <URL:http://www.pobox.com/~kragen/bubble.html>




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

Date: 16 Sep 1999 11:03:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Reading files on a remote server ????????
Message-Id: <37e0c05d_2@newsread3.dircon.co.uk>

Stewart Pitt <stewart@xcs.com.au> wrote:
> Kragen Sitaker <kragen@dnaco.net> wrote in message
> news:jhrD3.9856$N77.766753@typ11.nn.bcandid.com...
>> In article <937306569.498055@diddley.primus.com.au>,
>> Stewart Pitt <stewart@xcs.com.au> wrote:
>> >Apologies for being a bit vague in my initial message.
>> >
>> >What I want to do is execute a perl script on my local server that opens
> and
>> >file on a remote server for either read, write or append.  Then perform
>> >actions against the file while it still resides on the remote server.
>>
>> There are several protocols that will let you do this: NFS, SMB, HTTP
>> (with DAV), FTP, Netware's filesystem protocol, etc.  You can probably
>> use any of them from Perl.
>>
> 
> All this is great but does any one have some code examples?
> 
> 

Examples of what ?

To do what you require you will be using NFS, SMB or NCB i.e. some
remote filsystem protocol - if youre system is using one of these protocols
then you will be able to open a remote file that you permission to
access just as if it was a local file ...  If you are not using some file
sharing protocol then you will need to think more carefully about what
you want ...

Of course question about filesharing protocols are not on-topic in this
group.

/J\
-- 
"Conservatives have called on Sports Minister, Tony Banks, to resign
after calling William Hague a foetus" - BBC News Website


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

Date: 16 Sep 1999 09:26:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: script to dynamically produce standard calender
Message-Id: <37e0a9b0_1@newsread3.dircon.co.uk>

Kragen Sitaker <kragen@dnaco.net> wrote:
> In article <7rp0ko$pc$1@gellyfish.btinternet.com>,
> Jonathan Stowe  <gellyfish@gellyfish.com> wrote:
>>or at least started something like this and so I had - truly awful it is
>>too - 
> 
>>
>>if ((@fields = date_query($query_date)) > 0 )
> 
> What is date_query supposed to do?
> 

Er ...

sub date_query
{
  my $query_date = shift;

  #
  # do something that will return a LoL
  #

  return ();
}

 ... nothing.  The original code stored some data in a MySQL DB and
as that wasnt part of what the original poster wanted I substituted
an empty sub in place of the fetchrow ...

/J\
-- 
"Philippa Forrester, presenter and would-be Smurf" - Howard Stableford,
Tomorrow's World


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

Date: Wed, 15 Sep 1999 22:42:42 -0400
From: "Nicholas Dragotas" <Nicholas.Dragotas@Motorola.com>
Subject: Re: Searching subdirs with unknown names in known dirs.
Message-Id: <7rplf4$8v4$1@schbbs.mot.com>

You could use "opendir", "readdir" and the "-d"

I am writing the following as an example.  I have not tested this code, so
it may have a typo.  You should be able to get an idea and refer to a
reference book for more:

opendir(SOMEHANDLE, '.');                            #Current dir
@FilesInDir = readdir(SOMEHANDLE);            # Dir contents loaded in this
list

foreach $file (@FilesInDir) {                             # Go over each
element
  if (-d $file) {                                                  # Here we
have a directory
    push(@SubdirsInDir, $file);                         # add the dir in a
new list
  }
}

The @SubdirsInDir list should have all directories.

Regards,

Nicholas


Joe frey wrote in message <37DB4658.E9C2780D@bon.net>...
>Hello, I'm using the find module to search for files in a known dir. By
>known I mean I know the name. Users are supposed to put their files
>here. Sometimes my users create subdirs in the known dir and place their
>files there. How do I search for the subdir name? TIA. Joe.
>
>




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

Date: Thu, 16 Sep 1999 08:11:49 GMT
From: SANFACE Software <sanface@sanface.com>
Subject: SHAREWARE: txt2pdf 2.3
Message-Id: <7rq8nv$tfr$1@nnrp1.deja.com>

txt2pdf is a very flexible and powerful PERL5 program (5 penguins rate
at LinuxBerg).
It's a converter from text files to PDF format files.
Why do you need txt2pdf?
Most of your documents are text files (e.g. HTML, C source, C++ source,
PERL source, ...)
Inside your DBs you have textual information
txt2pdf is a PERL5 script, so you can use it in every operating systems
supported by PERL5 (View the list of OS tested)
txt2pdf is a native converter, you don't need to pass through
PostScript format
txt2pdf is specific for text to PDF conversion, so
you can mark yellow, red, green, blue or bold, italic,
bolditalic (with PERL regular expression) words in theproduced PDF
files you can produce a 2-columns PDFyou can add page number in every
page you can add text at the beginning and at the end ofevery file
you can add a border to every page
every word like http://... ftp://... mailto:... https://...
file:... ldap:... news:...  will become an URL
every word like mime:... will become a link that launch the correct
application and opens the file
you can use a few parse commands (e.g.[!blue]...[!/blue])
the fee for every licence is only $25
SANFACE Software is going to give you a free licence for every good
idea or for every good modify

txt2pdf is shareware
The txt2pdf source code is our company core business.We trust you.
You can test text2pdf and modify it.
You can't use a modify version of txt2pdf for production purpose.
You can't resell txt2pdf or a modify version of it without SANFACE
Software authorization.
You can't copy part of it to include in your source without SANFACE
Software authorization.

What's new in this version

txt2pdf is able to handle ascii or latin1 documents formatted for
typewriter-like devices. These texts (as e.g. produced by
"groff -Tlatin1") contain bold characters represented by the sequence
'CHARACTER BACKSPACE CHARACTER' and italics using the sequence
'_ BACKSPACE CHARACTER'. Reverse ('ESC-7') and half reverse ('ESC-8')
line feeds are unusual but could appear in rare cases.
They should be removed prior to processing with txt2pdf.[from Soenke J.
Peters]

OpenVMS support [from Dave Smith]

Documentation about Year 2000 Compliance

Test txt2pdf 2.3!

You can find it at our new site http://www.sanface.com

--
SANFACE Software
http://www.sanface.com
mailto:sanface@sanface.com


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 16 Sep 1999 09:30:15 GMT
From: scarblac-spamtrap@pino.selwerd.cx (Remco Gerlich)
Subject: Re: Splitting a line and honoring "strings"
Message-Id: <slrn7u1dur.95k.scarblac-spamtrap@flits104-37.flits.rug.nl>

Lokesh Setia <nospam@hss.hns.com> wrote:
> The user enters:
> yellow brown black green blue
> 
> This line would be splitted into an array of 5 elements by,
> @line = split ' ', $line;
> 
> What I want is to honor the quotes "" and '' withing the user line
> so that the user can embed spaces in the values: like,
> 
> blue "light pink" "dark blue" green 'navy blue'
> 
> Is there an inbuilt perl function that would help me achieve this?

See perlfaq4, "How can I split a [character] delimited string except
 when inside [character]? (Comma-separated files)".
 
There's a simple solution in the standard Text::Parsewords module.


-- 
Remco Gerlich,  scarblac@pino.selwerd.cx
  Murphy's Rules, "Maybe they just think fast":
   Although every character in Blade's Mercenaries, Spies & Private Eyes
   has 'Speed' attribute, there are no rules for movement.


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


------------------------------
End of Perl-Users Digest V9 Issue 816
*************************************


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