[Perl-unix-users] Setting Unlimited CORE Size - Howto?

2005-05-23 Thread Arijit Das
Hi, Does any body knows how to specify a unlimited core size in PERL? I know of using this command, $coresize = pack("i2",0,0); syscall(&SYS_setrlimit, &RLIMIT_CORE, $coresize); but the issue is I couldn't find anywhere how exactly should I specify and unlimited CORE size in it? Any help is

[Perl-unix-users] Checking Perl Module installed - How?

2005-07-27 Thread Arijit Das
Hi,   How can I check if a Perl Module is installed in my System from a Perl Program?   I want to do something like this:   #!/usr/local/bin/perl   if () {     use Quota; }     Any help is appreciated.   Thanks, Arijit     Start your day with Yahoo! - make it your home page _

[Perl-unix-users] Timing Out a Hanging function...how?

2005-07-28 Thread Arijit Das
How can I time out a subroutine/function? print "My code is executing...the next sub inokation takes a long time simetimes. SO, I want to ensure that at max it should take 5 secsonds."; my $device_name = Quota::getqcarg($path); I want to timeout Quota::getqcarg($path) but I don't want to use the

Re: [Perl-unix-users] Timing Out a Hanging function...how?

2005-07-28 Thread Arijit Das
ved in this subroutine > taking > a long time intermittently? > > Marty > > > --- Arijit Das <[EMAIL PROTECTED]> wrote: > > > How can I time out a subroutine/function? > > > > print "My code is executing...the next sub > inokation > > takes a

[Perl-unix-users] Sharing Variables among Processes...

2005-08-24 Thread Arijit Das
Its about sharing a Perl Variable among parent and child processes.   Do you know of any design pattern or technique by which this can be achieved?   What I want is this...   $shared_var = 10;   if ($pid = fork) {     sleep 10;     print "$shared_var\n"; # Should show the child's changes... } elsif

[Perl-unix-users] Flushing all open file descriptors...

2005-08-25 Thread Arijit Das
Is there a Perl func which, when executed, ensures that all the open file descriptors of the corresponding process are flushed immediately?   What I am looking for is this...   #!/usr/bin/perl # Open lots of files here and write some data to them but do not flush any of them... ... a

RE: [Perl-unix-users] Sharing Variables among Processes...

2005-08-25 Thread Arijit Das
Hello everybody,   Thanks a lot for all your suggesstions...   I think I should be able to solve my problem in the best possible way with one of your suggestions.   Thanks again, ArijitMatt Schneider <[EMAIL PROTECTED]> wrote: Perhaps others might know better but to the best of my knowledge the

[Perl-unix-users] Re: Flushing all open file descriptors...

2005-08-25 Thread Arijit Das
; from another non-spammer site please.) > > ----- Original Message - > From: "Arijit Das" <[EMAIL PROTECTED]> > To: ; > > Sent: Thursday, August 25, 2005 8:25 PM > Subject: Flushing all open file descriptors... > > > > Is there a Perl func which

[Perl-unix-users] Re: Flushing all open file descriptors...

2005-08-26 Thread Arijit Das
them. -Arijit --- $Bill Luebkert <[EMAIL PROTECTED]> wrote: > Arijit Das wrote: > > > Is there a Perl func which, when executed, ensures > that all the open > > file descriptors of the corresponding process are > flushed immediately? > > > > What I am l

[Perl-unix-users] Re: Flushing all open file descriptors...

2005-08-26 Thread Arijit Das
--- $Bill Luebkert <[EMAIL PROTECTED]> wrote: > Arijit Das wrote: > > > I think you are missing out here... > > Let's hope not. > > > DIsk files are always fully-buffered, STOUT is > line > > buffered and STDERR is unbuffered. > > Not

[Perl-unix-users] Anything like sh's set -x in PERL...?

2005-08-31 Thread Arijit Das
Is there anything like set -x in Boure Sheel scripts in Perl which can print all the statements as they are executed? -Arijit Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs ___

[Perl-unix-users] Filesystem Block Size...how to get?

2005-09-19 Thread Arijit Das
Given a UNIX flavor/machine, say a Linux box, I need to figure out the size of the file system block of the current file system I am working in. Generally, it is multiple of 512 but less than the page frame size...but how can I get the exact value of my current file system?   Any idea...?   Thanks,

Re: [Perl-unix-users] Filesystem Block Size...how to get?

