Single file access through multiple perl programmes

Single file access through multiple perl programmes

am 29.08.2008 22:40:23 von Sattapattu

--===============0670034658==
Content-Type: multipart/alternative;
boundary="----=_Part_60009_3760752.1220042423687"

------=_Part_60009_3760752.1220042423687
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hi All,
I have a query in Perl. IS it possible for me to access and modify a single
text file through PERL programmes. Can you please provide pointers on how to
achieve this.

Regards,
SSK
--
View this message in context: http://www.nabble.com/Single-file-access-through-multiple-pe rl-programmes-tp19227032p19227032.html
Sent from the Perl - ActivePerl mailing list archive at Nabble.com.

------=_Part_60009_3760752.1220042423687
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hi All,
I have a query in Perl. IS it possible for me to access and modify a single text file through PERL programmes. Can you please provide pointers on how to achieve this.

Regards,
SSK



View this message in context:

Sent from the at Nabble.com.


------=_Part_60009_3760752.1220042423687--


--===============0670034658==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0670034658==--

Re: Single file access through multiple perl programmes

am 29.08.2008 23:11:27 von Sattapattu

Thanks A,

My mistake, Apologies and suggestions considered. Let me give you all a
brief scenario of what my intentions are.

What i am trying to do is,i have to run multiple perl programmes all at once
to change the contents of a text file. and the text file would contain 2
things. Test name and status. So as i run multiple perl programmes, i want
each prgm to read single line at once and check the status. if the status is
pending , change status to inprogress execute that line, and then change the
status to done and come out of the programme, else skip to the next line
till it finds pending. Just wanted to make sure, this would give access
denied error, as the file would be used by another programmes.

Hope that helps.

SSK

Hi All,
I have a query in Perl. IS it possible for me to access and modify a single
text file through PERL programmes. Can you please provide pointers on how to
achieve this.

Regards,
SSK


--
View this message in context: http://www.nabble.com/Single-file-access-through-multiple-pe rl-programmes-tp19227032p19227516.html
Sent from the Perl - ActivePerl mailing list archive at Nabble.com.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Single file access through multiple perl programmes

am 30.08.2008 04:31:29 von lyle

Sattapattu wrote:
> Thanks A,
>
> My mistake, Apologies and suggestions considered. Let me give you all a
> brief scenario of what my intentions are.
>
> What i am trying to do is,i have to run multiple perl programmes all at once
> to change the contents of a text file. and the text file would contain 2
> things. Test name and status. So as i run multiple perl programmes, i want
> each prgm to read single line at once and check the status. if the status is
> pending , change status to inprogress execute that line, and then change the
> status to done and come out of the programme, else skip to the next line
> till it finds pending. Just wanted to make sure, this would give access
> denied error, as the file would be used by another programmes

All depends on the file locking and how you are opening the file to
read/write. On windows the locking is automatic i'm pretty sure), so it
depends on how you are opening the file.
http://perldoc.perl.org/functions/open.html
Would probably be a good read.


Lyle

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Single file access through multiple perl programmes

am 30.08.2008 04:53:30 von Bill Luebkert

Lyle wrote:
> Sattapattu wrote:
>>
>> What i am trying to do is,i have to run multiple perl programmes all at once
>> to change the contents of a text file. and the text file would contain 2
>> things. Test name and status. So as i run multiple perl programmes, i want
>> each prgm to read single line at once and check the status. if the status is
>> pending , change status to inprogress execute that line, and then change the
>> status to done and come out of the programme, else skip to the next line
>> till it finds pending. Just wanted to make sure, this would give access
>> denied error, as the file would be used by another programmes
>
> All depends on the file locking and how you are opening the file to
> read/write. On windows the locking is automatic i'm pretty sure), so it
> depends on how you are opening the file.
> http://perldoc.perl.org/functions/open.html
> Would probably be a good read.

Here's another:
Win32::SharedFileOpen

You could also consider some sort of SQL updating of a DB which would
serialize the updates for you.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Single file access through multiple perl programmes

am 30.08.2008 14:02:52 von HBullock

SSK wrote:

What i am trying to do is,i have to run multiple perl programmes all at
once
to change the contents of a text file.
-------------

As I see it you should build intelligence into your programs so that on
one active program attempts open/read/write to the file at a time. If
you are on a Win32 platform look into Win32::Semaphore and Win32::Mutex.
I have successfully accomplished a similar task having many child
processes logging to a common parent process log file using Win32::Mutex
as a way for the process to determine if another is currently using the
file.

