Re: [Perl-unix-users] embedding javascript in cgi perl

2006-09-19 Thread Peter Eisengrein
Another possible cause is the direction of the slashes in this statement:   print "var url = '';";   Just a thought.       -Original Message-From: Peter Eisengrein Sent: Tuesday, September 19, 2006 5:35 PMTo: 'Dhivya Arasappa

Re: [Perl-unix-users] embedding javascript in cgi perl

2006-09-19 Thread Peter Eisengrein
Not sure but if I had to guess it would be that the double quotes are interpolating the output. Of course, not sure why this wouldn't also happen in Linux. My recommendation is try using single quotes instead.     -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTEC

RE: [Perl-unix-users] @INC Path problem

2006-05-30 Thread Peter Eisengrein
> > How can I add a path /ccstore/fmcc/triggers/ into @INC path? > There are at least two ways I know of. I'd generally use the first one unless package lib is unavailable on your machine. use lib '/ccstore/fmcc/triggers/'; --OR-- BEGIN { push(@INC,'/ccstore/fmcc/triggers/'); } __

RE: [Perl-unix-users] how to improve text manipulation

2006-03-10 Thread Peter Eisengrein
While the foreach() may be slow, I don't see any way around it if it is possible that the date codes may change. Can you show some code? People may have ideas on how to improve performance of what you've already written.     -Original Message-From: [EMAIL PROTECTED] [mailto:[

RE: [Perl-unix-users] validating (restricting) hash values and ke ys

2006-03-03 Thread Peter Eisengrein
> > #!/usr/bin/perl -w > use strict; > use warnings; > > my %hash = ( "acc12", 1, > "acc2", 0, > "acc3", '', > "una1", 1 ); > > $hash{acc3} = (); > > my $valid="acc1|acc2|acc3"; > I'd get rid of the pattern matching and put the valid keys in their ow

RE: [Perl-unix-users] Using variables in a library path

2006-03-01 Thread Peter Eisengrein
> push @INC, "$BASE_PATH/scripts/common"; Doesn't this only work within a BEGIN {} block? ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: [Perl-unix-users] parsing ARGV

2005-11-03 Thread Peter Eisengrein
> Before I roll my own ARGV parse code I wanted to know if someone had > some sample code to get me started. I just want to be able to pass > simple switches that contain one parameter each to my perl > app. check out the Getopt module and all it's many variants.

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

2005-09-19 Thread Peter Eisengrein
Not sure how to do programmatically, but `df -k` should do. -Original Message-From: Arijit Das [mailto:[EMAIL PROTECTED]Sent: Monday, September 19, 2005 10:45 AMTo: activeperl@listserv.ActiveState.com; perl-unix-users@listserv.ActiveState.comSubject: [Perl-unix-users] Fil

RE: [Perl-unix-users] Install Perl under Solaris 9

2005-09-13 Thread Peter Eisengrein
Can you install the new version somewhere else and then have two versions? If so, you should be able to change the shebang appropriately, i.e.: #!/usr/bin/perl ### old scripts #!/usr/bin/newperl/perl ### new scripts > -Original Message- > From: nobody [mailto:[EMAIL PROTECTED

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

2005-07-29 Thread Peter Eisengrein
> > No I don't have any control of the subroutine because > thatz inside a module called Quota > Can you fork it off to a child process and have the parent kill it if it has exceeded a timeout threshold? Don't know if this would work or not, just a thought. _

RE: [Perl-unix-users] Perl FTP

2005-04-06 Thread Peter Eisengrein
> Select packages you wish to process : all > Using as the package base directory The problem appears to be that it was installed in /usr/local which is not included in @INC. Were you able to choose it's root directory or was this one chosen for you? > #!/usr/bin/perl -w > > # created by O

RE: [Perl-unix-users] hash of hashes

2005-04-04 Thread Peter Eisengrein
> I think this is what you're trying to do > > But I'm not sure why? I'd only do this if you are > expecting to have multiple configs for dbhost, e.g. > devdb1, devdb2, devdb3... otherwise I'm not sure why > you'd break down the structure this much... > Agreed. Also, by building it in a hard

RE: [Perl-unix-users] Accessing mail from the web

2005-03-14 Thread Peter Eisengrein
Try changing your 'quotes' to "double quotes" in the open. > -Original Message- > From: Humberto Rodriguez [mailto:[EMAIL PROTECTED] > Sent: Monday, March 14, 2005 12:27 AM > To: perl-unix-users@listserv.ActiveState.com > Subject: [Perl-unix-users] Accessing mail from the web > > > Dea

RE: [Perl-unix-users] RTF to text

2004-08-02 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] RTF to text There are quite a few modules that match RTF+Text: http://search.cpan.org/search?query=RTF+Text&mode=module I'd think at least one or two will do what you want. > -Original Message- > From: Sandeep Deshpande [mailto:[EMAIL PROTECTED]] > Sen

RE: [Perl-unix-users] conversion between exponential and correspo nding integer value

2004-02-27 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] conversion between exponential and corresponding integer value depending on the format of the exponential value, it may be as simple as: print int(10e5); print int(-10e5); This doesn't appear to work, though, if formatted as 10e-5, so you'd need to create a sub

[Perl-unix-users] RE: Portable solution for modifying date

2004-02-12 Thread Peter Eisengrein
Title: RE: Portable solution for modifying date C:\>perldoc -f utime     utime LIST     Changes the access and modification times on each file of a list     of files. The first two elements of the list must be the     NUMERICAL access and modification times, in that ord

RE: [Perl-unix-users] Index of array element

2003-12-03 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] Index of array element are the names unique? If so, a hash would be faster. Nevertheless, I'd do something like my $index; my @names = qw(Bob Mary Fred Julio); my $matchthis = "Fred"; for (my $i = 0; $i < scalar(@names); $i++) {     if ($names[$i] eq $mat

RE: [Perl-unix-users] Removing files older than 10 days from a di rectory

2003-11-07 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] Removing files older than 10 days from a directory ### untested my $dir = '/dir'; opendir(DIR,$dir) || die "Can't open $dir : $!\n"; my @files = readdir(DIR); # you may want to grep only certain files here close(DIR); foreach my $file(@files) {     my $now

