Single file access through multiple perl programmes

--===============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
<br><hr align="left" width="300">
View this message in context: Single file access through multiple perl programmes<br>
Sent from the Perl - ActivePerl mailing list archive at Nabble.com.<br>

------=_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0670034658==--
Sattapattu [ Fr, 29 August 2008 22:40 ] [ ID #1966359 ]

Re: Single file access through multiple perl programmes

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Sattapattu [ Fr, 29 August 2008 23:11 ] [ ID #1966360 ]

Re: Single file access through multiple perl programmes

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lyle [ Sa, 30 August 2008 04:31 ] [ ID #1966494 ]

Re: Single file access through multiple perl programmes

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Bill Luebkert [ Sa, 30 August 2008 04:53 ] [ ID #1966495 ]

RE: Single file access through multiple perl programmes

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
HBullock [ Sa, 30 August 2008 14:02 ] [ ID #1966496 ]

Re: Single file access through multiple perl programmes

> 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 [at] 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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Andy_Bach [ Mo, 01 September 2008 21:23 ] [ ID #1966743 ]

Re: Single file access through multiple perl programmes

--===============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, <Andy_Bach [at] wiwb.uscourts.gov> 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

<div dir="ltr">W<br><br><div class="gmail_quote">On Mon, Sep 1, 2008 at 3:23 PM, <span dir="ltr"><Andy_Bach [at] wiwb.uscourts.gov></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> What i am trying to do is,i have to run multiple perl programmes all at<br>
once<br>
to change the contents of a text file. and the text file would contain 2<br>
things. Test name and status.<br>
<br>
Yeah, I'd say this is more a computer science/methodology question, rather<br>
than a perl code question.  Using a single flat file for this is probably<br>
the least effective solution.  You'll be doing all the locks, access,<br>
update work yourself and likely running into unexpected results. A database<br>
(even something like sqlite) will do this much better </blockquote><div><br>Boy, I couldn't agree with this more.  This really is a job for a database. <br></div></div><br>-- <br>--Geoff<br>Cell: (313)506-7295<br>Sterling Heights CERT<br>
'04 Grand Cherokee | '05 Town & Country<br>http://www.moparmailinglist.com<br>
</div>

------=_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1715951318==--
geoff [ Di, 02 September 2008 19:19 ] [ ID #1966957 ]

ActivePerl on IIS 7

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
John Hornbuckle [ Di, 02 September 2008 20:06 ] [ ID #1966958 ]

Re: ActivePerl on IIS 7

--===============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

<div dir="ltr"><div>Hi </div>
<div> </div>
<div>This is a very short and useful information on how to install ActivePerl on IIS7</div>
<div> </div>
<div> http://www.freenetbuilders.com/index.php?option=com_content& amp;task=view&id=52&Itemid=54</div>

<div><br><br>-- <br>Moshe Sharon<br>http://www.centerity.com<br></div></div>

------=_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1755273504==--
moshe sharon [ So, 21 September 2008 23:57 ] [ ID #1969946 ]
Perl » gmane.comp.lang.perl.active-perl » Single file access through multiple perl programmes

Vorheriges Thema: Error after 5.8.8 load - wxmsw28_core_vc_custom.dll was not found.
Nächstes Thema: Connecting to Database as sysadmin using DBI