Re: How to keep script alive if my shell closes

2010-02-13 Thread Jeff Peng
On Thu, Feb 11, 2010 at 6:39 AM, Shawn H Corey wrote: > > You can do the same thing inside Perl with %SIG: > >  $SIG{HUP} = 'IGNORE'; > Also "nohup" redirect all stdout and stderr to a file "nohup.out". So you have also to reopen STDOUT and STDERR to a file handle if doing it in the script. btw

Re: How to keep script alive if my shell closes

2010-02-13 Thread Ariel Casas
All I needed to do is add: $SIG{HUP} = 'IGNORE'; I tested it by killing my terminal window while an active vpn connection and confirmed that my perl script runs it's post vpn cleanup stuff even after the terminal window closed. Thanks Shawn! Ariel C. On Feb 10, 2:39 pm, shawnhco...@gmail.com

Perl XML Duplicates

2010-02-13 Thread sub
Hi, I am trying to use XML::Simple to search an xml file for duplicates but it does not seem to display the duplicates. Does anyone know how to perform this task ? Sub -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://lear

Re: How to keep script alive if my shell closes

2010-02-13 Thread Alan Haggai Alavi
Hello Ariel, You could use either GNU Screen (http://www.gnu.org/software/screen/) or `nohup` command to run your script. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h..

Re: prepare(SELECT ... FROM TABLE) error

2010-02-13 Thread Dr.Ruud
Jay Savage wrote: Dr.Ruud: Because $@ is a global, it is best practice to act on the return value of eval itself: [snip] $@ is also *guaranteed*--in the words of perlfunc--to be set correctly. I believe that historically this may not have been the case: $@ may have only been set on failure

Re: Perl - XML Simple - Find Duplicates

2010-02-13 Thread Shawn H Corey
sub wrote: > Hi, > > When can I use perl xml simple to find duplicates in a xml file ? It > seems to remove the duplicates everytime I use it. What do you mean by duplicates? The definition of XML states that there can one be one of each attribute for each element, and each element can have only

Re: How to keep script alive if my shell closes

2010-02-13 Thread Shawn H Corey
C.DeRykus wrote: > I'd think 'nohup perl a.pl' would be a smidge safer though since > the script is vulnerabe during startup/loading before the 'IGNORE' > is seen. Of course, you could mitigate risk by setting the 'IGNORE' > inside a BEGIN{}. But nohup has the same "vulnerability" since it doe

Config::Properties - Change property value

2010-02-13 Thread Vallabha
Hello, I am trying to use Config::Properties module (http://search.cpan.org/ ~salva/Config-Properties-1.70/Properties.pm). I am able to read the properties and use them. However I am finding an issue while changing a property value. Here is my script: == #!/usr/bin/pe

Re: Parsing file and regexp

2010-02-13 Thread Uri Guttman
> "osc" == olivier scalb...@algosyn com > writes: osc> keywordA word1, word2, word3; osc> Here we can have some free text osc> ... osc> ... osc> keywordB word4, osc> word5, word6, word7, word8, osc> word9, word10; osc> KeywordA osc

Parsing file and regexp

2010-02-13 Thread olivier.scalb...@algosyn.com
Hello, I need to extract info from some text files. And I want to do it with Perl ! The file I need to parse has the following layout: keywordA word1, word2, word3; Here we can have some free text ... ... keywordB word4, word5, word6, word7, word8, word9, word10

Perl XML Simple

2010-02-13 Thread sub
Is it possible to use Perl XML Simple to check for duplicates ? When I use it, it seems to be omitting the dupes. -Kevin. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Perl - XML Simple - Find Duplicates

2010-02-13 Thread sub
Hi, When can I use perl xml simple to find duplicates in a xml file ? It seems to remove the duplicates everytime I use it. Thanks, Sub. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Net-SSH-Perl with Cisco

2010-02-13 Thread Paul
Hello All, I've been trying to write a Windows script that will log into a Cisco ASA using SSH2, run an escalated command, and return the results but, I've run into a wall. When trying to initiate the connection with the ASA it always fails in the same spot. Here is the debug from the Perl script

Re: How to keep script alive if my shell closes

2010-02-13 Thread C.DeRykus
On Feb 10, 2:39 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: > Jeff Peng wrote: > > On Wed, Feb 10, 2010 at 2:40 AM, Ariel Casas wrote: > > >> My question is; how do I keep my perl script from dying if my shell > >> window accidentally closes while my perl script is paused at the > >> system f

Re: More basic questions

2010-02-13 Thread PolyPusher
On Feb 10, 9:03 am, jwkr...@shaw.ca ("John W. Krahn") wrote: > PolyPusher wrote: > > All, > > Hello, > > > > > > > I have a file that defines pins for an IC.   The code needs to find > > ".SUBCKT RE1321_4" and produce a list that complies with SKILL(lisp) > > context for Cadence tool suite, the out

Re: Dereferencing hash with array value

2010-02-13 Thread Shawn H Corey
Dermot wrote: > On 13 February 2010 06:42, Owen wrote: >> The program below works, but I don't believe I have to make the >> reference # my $svgs = \...@svgs; to get it into the hash; >> >> I think I should be able to do something like >> >> $folders{$folder} = @svgs; >> print "$folders{Zt

Re: Dereferencing hash with array value

2010-02-13 Thread Dermot
On 13 February 2010 06:42, Owen wrote: > The program below works, but I don't believe I have to make the > reference  #  my $svgs = \...@svgs;     to get it into the hash; > > I think I should be able to do something like > >  $folders{$folder} = @svgs; >  print "$folders{Ztyx}->[3]\n"; You want