2005-09-19 Thread Arijit Das
Thanks Bruce...Your solution was good. But unfortunately it doesn't seem to work on RH Linux 7.2 and RHAS3.0 which is what I need.   Went though its documentation.Seemed like the blksize field of the stat structure is not very portable...which is what the Linux failures proves...   -ArijitBruce

Re: [Perl-unix-users] Filesystem Block Size...how to get?

2005-09-20 Thread Arijit Das
eon RHES and 7.2use File::stat;my $file = "./blah";my $st = "";my $blocksize = 0;$st = stat($file);$blocksize = $st->blksize;print "Blocksize: [$blocksize]\n";HTHJD--- Arijit Das <[EMAIL PROTECTED]>wrote:> Thanks Bruce...Your solution was good. But> unfortunate

[Perl-unix-users] Strange Virtual memory difference...

2005-09-21 Thread Arijit Das
Look at the difference of memory usage for the same command..."sleep 200 &" in RH7.2, RH3.0 and Suse machine.   vsize gives the Virtual memory size in bytes.   RH7.2: eurika120:arijit>sleep 200 &[1] 24775eurika120:arijit>ps -eo pid,comm,size,sz,vsz,vsize | grep sleep24775 sleep    -   484 

[Perl-unix-users] Page Size -- How to get?

2005-09-22 Thread Arijit Das
As a non-superuser, any idea how can I get the page size of the underlying unix operating system?   Thanks, Arijit__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___

[Perl-unix-users] RE: Page Size -- How to get?

2005-09-23 Thread Arijit Das
ThanksI found this out this morning.   pagesize isnot supported in Linux.   Yet another way is getpagesize() function...   Thanks anywys... -ArijitBrian Raven <[EMAIL PROTECTED]> wrote: From: [EMAIL PROTECTED][mailto:[EMAIL PROTECTED] On Behalf Of ArijitDasSent: 23 September 2005 06:08To: acti

[Perl-unix-users] A tough question...

2005-09-29 Thread Arijit Das
I have a huge Software System with lots of sub-systems and processes in it.   One of my file system's folder like "/u/arijit/MySystem/log" is getting deleted unintentionally by any of these processes.   Is there a way by which I can track which process is actually deleting this folder? In other wor

[Perl-unix-users] Re: A tough question...

2005-09-29 Thread Arijit Das
Thanks a lot folks for your suggesstions   Jeff is correct...its a directory tree that gets deleted. To worsen the situation, I don't have root access to the system to do stuffs like recompiling perl binary, putting in handlers to be executed by the kernel b4 executing any unlink system call.  

[Perl-unix-users] Re: A tough question...

2005-09-30 Thread Arijit Das
It deletes everything recursively down.   Its not always the same directory but it is always the current directory (pwd)   -ArijitSteve Dawson <[EMAIL PROTECTED]> wrote: Arijit Das wrote:> > ...its a directory tree that gets deleted.Does it delete just one level or are there sub dire

[Perl-unix-users] Reopening STDOUT - howto?

2005-12-07 Thread Arijit Das
In Perl, after closing STDOUT, how can I reopen it?   print "Writing to STDOUT before closing STDOUT..."; close STDOUT;   open STDOUT, ... print "Writing back to STDOUT...";   Thanks, Arijit   Yahoo! Personals Single? There's someone we'd like you to meet. Lots of someones, actually.

[Perl-unix-users] Syntax checking in crontab

2006-01-04 Thread Arijit Das
Appologies for asking this question in a Perl forum..But I expect lots of UNIX experts here...so am posting this question.   Is there a way I can have the syntax of my crontab file checked in a Solaris System?   Basically, I have a crontab file which looks perfect to me syntactically but I get

[Perl-unix-users] Strange behaviour in Perl

2006-01-25 Thread Arijit Das
I am just wondering why is this giving a strange result. Any clues...?   bash-2.01$ echo 4.56 | perl -p -e 'my $var1 = ; $var2 = $var1 * 100;  print $var2;'04.56bash-2.01$   I am expecting 456 in the ouput instead of 4.56   Am I missing anything...?   Thanks,Arijit   Do you Yahoo!? With

Re: [Perl-unix-users] Strange behaviour in Perl

2006-01-27 Thread Arijit Das
Thanks a lot folks.   My mistake...I should have looked at "-p"'s significance before posting it.   Thanks again, ArijitDZ-Jay <[EMAIL PROTECTED]> wrote: Arijit Das wrote:> I am just wondering why is this giving a strange result. Any clues...?> This is from

[Perl-unix-users] Anything better than Signal? - For Async Procsess notification

2006-02-27 Thread Arijit Das
Hi,   I am using Perl5.04 and right now, I do not have the option of upgrading to higher versions for political reasons within the org.   With perl 5.04, if I set up a $SIG{ALRM} handler, then I have noticed that my process some times gets into an infinite sleep while handling the ALRM signal.

[Perl-unix-users] What am I doing wrong here...?

2006-03-06 Thread Arijit Das
I am just wondering...what am I doing wrong here. Why isn't "$latest_CPU_load\n" printing the desired value like $top_output[2]   Any help here?   Thanks, Arijit vgamd127> cat test.pl#!/depot/qsc/VG1.0/bin/perl @top_output = `top -n1 -b -i | head -35`;print "$top_output[2]";$latest_CPU_l

Re: Antwort: [Perl-unix-users] What am I doing wrong here...?

2006-03-06 Thread Arijit Das
Thanks a lot...   Sometimes my head gets jammed like the traffic situation in SFO and these days in Bangalore:-)   -Arijit[EMAIL PROTECTED] wrote: Hi Arijit, >I am just wondering...what am I doing wrong here. Why isn't "$latest_CPU_load\n" printing the desired value like $top_output[2]