RE: [Perl-unix-users] how to check log file, copy it and remove contains

2003-07-14 Thread Peter Eisengrein
Check out the File::Copy module. That will do what you want. Also, the stat() function will give you the file parameters, including size. -Original Message-From: Mario Ortiz [mailto:[EMAIL PROTECTED]Sent: Monday, July 14, 2003 12:22 PMTo: [EMAIL PROTECTED]Subject: [Perl-uni

RE: [Perl-unix-users] Nesting foreach using multiple arrays

2003-06-27 Thread Peter Eisengrein
definitely. What you want is a hash. It would look like this:   ###   my %animalandfood = (     'cat' => 'meow mix',     'dog' => 'dog chow',     'ferret' => 'ferret food',     'mouse' => 'cheese'  ### changed this one on ya!     );     foreach my $animal (keys %animalandfood) {     print "an

RE: [Perl-unix-users] "in" operator?

2003-03-11 Thread Peter Eisengrein
perldoc -q contains -Original Message- From: EXTERN Chakirov Timour (TZ CIS; DS/ESQ3) [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 10:38 AM To: '[EMAIL PROTECTED]' Subject: [Perl-unix-users] "in" operator? Hello, I know it's a dummy question, however I could not find a quick

RE: [Perl-unix-users] DNS lookup with Perl

2003-02-19 Thread Peter Eisengrein
> How would I go about to set for example a timeout setting for how long > the script should wait for a response, and is it possible to do more > than one DNS query at the time? Any suggestions and/or ideas would be > very much appriciated. A couple thoughts: 1- are there other nameservers that

RE: [Perl-unix-users] Sentences that not working right

2003-02-18 Thread Peter Eisengrein
Is it possible that PE-456-987 may be pe-456-987 or Pe-456-987 or pE-456-987? If so, then your match would need to be if ($cedula =~ /$linea[2]/i) -Original Message- From: Ing. Ricardo Cumberbatch L. (PANNet - URC) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 18, 2003 9:51 AM To: [

RE: [Perl-unix-users] Perl and UNix

2003-01-21 Thread Peter Eisengrein
http://www.cpan.org http://search.cpan.org -Original Message- From: Poon, Kelvin (Infomart) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 9:39 AM To: 'Thomas_M' Cc: '[EMAIL PROTECTED]' Subject: RE: [Perl-unix-users] Perl and UNix Thanks a lot for all anyone who replied, th

RE: [Perl-unix-users] how to get a directorylisting

2002-09-17 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] how to get a directorylisting opendir(DIR,$directory) || warn "Can't open $directory : $!\n"; my @table = readdir(DIR); close(DIR); -Original Message- From: Pasi Valkeila [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 14:13 To: [EMAIL PROT

RE: [Perl-unix-users] Setting env variables?

2002-09-05 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] Setting env variables? easy enough to test... #script1.pl $ENV{Ice_Cream}{Flavors}{Favorite}="Chocolate"; #script2.pl require "script1.pl"; print "$ENV{Ice_Cream}{Flavors}{Favorite}\n"; > -Original Message- > From: Craig Sharp [mailto:[EMAIL PROTECT

RE: [Perl-unix-users] need some help in pattern matching

2002-09-03 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] need some help in pattern matching ### UNTESTED my $line = 'DNFAR1S query tli tcp /dev/tcp \x00020bb8a9f3702f'; my @chunks = split(/\ /,$line); # get the first 5 vars from @chunks my ($v5,$h6,$ip1,$ip2,$ip3,$ip4) = $line =~ /^.(\w{4})(\w{4})(\

RE: [Perl-unix-users] Help please with a search routine

2002-05-22 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] Help please with a search routine I copy/pasted your first attempt $field[3] ="hello how are you today"; $FORM{'keyword'}="today"; if ($field[3] =~/$FORM{'keyword'}/i) {$found="1";} and it worked for me. You may want to add a couple of print statements before

[Perl-unix-users] RE: Create three different files based on search string in the input file

2002-04-04 Thread Peter Eisengrein
e a chance that it could match more than one? If so, how do you want to handle it? Only write to the first file? Or write to each file for each match? -Original Message-From: AITHA, BHEEMSEN (SBCSI) [mailto:[EMAIL PROTECTED]]Sent: Tuesday, April 02, 2002 17:38To: 'Peter Eisengr

[Perl-unix-users] RE: Create three different files based on search string in the input file

2002-04-04 Thread Peter Eisengrein
t OUT2 "$data" if ($f == 2);     print OUT3 "$data" if ($f == 3); } -Original Message- From: AITHA, BHEEMSEN (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 14:30 To: 'Peter Eisengrein'; [EMAIL PROTECTED] Subject: RE: Create three diff

RE: [Perl-unix-users] search for a particular string in a file

2002-04-02 Thread Peter Eisengrein
Title: RE: [Perl-unix-users] search for a particular string in a file assuming old files do not change, it would be easiest to keep a hash of already scanned files. Then upon each execution (or every x intervals if it is running as a daemon), you readdir(), and compare that against your hash.

RE: [Perl-unix-users] Setting variables with a module

2002-01-16 Thread Peter Eisengrein
you mean vars other than what is in %ENV ? > -Original Message- > From: Craig Sharp [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 16, 2002 15:20 > To: [EMAIL PROTECTED] > Subject: [Perl-unix-users] Setting variables with a module > > > Hello, > > > > I would like to be able t

RE: [Perl-unix-users] useradd vs. perl5.6 on Linux

2001-12-26 Thread Peter Eisengrein
First of all, if this server is available on the 'net, it's a bad idea - don't do it. If it is only accessable to your internal network, you have less to worry about but you probably still do not want just anyone able to add/change users. That being said, you have a few options (I'd go with #3):

RE: [Perl-unix-users] Substitution help needed

2001-11-30 Thread Peter Eisengrein
You don't even need the s/// since you need to test for it anyway. You could do it something like this: @lines =('before match', ') in psfs1 extent size 40 next size 10 lock mode row;', 'after match'); foreach (@lines) { if ($_ eq ') in ps

RE: [Perl-unix-users] (no subject)

2001-10-12 Thread Peter Eisengrein
NAME    lib - manipulate @INC at compile time   SYNOPSIS    use lib LIST;       no lib LIST;   DESCRIPTION    This is a small simple module which simplifies the manipulation of @INC    at compile time.       It is typically used to add extra directories to perl's search path so   

RE: [Perl-unix-users] Log

2001-09-17 Thread Peter Eisengrein
print scalar(localtime()); > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: 17 September 2001 15:43 > To: [EMAIL PROTECTED] > Subject: [Perl-unix-users] Log > > > I'm trying to output the date and time a perl script is run to a log. > What is the synt

RE: [Perl-unix-users] Freeing Up Memory

2001-09-04 Thread Peter Eisengrein
That's pretty much it. But in your example, you could also just do a foreach () instead of reading the entire FILE into @SOMEVAR. That should help too. -Pete > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: 04 September 2001 02:13 > To: Erick Nelson; per

RE: [Perl-unix-users] Bandwidth meters...

2001-08-20 Thread Peter Eisengrein
MRTG! It can graph any snmp device. And it's perl (and C) and available on UNIX and Win platforms. You can find it at http://people.ee.ethz.ch/~oetiker/webtools/mrtg/mrtg.html -- check out some of the user pages to see what can be done with it. -Pete > -Original Message- > From: Alex

RE: [Perl-unix-users] Compare timestamp using localtime objects

2001-04-12 Thread Peter Eisengrein
use Time::Local; With this you can convert it to epoch time which then becomes a simple numeric comparison. -Original Message- From: Dennis Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 11:36 AM To: [EMAIL PROTECTED] Subject: [Perl-unix-users] Compare timestamp using

RE: [Perl-unix-users] Read the Last line in a file

2001-02-15 Thread Peter Eisengrein
There may be a better way, but this should work (untested): open(FILE,"$thefile") || die "Can't open $thefile: $!\n"; @file=; close(FILE); $lastline=pop(@file); -Original Message- From: Ricardo Cumberbatch L. [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 9:24 AM To: Perl

[Perl-unix-users] RE: SetUID?

2001-02-15 Thread Peter Eisengrein
Not sure Perl is going to override the systems permissions (nor do I think you'd really want it to). I think your options are two: [1] system("su -c inndstart news"); ### or [2] run the script from the news' crontab -Original Message- From: Martin Moss [mailto:[EMAIL PROTECTED]] Sent: