Re: how to make perl program run continue when i press control+s to pause screen output

2013-06-06 Thread Travis Thornhill
On Jun 5, 2013, at 4:18, "Nemana, Satya" wrote: > Hi > > I am having a slight difficulty in getting this accomplished. > When my perl program keeps running, I sometimes need to pause the screen > output and check some things on the output. > But, I want my program to still keep running whil

Need some module help

2009-07-09 Thread Travis Thornhill
I'm trying to learn to develop Perl modules in an effort to have clean directory structure and more reusable code. I'm hitting a little snag in my test code that I don't quite understand. I'm hoping someone can help explain where I may be going wrong here. The error I'm receiving is this: ln0

hash slice??

2008-11-10 Thread Travis Thornhill
Is there such a thing?   I'm trying to take a HoH and make a reference to a sub-part of the hash.   This doesn't work:   my %sub_hash = $main_hash{'sub_hash'};   I get the following error: Reference found where even-sized list expected at ./my_buggy_program line 30.   Any quick tips on how to refer

Funky Characters in Log files

2008-06-28 Thread Travis Thornhill
I know there have probably been a thousand posts on this topic, and I apologize in advance for skipping over them and deleting them.   I have instances of strange characters in logs, and I'd like to be able to print them properly.   Here's an example of a few lines:   L 06/27/2008 - 18:37:18: "[P

Testing for a condition immediately after require

2008-06-06 Thread Travis Thornhill
I want to be able to tag a module with one or more tags that can be tested for after requiring it.   require 'module';   Any ideas on the best way to accomplish this?   Thanks in advance  

Re: Env variables readable by an application

2007-12-28 Thread Travis Thornhill
"Chas. Owens" <[EMAIL PROTECTED]> wrote: No, environmental variables are a per-process thing. Child processes inherit the state of their parent's environment, but that is it. If you need inter-process communication you have to use IPC*, a file, a database, or some other external resource. Take

Env variables readable by an application

2007-12-27 Thread Travis Thornhill
I have an application that executes a user-defined script. The application sets certain environment variables that the script uses to determine which phase it is in. I want to be able to set other env variables to set other conditions usable by the script. Is there a way to do this?

How do I create this string?

2007-03-19 Thread Travis Thornhill
I need to make strings of variable length for testing inputs. The strings can contain any letter, say 'a', and I need to be able to create the string with 255, 256 or any length. Is there a quick and easy way to do this with perl? - Never miss an email

SIGCHLD question

2007-02-01 Thread Travis Thornhill
ng $p($proctable{$p})"); kill 9, $p; } # set processes = 0 to break the main loop # and "zero" the process table $processes = 0; %proctable = (); } Thanks in advance! - Travis Thornhill - Need a quick answer? Get one in

Re: what's mistaken?

2006-12-26 Thread Travis Thornhill
Chad Perrin <[EMAIL PROTECTED]> wrote:On Tue, Dec 26, 2006 at 06:59:42PM -0800, Travis Thornhill wrote: > > > Adriano Allora wrote: hi to all, > > (and a very good new year's eve). someone can tell me why this script > doesn't accept the -h flag?: >

Re: what's mistaken?

2006-12-26 Thread Travis Thornhill
Adriano Allora <[EMAIL PROTECTED]> wrote:hi to all, (and a very good new year's eve). someone can tell me why this script doesn't accept the -h flag?: #!/usr/bin/perl -w use strict; use warnings; use Getopt::Std; getopt('h'); my $opt_h; if($opt_h) { [code...] } You need to declare a has

Re: The fork command

2006-12-08 Thread Travis Thornhill
If you're using some flavor of unix, executing 'perldoc perlfork' on the command line is a good place to get started. The books Programming Perl, and Perl Cookbook have good information on how to get rolling with fork. - Travis "Dukelow, Don" <[EMAIL PROTECTED]> wrote: I'm using

Re: What's wrong with this script?

2006-11-05 Thread Travis Thornhill
rmdir will only delete empty directories. I assume these directories contain files? Plus I'm not sure that using system() with die works the way you are intending. Why not use perl's rmdir (which also only deletes empty dirs). I'd try opendir on the CVS directory and unlink all the file

Re: Just asking ... why the dot or no dot

2006-10-18 Thread Travis Thornhill
The most common way this is used is to reload edits that you make to a resource file -- like .profile -- into the current shell. $> . .profile or $> . .bashrc HTH, - Travis. Tommy Nordgren <[EMAIL PROTECTED]> wrote: On 18 okt 2006, at 22.47, [EMAIL PROTECTED] wrote:

Re: STDOUT

2006-09-19 Thread Travis Thornhill
/$progname syntax OK/ ) { $syntax_ok = 1; last; } } Travis Thornhill <[EMAIL PROTECTED]> wrote: Would something like this (with backticks) work? It's probably not as robust as using 'do BLOCK' but it might work. #untested my $progname = "

Re: STDOUT

2006-09-19 Thread Travis Thornhill
Would something like this (with backticks) work? It's probably not as robust as using 'do BLOCK' but it might work. #untested my $progname = "whatever.pl"; my $output = `perl -c $progname`; if ( $output =~ /$progname syntax OK/ ) { # It's good } else { # It's bad }

Re: Command line vs. cron

2006-09-13 Thread Travis Thornhill
I was just looking into the %ENV hash in my trusty Programming Perl book and found this interesting note on p. 661: "Note that processes running as crontab(5) entries inherit a particularly impoverished set of environment variables. (If your program runs fine from the command line but not u

RE: fork question

2006-07-26 Thread Travis Thornhill
with warm regards, Venkat Saranathan Gulf Breeze Software www.gulfsoft.com GulfBreeze Blog www.gulfsoft.com/blog -Original Message- From: Travis Thornhill [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 11:47 PM To: beginners@perl.org Subject: fork question I thought I understood

PATH env variable and open()

2006-07-26 Thread Travis Thornhill
Does anyone have any idea why setting $ENV{"PATH"} = "" would cause the open() function to fail? The file I'm trying to open exists, and some debug printing shows that I'm in the directory where it exists. Travis. - Do you Yahoo!? Everyo

fork question

2006-07-21 Thread Travis Thornhill
I thought I understood this but maybe I don't. When perl forks it creates an exact copy of itself with open files, same variables, hashes, arrays, etc. But when a variable in one changes, do they all change? What's wrong with how I'm trying to use the $children variable to track

cscope for perl?

2006-06-29 Thread Travis Thornhill
I've heard that there is a way to make cscope work for perl. I can't find any info in the cscope man page or in perldocs. Can anyone point me in the right direction? Thanks in advance - Do you Yahoo!? Next-gen email? Have it all with the