[Perl-unix-users] Setting Unlimited CORE Size - Howto?
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 appreciated. Thanks, Arijit __ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/ ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Checking Perl Module installed - How?
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 mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Timing Out a Hanging function...how?
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 $SIG{ALRM} technique because I am using a older version of Perl which doesn't support safe/defferred signals. Is there any other technique by which I can achive this timeout? Thanks, Arijit Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: [Perl-unix-users] Timing Out a Hanging function...how?
No I don't have any control of the subroutine because thatz inside a module called Quota -Arijit world.com> wrote: > Hi Arijit, > > As far as I'm aware SIGnals are the only generic > mechanism you can use to jump out of code from any > point of execution... > > So without knowing the contents of the subroutine > you're running it's not easy to suggest a way for it > to work. Perhaps you could post that subroutine? > > Is it doing any 'blocking' activities? Coudl there > be > an external factor involved 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 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 $SIG{ALRM} technique because I am > > using a older version of Perl which doesn't > support > > safe/defferred signals. > > > > Is there any other technique by which I can achive > > this timeout? > > > > Thanks, > > Arijit > > > > > > > > > > > Start your day with Yahoo! - make it your home > page > > http://www.yahoo.com/r/hs > > > > ___ > > Perl-Unix-Users mailing list > > Perl-Unix-Users@listserv.ActiveState.com > > To unsubscribe: > > http://listserv.ActiveState.com/mailman/mysubs > > > > > > > > > ___ > > Yahoo! Messenger - NEW crystal clear PC to PC > calling worldwide with voicemail > http://uk.messenger.yahoo.com > Arijit Das Infosys Technologies Ltd. Mangalore - 575 006, India Cell Phone: 9448135200 E-Mail: [EMAIL PROTECTED] Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Sharing Variables among Processes...
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 (defined $pid) { $shared_var = 12; exit 0; } I want the change in the shared variable to be reflected to the parent process immediately...basically, same variable in memory should be changed. Thanks, Arijit Start your day with Yahoo! - make it your home page ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Flushing all open file descriptors...
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_func_that_flushes_all_open_files(); kill -9, getpgrp(); Thanks, Arijit Start your day with Yahoo! - make it your home page ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: [Perl-unix-users] Sharing Variables among Processes...
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 fork command doesn't work that way. The child and parent are two completely separate processes that don't share any resources. What you are looking for is something more like threads where each thread can access shared resources. I'm not sure if Perl handles threading. However, I did something similar to what you are trying to do but I had to do it using file handles. Here is a snippet of how I handled this. Parent if ($put_pid = open(PUT, "-|")) { do { $term = waitpid($put_pid,&WNOHANG); chomp ($tmp = ); print "$tmp \n" if (defined $tmp && $tmp ne '') } while ($term <= 0); close PUT; } Child } elsif (defined $put_pid) { STDOUT->autoflush(1); # must have this or you won't get anything until the child terminates foreach (1..12) { print " $_\n"; # must have \n at the end of each print you want to go though. This is what autoflush keys on. sleep 1; } exit 0; } Matt From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arijit DasSent: Wednesday, August 24, 2005 9:42 AMTo: activeperl@listserv.ActiveState.com; perl-unix-users@listserv.ActiveState.comSubject: [Perl-unix-users] Sharing Variables among Processes... 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 (defined $pid) { $shared_var = 12; exit 0; } I want the change in the shared variable to be reflected to the parent process immediately...basically, same variable in memory should be changed. Thanks, Arijit Start your day with Yahoo! - make it your home page Start your day with Yahoo! - make it your home page ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Re: Flushing all open file descriptors...
For me to use this, I will have to explicitly specify/SELECT all the file handles and then execute $| =1; which is something i don't want...cos my pgm is huge and finding out open file handles from each corner of it is cumbersome... So, I am looking for a func/cmd which flushes all the open files handles as and when this func/cmd is executed. -Arijit --- Petr Vileta <[EMAIL PROTECTED]> wrote: > $|=1; > > maybe this help you. > > > Petr Vileta, Czech republic > (My server reject all messages from Yahoo and > Hotmail. Send me your mail > 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, 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_func_that_flushes_all_open_files(); > > > > kill -9, getpgrp(); > > > > > > Thanks, > > Arijit > > > > > > > > - > > Start your day with Yahoo! - make it your home > page > > > > > > > ___ > > ActivePerl mailing list > > ActivePerl@listserv.ActiveState.com > > To unsubscribe: > http://listserv.ActiveState.com/mailman/mysubs > > ___ > ActivePerl mailing list > ActivePerl@listserv.ActiveState.com > To unsubscribe: > http://listserv.ActiveState.com/mailman/mysubs > Arijit Das Infosys Technologies Ltd. Mangalore - 575 006, India Cell Phone: 9448135200 E-Mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Re: Flushing all open file descriptors...
I think you are missing out here... DIsk files are always fully-buffered, STOUT is line buffered and STDERR is unbuffered. My problem is I have to do a kill -9 at the end. And a process dying with kill -9 doesn't get a scope to do its cleanup like flushing open files handles and closing 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 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... > > I'm pretty sure disk files are always written > immediately (unlike > buffered terminal files), but I could be wrong. If > I'm right, it > would only work for tty output. For sockets, I > think they're also > unbuffered and would be output as soon as possible. > > You could easily test it by opening your files and > going to another > terminal window and check the content of the files > while your main > code is in a long sleep loop. > > > > > a_func_that_flushes_all_open_files(); > > > > kill -9, getpgrp(); > > -- > ,-/- __ _ _ $Bill Luebkert > Mailto:[EMAIL PROTECTED] > (_/ / )// // DBE Collectibles > Mailto:[EMAIL PROTECTED] > / ) /--< o // // Castle of Medieval Myth & > Magic http://www.todbe.com/ > -/-' /___/_<_http://dbecoll.tripod.com/ > (My Perl/Lakers stuff) > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Re: Flushing all open file descriptors...
--- $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 true on all systems - buffering varies on > different target > devices, system calls and OS's. UNIX 'write (2)' to > a disk file > is not buffered - unlike the stdio interface (see > last comment > below). Aggreed on what u r saying... But I am talking about a "open" in Perl, followed by a set of "print" cmds, on s block device i.e. my hard drive...and in this scenario, it is fully buffered by default. > > > My problem is I have to do a kill -9 at the end. > And a > > process dying with kill -9 doesn't get a scope to > do > > its cleanup like flushing open files handles and > > closing them. > > If all you want to do is make sure your data is > unbuffered, then > turn off the buffering after opening the file. > > You can select it and unbuffer it using: > > $oldh = select (FH); > $| = 1; > select ($oldh); > > or one step version: > > select ((select (FH), $| = 1)[0]); > These are the last options I have in mind... But I was just wondering if there is anything else which probably I don't know and can do my job in a much smarter way.. -Arijit > Using syswrite will also bypass any buffered IO > since it uses the > 'write' system call, but be careful mixing it with > stdio (non-'sys') > functions. > > -- > ,-/- __ _ _ $Bill Luebkert > Mailto:[EMAIL PROTECTED] > (_/ / )// // DBE Collectibles > Mailto:[EMAIL PROTECTED] > / ) /--< o // // Castle of Medieval Myth & > Magic http://www.todbe.com/ > -/-' /___/_<_http://dbecoll.tripod.com/ > (My Perl/Lakers stuff) > Arijit Das Infosys Technologies Ltd. Mangalore - 575 006, India Cell Phone: 9448135200 E-Mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Anything like sh's set -x in PERL...?
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 mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Filesystem Block Size...how to get?
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, Arijit Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: [Perl-unix-users] Filesystem Block Size...how to get?
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 Hudson <[EMAIL PROTECTED]> wrote: > 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?Simply find a file in the appropriate file system (the mount point willwork or "." if naught else) and call "stat" on it. Element 11 of the arrayreturned is the block size of the file system. $size = (stat ".")[11];--Bruce A. Hudson | [EMAIL PROTECTED]UCIS, Networks and Systems |Dalhousie University |Halifax, Nova Scotia, Canada | (902) 494-3405__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: [Perl-unix-users] Filesystem Block Size...how to get?
Bad luck for me once again...:-( Check this... eurika120:arijit>./test3.pl test3.plBlocksize: []eurika120:arijit>eurika120:arijit>eurika120:arijit>cat test3.pl#!/depot/qsc/VG1.0/bin/perluse File::stat; my $file = "$ARGV[0]";my $st = "";my $blocksize = 0; $st = stat($file);$blocksize = $st->blksize; print "Blocksize: [$blocksize]\n"; eurika120:arijit>cat /etc/QSCDATE: 12172003HOSTNAME: eurika120ARCH: IA32QSC: QSC-VINSTALL: reimageOS: RH_7.2eurika120:arijit>./test3.pl test.plBlocksize: []eurika120:arijit> I got what the issue isThe issue is my version of Perl. It is 5.004 which doesn't let this work...but perl5.8 etc are working pretty fine. Anyways thanks a lot... -ArijitJeff D <[EMAIL PROTECTED] ahoo.com> wrote: Try using the File::stat module...it works fine for meon 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> 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...> > -Arijit> > Bruce Hudson <[EMAIL PROTECTED]>wrote:> > 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?> > Simply find a file in the appropriate file system> (the mount point will> work or "." if naught else) and call "stat" on it.> Element 11 of the array> returned is the block size of the file system. > > $size = (stat ".")[11];> --> Bruce A. Hudson | [EMAIL PROTECTED]> UCIS, Networks and Systems |> Dalhousie University |> Halifax, Nova Scotia, Canada | (902) 494-3405> > __> Do You Yahoo!?> Tired of spam? Yahoo! Mail has the best spam> protection around > http://mail.yahoo.com >___> Perl-Unix-Users mailing list> Perl-Unix-Users@listserv.ActiveState.com> To unsubscribe:http://listserv.ActiveState.com/mailman/mysubs__ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Strange Virtual memory difference...
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 1936 1936 RH3.0: vgamd126:arijit>sleep 200 &[1] 13892vgamd126:arijit>ps -eo pid,comm,size,sz,vsz,vsize | grep sleep13892 sleep 268 9705 38820 38820 Suse: linuxemt10:arijit>sleep 200 &[1] 31378linuxemt10:arijit>ps -eo pid,comm,size,sz,vsz,vsize | grep sleep31378 sleep 192 1779 7116 7116 Any idea why is this huge difference in Virtual Memory in doing a very simple and same thing in diff Linux flavors...? Does anybody know of any Perl module that can be used as a wrapper around the most unportable ps command? Thanks, ArijitArijit DasInfosys Technologies Ltd.Mangalore - 575 006, IndiaCell Phone: 9448135200E-Mail: [EMAIL PROTECTED] Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Page Size -- How to get?
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 mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] RE: Page Size -- How to get?
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: activeperl@listserv.ActiveState.com;perl-unix-users@listserv.ActiveState.comSubject: Page Size -- How to get?As a non-superuser, any idea how can I get the page size of theunderlying unix operating system?Try:--use strict;use warnings;use POSIX;my $pagesize = POSIX::sysconf(POSIX::_SC_PAGESIZE);print "pagesize is $pagesize\n";It is possible that this is not defined for your platform. Seems OK onSolaris and Linux though.HTH-- Brian Raven=Atos Euronext Mark! et Solutions Disclaimer=The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful.If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions.L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext! Market Solutions.Arijit DasInfosys Technologies Ltd.Mangalore - 575 006, IndiaCell Phone: 9448135200E-Mail: [EMAIL PROTECTED] Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] A tough question...
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 words, given a inode, can I ask the unix flavaored OS to let me know which all processes tries "unlink"/deleting that inode? -ArijitArijit DasInfosys Technologies Ltd.Mangalore - 575 006, IndiaCell Phone: 9448135200E-Mail: [EMAIL PROTECTED] Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Re: A tough question...
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. chmod 000 might work...will have to see. Thanks a lot... -ArijitJeff D <[EMAIL PROTECTED]> wrote: Steve,Agreed a FILE can be deleted/rewritten in this manner,but according to his message, I'm pretty sure that heis discussing a log DIRECTORY.Jeff--- Steve Dawson <[EMAIL PROTECTED]>wrote:> Quoting Jeff D <[EMAIL PROTECTED]>:> > > Look for all files (.pl?, .c?) and grep for> unlink/rm> > and/or log.> > Another thing you could look for is scripts which> might be legitimately > appending to the log but use> > open HNDL ">myfile.log";> > rather than> > open HNDL ">>myfile.log";> > There's more than one way to delete the contents of> a file... @-)> > Steve> ___> ActivePerl mailing list> ActivePerl@listserv.ActiveState.com> To unsubscribe:> http://listserv.ActiveState.com/mailman/mysubs> __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com___ActivePerl mailing listActivePerl@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Re: A tough question...
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 directories that get wiped out as well. Is it always the same directory?Arijit DasInfosys Technologies Ltd.Mangalore - 575 006, IndiaCell Phone: 9448135200E-Mail: [EMAIL PROTECTED] Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Reopening STDOUT - howto?
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. Yahoo! Personals___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Syntax checking in crontab
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 mails saying that: Your "crontab" on abhay2 ! unexpected end of line Here is the content of my crontab file: abhay2> crontab -l## Added for testing if Syncing happens properly for Regressions testcases with new script00 20 * * * /u/regress/INFRA_HOME/perforce/SyncSnapshots.csh -regr -b VCS7_1 -r /u/regress/p4_snapshots/nightly71 -l /u/regress/perforce/Regress/71sync.log ... 04 20 * * * /u/regress/INFRA_HOME/perforce/Regress/syncSnapshots -r 72 ## New Crons for Syncing Causes Files20 20 * * * /u/regress/INFRA_HOME/perforce/SyncSnapshots.csh -regr -b TD -r /u/regress/p4_snapshots/Causes/TD -l /u/regress/perforce/Regress/Causes_TD_sync.log CausesDir/...20 20 * * * /u/regress/INFRA_HOME/perforce/SyncSnapshots.csh -regr -b VCS7_1 -r /u/regress/p4_snapshots/Causes/VCS7_1 -l /u/regress/perf## Added for testing if Syncing happens properly for Regressions testcases with new script Anybody faced this before...? Thanks, Arijit Yahoo! Photos Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Strange behaviour in Perl
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 a free 1 GB, there's more in store with Yahoo! Mail.___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: [Perl-unix-users] Strange behaviour in Perl
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 the Perl In A Nutshell book:---p: Causes Perl to assume the following loop around your script, which makes it iterate over filename arguments:LINE:while (<>) {... # your script goes here} continue {print;}The lines are printed automatically. To suppress printing, use the -n switch. If both are specified, the -p switch overrides -n. BEGIN and END blocks may be used to capture control before or after the implicit loop.--So your one-liner is actually:LINE:while (<>) {my $var1 = ;$var2 = $var1 * 100;print $var2;} continue {print;}It's already looping through the arguments with while(<>), so reading will yield nothing. Also, -p implies printing each argument read, so that's the output that you are getting, not $var2 as you may think.You have 2 choices, either remove -p to read STDIN as you are doing, or change -p to -n to supress automatic printing of the input strings and remove the assignment of STDIN and read $_, which would be the next argument read from the command line:echo 4.56 | perl -e 'my $var1=; $var2=$var1*100;print $var2;'orecho 4.56 | perl -n -e '$var2=$_*100;print $var2;'If you keep -p, it'll print the input string right after printing $var2, like this:4564.56Which you do not want.dZ. What are the most popular cars? Find out at Yahoo! Autos ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Anything better than Signal? - For Async Procsess notification
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. Find below the gdb trace... So, I was just wondering if there is any other method of async process notification that I can use for this scenario apart from Signals? Basically, my requirement is, I have a script which should keep on doing its job but after 300 secs of elapsed time of its execution, it should invoke/execute a routine and once finished executing that routine, return back to what it was doing before the routine execution (exactly like how an interrupt is handled at a higher level). I tried doing this with alarm 300; but got into process hanging issues sometimes. Any help here...? Thanks, Arijit PS: Here is where my process got stuck while handling SIGLARM. (gdb) where#0 0x55192d19 in __lll_mutex_lock_wait () from /lib/tls/libc.so.6#1 0x5511e1cc in _L_mutex_lock_2723 () from /lib/tls/libc.so.6#2 0x000f in ?? ()#3 0x086a7890 in ?? ()#4 0x55119e75 in malloc () from /lib/tls/libc.so.6#5 0x08078c32 in saferealloc ()#6 0x08085915 in Perl_sv_grow ()#7 0x08088190 in Perl_sv_catpvn ()#8 0x08080820 in Perl_pp_concat ()#9 0x08080218 in Perl_runops ()#10 0x08058d14 in perl_call_sv ()#11 0x0807dd9c in Perl_sighandler ()#12 #13 0x551528f5 in fork () from /lib/tls/libc.so.6#14 0x080a533a in Perl_pp_system ()#15 0x08080218 in Perl_runops ()#16 0! x0805861a in perl_run ()---Type to continue, or q to quit---#17 0x08056ba0 in main ()(gdb) (gdb) quitThe program is running. Quit anyway (and detach it)? (y or n) yDetaching from program: /proc/14491/exe, process 14491eurika214> Relax. Yahoo! Mail virus scanning helps detect nasty viruses!___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] What am I doing wrong here...?
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_load = grep(/load average/, @top_output);print "$latest_CPU_load\n";vgamd127> ./test.pl 06:01:29 up 135 days, 20:56, 36 users, load average: 1.02, 1.03, 1.081vgamd127> ./test.pl | od -bc -000 040 060 066 072 060 061 072 061 063 040 040 165 160 040 061 063 0 6 : 0 1 : 1 3 u p 1 3020 065 040 144 141 171 163 054 040 062 060 072 065 066 054 040 063 5 d a y s , 2 0 : 5 6 , 3040 066 040 165 163 145 162 163 054 040 040 154 157 141 144 040 141 6 u s e r s , l o a d a060 166 145 162 141 147 145 072 040 061 056 060 063 054 040 061 056 v e r a g e : 1 . 0 3 , 1 .100 060 063 054 040 061 056 060 070 012 061 012 0 3 , 1 . 0 8 \n 1 \n113 vgamd127> Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Antwort: [Perl-unix-users] What am I doing wrong here...?
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] grep returns an array which in scalar context evaluates to the number of elements in there. (There is one line containing 'load average') >Any help here? Yes write the assignment the way you intended it. ;-) ($latest_CPU_load)= grep(/load average/, @top_output); HTH George MavridisArijit DasInfosys Technologies Ltd.Mangalore - 575 006, IndiaCell Phone: 9448135200E-Mail: [EMAIL PROTECTED] Relax. Yahoo! Mail virus scanning helps detect nasty viruses!___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Timeing Out a Command - how to?
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 might_hang.pl fails to finish off by 300 elapsed secs, it should kill the might_hang.pl process. I know that this can be achieved from inside might_hang.pl using alarms, but I needed to achieve that through a bourne shell i.e. the invoker of the Perl program (might_hang.pl). Any thoughts about how this can be achieved...? Thanks, Arijit Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Need to have Message Queues accessible across NFS -- Suggestions
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 opened/used across NFS by different unrelelated processes. Any suggestions what would be the best fit here...? -Arijit New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low rates.___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Pre-Dating Files Inode Modification time - howto?
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 Is there any known way to pre-date the "inode modification time"? Thanks, Arijit vgamd129> touch -c -t 01311200.00 corevgamd129> perl -e '$var = time; print $var;'1144239161 vgamd129> perl -e '$var = (stat("/remote/vtghome7/arijit/core"))[8]; print "$var\n";'1138737600 vgamd129> ls -lta core-rw--- 1 arijit src 782336 2006-01-31 12:00 corevgamd129> perl -e '$var = (stat("/remote/vtghome7/arijit/core"))[9]; print "$var\n";'1138737600 ## Note that the "inode modification time" couldn't be pre-dated vgamd129> perl -e '$var = (stat("/remote/vtghome7/arijit/core"))[10]; print "$var\n";'1144238657 vgamd129> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] POSIX::setsid - Any issue with this?
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(); print "\$sess_id = $sess_id\n"; vgamd129> __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Re: POSIX::setsid - Any issue with this?
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.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(); > print "\$sess_id = $sess_id\n"; > > vgamd129> > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] How to modify $ENV{PATH} portably?
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". But due to different format of PATHs in different os/shells, I am not able to do that in a very clean way. Is there any Perl Array (somewhat like @INC) which I can modify to have my PATH changed? Thanks, Arijit __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[Perl-unix-users] Debugging Perl Code Dynamically - howto?
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 that would lead to a huge dump at execution_trace.out for which I don't have enough space. I just want the dump to start when the execution flow enters "sub init()" and ends up, before coming out of "sub init". Is there any way I can achieve that...? I needed it very quickly...so, couldn't spend a lot of time with Perl literature to figure it out. A quick help/pointer on this will be very helpful. Thanks for your time, Arijit __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs