RE: PERL_LIB Questions

2001-08-08 Thread Matt Crapo
I have not figured out how to change the perl library path in my environment. Would love to know how if anybody can advise. I have, however, figured out how to include it in a script. A script will process any "use" or "require" statements first, so in order to change something that affects tho

RE: Please help with perl library path problem!

2001-08-07 Thread Matt Crapo
Oops - forgot to share... -Original Message- From: Matt Crapo [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 07, 2001 4:19 PM To: 'Chidi' Subject: RE: Please help with perl library path problem! I may be off in left field here, but I've had similar error messages (

RE: To read from a file using RegExp

2001-08-07 Thread Matt Crapo
Personally, I'd use a hash. First, populate a hash of good node values like this: foreach (1, 2, 3, 4) {# Good node values $goodNode{$_} = 1; # Set to "true" } Then for each node you find in the file, test against %goodNode: if ($goodNode{$questionableNode}) { success } Good Lu

RE: using system?

2001-08-07 Thread Matt Crapo
System commands return zero for true, some other value for failure. This is backwards from perl's logic. You need to test for a return of zero, or use "and" instead of "or" like this: if ((system("system command")) == 0) { success } or system("system command") and die "$!\n"; # AND says "Did

RE: Calling UNIX Commands?

2001-08-06 Thread Matt Crapo
Using the backticks will only get you data coming on handle 1, STDOUT. You want the data coming on handle 2, STDERR, as well. You need to combine them by appending 2>&1 to your system command. Better yet, use perl's internal file functions like move, copy, rename, etc. You get better control, l

RE: Explaining myself correctly RE: SORTING BY DATE

2001-08-06 Thread Matt Crapo
There are always a hundred ways to do something, and others might know a better way, but I'd use a sprintf statement to zero-pad your date values like this: my $date_added = sprintf("%04d%02d%02d", $year $mon $mday); Make sure you adjust the values of year month & day from the raw values suppli