[Perl-unix-users] Timeing Out a Command - how to?

2006-03-13 Thread Arijit Das
Is there any way to time out a unix command?   Its something like this... I want my PerlPgm to be killed by the shell (sh/bash/csh) if my PerlPgm fails to finish off by 300 elapsed seconds.   Something like   -timeout 300 might_hang.pl   This should execute might_hang.pl normally but if m

[Perl-unix-users] Need to have Message Queues accessible across NFS -- Suggestions

2006-03-29 Thread Arijit Das
I need a priority message queue which should be usable by different unrelated processes and usable/acceisible from different machines (may be using a filesystem path).   So, its like I want the behaviour of an UNIX::IPC::MsgQueue but I need visibility/accessibility like a FIFO. FIFOs can be opene

[Perl-unix-users] Pre-Dating Files Inode Modification time - howto?

2006-04-05 Thread Arijit Das
There are three type of times usually associated with a file. 1) Last File modification time 2) Last File access time 3) Last Inode Modification time.   It seems like the first two times can be pre-dated by using the touch command.   ## pre-Dating to 31-Jan-2006 touch -c -t 01311200.00 core

[Perl-unix-users] POSIX::setsid - Any issue with this?

2006-05-23 Thread Arijit Das
Any idea what am I doing wrong here...? Why isn't setsid working? Thanks, Arijit vgamd129> ./test.pl 21544: My pgid = 21544 $sess_id = -1 vgamd129> cat test.pl #!/depot/qsc/VG1.0/bin/perl use POSIX; setpgrp($$, $$); $gpid = getpgrp(); print "$$: My pgid = $gpid\n"; $sess_id = POSIX::setsid(

[Perl-unix-users] Re: POSIX::setsid - Any issue with this?

2006-05-23 Thread Arijit Das
Ooops ... my mistake! A session creator shdn't be a process group leader. Thanks anyways, Arijit --- Arijit Das <[EMAIL PROTECTED]> wrote: > Any idea what am I doing wrong here...? Why isn't > setsid working? > > Thanks, > Arijit > > vgamd129> ./test

[Perl-unix-users] How to modify $ENV{PATH} portably?

2006-05-30 Thread Arijit Das
Hi, The format of env variable PATH seems to change with OS/shell. For example, in sh it is like "/dir1/bin:/dir2/bin:." while in csh, it is like (/dir1/bin /dir2/bin .) I need to search for "/dir2/bin" path component in my $ENV{PATH}, and then, insert "/newpath/bin" just before "/dir2/bin"

[Perl-unix-users] Debugging Perl Code Dynamically - howto?

2006-07-10 Thread Arijit Das
I have a huge perl script of which I want to get the execution trace (PERLDB_OPTS='NonStop AutoTrace LineInfo=execution_trace.out') of say just a single subroutine "sub init()". I cannot have my PERLDB_OPTS set to 'NonStop AutoTrace LineInfo=execution_trace.out' right from the begining because th