Also there is also flock to apply your own file lock.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Single file access through multiple perl programmes

am 01.09.2008 21:23:38 von Andy_Bach

> What i am trying to do is,i have to run multiple perl programmes all at
once
to change the contents of a text file. and the text file would contain 2
things. Test name and status.

Yeah, I'd say this is more a computer science/methodology question, rather
than a perl code question. Using a single flat file for this is probably
the least effective solution. You'll be doing all the locks, access,
update work yourself and likely running into unexpected results. A database
(even something like sqlite) will do this much better and avoid reinventing
20 wheels. But that's a different point.

The Perl Cookbook does have a section on this sort of file locking/shared
access you might want to read over. As long as all your scripts behave and
such, you can do it w/ a single file but ...

a

a
-------------------
Andy Bach
Systems Mangler
Internet: andy_bach@wiwb.uscourts.gov
Voice: (608) 261-5738 Fax: 264-5932

Don't get suckered in by the comments -- they can be terribly misleading.
Debug only code.
-- Dave Storer

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Single file access through multiple perl programmes

am 02.09.2008 19:19:41 von geoff

--===============1715951318==
Content-Type: multipart/alternative;
boundary="----=_Part_8375_23013006.1220375981775"

------=_Part_8375_23013006.1220375981775
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

W

On Mon, Sep 1, 2008 at 3:23 PM, wrote:

> > What i am trying to do is,i have to run multiple perl programmes all at
> once
> to change the contents of a text file. and the text file would contain 2
> things. Test name and status.
>
> Yeah, I'd say this is more a computer science/methodology question, rather
> than a perl code question. Using a single flat file for this is probably
> the least effective solution. You'll be doing all the locks, access,
> update work yourself and likely running into unexpected results. A database
> (even something like sqlite) will do this much better


Boy, I couldn't agree with this more. This really is a job for a database.

--
--Geoff
Cell: (313)506-7295
Sterling Heights CERT
'04 Grand Cherokee | '05 Town & Country
http://www.moparmailinglist.com

------=_Part_8375_23013006.1220375981775
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

W

On Mon, Sep 1, 2008 at 3:23 PM, <> wrote:

> What i am trying to do is,i have to run multiple perl programmes all at

once

to change the contents of a text file. and the text file would contain 2

things. Test name and status.



Yeah, I'd say this is more a computer science/methodology question, rather

than a perl code question.  Using a single flat file for this is probably

the least effective solution.  You'll be doing all the locks, access,

update work yourself and likely running into unexpected results. A database

(even something like sqlite) will do this much better

Boy, I couldn't agree with this more.  This really is a job for a database.

--
--Geoff
Cell: (313)506-7295
Sterling Heights CERT

'04 Grand Cherokee | '05 Town & Country




------=_Part_8375_23013006.1220375981775--

--===============1715951318==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1715951318==--

ActivePerl on IIS 7

am 02.09.2008 20:06:59 von John Hornbuckle

Is there a definitive guide to installing ActivePerl on a Server 2008 / IIS 7 box? I found a few web postings, but nothing I can get to work for me. After installing ActivePerl 5.10, I noticed that no DLL files (e.g., perlis.dll) seemed to have been installed. I found some references to making IIS 7 work with Perl.exe, but that doesn't seem like the way to go. My understanding is that you want to use the .dll method for security and performance reasons.

I'm not a programmer, nor do I know all that much about Perl. But I was able to get my ActivePerl installation and scripts working on my Windows Server 2003 / IIS 6 box pretty easily several years ago, and NT 4 before that.



John Hornbuckle
MIS Department
Taylor County School District
318 North Clark Street
Perry, FL 32347

www.taylor.k12.fl.us

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: ActivePerl on IIS 7

am 21.09.2008 23:57:03 von moshe sharon

--===============1755273504==
Content-Type: multipart/alternative;
boundary="----=_Part_42469_2420116.1222034223852"

------=_Part_42469_2420116.1222034223852
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi

This is a very short and useful information on how to install ActivePerl on
IIS7

http://www.freenetbuilders.com/index.php?option=com_content& task=view&id=52&Itemid=54


--
Moshe Sharon
http://www.centerity.com

------=_Part_42469_2420116.1222034223852
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi

 

This is a very short and useful information on how to install ActivePerl on IIS7

 





--
Moshe Sharon



------=_Part_42469_2420116.1222034223852--

--===============1755273504==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1755273504==--