Re: [Perl-unix-users] Regular expression question

2006-08-01 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: Regular expression question From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cai, Lucy (L.)Sent: Monday, July 31, 2006 17:21To: Cai, Lucy (L.); perl-win32-users@listserv.ActiveState.com; perl-unix-users@listserv.ActiveState.com; [EMAIL PROTECTED]; [EMAIL PROTECTED]Sub

RE: [Perl-unix-users] Populating a spreadsheet from files

2006-03-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > Hi, > Not sure if that is what you want, but I did it once by retrieving > information from MySQL database and then writing it to .csv file. > When user clicks in .csv file link, it opens in Excel (IE only) > Worked for me, > Regards, > VM The real question is wh

RE: [Perl-unix-users] File Find

2006-02-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
    Then do a opendir and readdir instead of the file::find.   Wags ;) -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Sharp, CraigSent: Thursday, February 23, 2006 12:26To: perl-unix-users@listserv.ActiveState.comSubject: [Perl-unix-use

RE: [Perl-unix-users] Printer perl module printing on same line

2005-09-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > My problem is that arrays are being printed all on one line (as much > as it can) instead of one line per element. What do I need to do > with the data? > > use Printer; > > my @data = ('This is line one','This line two'); Need to add \n for each line or see if

RE: [Perl-unix-users] split on array

2005-06-02 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > Hi, > > I am not able to split a string and build an array. I am reading the > lines from a file. I could not understand what I am doing wrong here. > > My code is below: > > #!/usr/bin/perl -w > # > -

Re: RE: [Perl-unix-users] Odd problems from shell commands run via RP C service

2004-08-20 Thread David Greenberg
Is it possible that the process is being killed externally. If that happens, the output using backticks might be lost while some or all of the output will still be written to a file. Maybe it's something along these lines? -David - Original Message - From: vega, james <[EMAIL P

Re: [Perl-unix-users] V100/Blade2500 Vs Ultra10

2004-08-20 Thread David Greenberg
gly faster (not surprisingly). I would think that it should at least run in less than 1/2 hour, but Sun could probably give you a better rating. -David On Fri, 20 Aug 2004 12:39:37 +0530, Sandeep Deshpande <[EMAIL PROTECTED]> wrote: > Dear All, > I am working on a very low end machine Ult

Re: [Perl-unix-users] parsing multiple arrays

2004-08-17 Thread David Greenberg
It's not recursive, but it should do the job... my %ids = (); foreach (@arr1) { $ids{$_}++;} ... foreach (@arr8) { $ids{$_}++;} foreach (keys(%ids)) { print $_ if $ids{$_} == 8; } This assumes that each array contains only unique ids. -David On Tue, 17 Aug 2004 08:53:21 -0500, Mehta, Pe

RE: [Perl-unix-users] sorting hash values

2004-07-29 Thread Wagner, David --- Senior Programmer Analyst --- WGO
They are the default variables used by sort for their processing.  That is why you want to be careful if you are using the variables $a and $b and playing with sort besides.   Wags ;)  ps to get a descending sort then switch where a and b are used and it now becomes a descending sort verses a

RE: [Perl-unix-users] sorting hash values

2004-07-29 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > hi! > > I need to organize a list of values i a hash, but i don't know how. > > ex: > > my %urls; > > $urls{uol} = 1; > $urls{aol} = 2; > $urls{txt} = 3; > > ## if i use this: > > @num = sort keys(%url}; > > foreach $number(@num) { >print $number."\n"; > } try

RE: [Perl-unix-users] Simple question about split string

2004-07-27 Thread Wagner, David --- Senior Programmer Analyst --- WGO
  -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Márcio OliveiraSent: Tuesday, July 27, 2004 09:13To: [EMAIL PROTECTED]Subject: [Perl-unix-users] Simple question about split string     Hi all.      I have a simple (I guess) question about spliting s

RE: [Perl-unix-users] How to append specified files into a big file

2004-07-20 Thread Nguyen, David M
way?   For example: $myperl.pl   Enter start date:  0710 Enter end date:   0716   Thanks again, David   -Original Message- From: Jason Vincent [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 12:31 PM To: Nguyen, David M; '[EMAIL PROTECTED]'; '[EMAIL PROTECTE

[Perl-unix-users] How to append specified files into a big file

2004-07-20 Thread Nguyen, David M
Meas.atl00.1040.0710 Meas.atl00.1040.0711 Meas.atl00.1040.0712 Meas.atl00.1040.0713 Meas.atl00.1040.0714 Meas.atl00.1040.0715 Meas.atl00.1040.0716 Meas.atl00.1040.0717 Meas.atl00.1040.0718 Meas.atl00.1040.0719 Meas.atl00.1040.0720   Thanks in advance, David

RE: [Perl-unix-users] Net::FTP question

2004-03-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > Hello all. > > I'm trying to return the "ls" method from Net::FTP to an array like > so: @myarray = $FTP->ls() ; Change @myarray to $myarray > > foreach (@myarray) { @{$myarray} for @myarray > print "$_\n"; > } > > However, I'm getting in return the fo

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

2004-02-27 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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 s

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

2003-12-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: RE: [Perl-unix-users] Index of array element     You have it as an array, but if unique, then why not setup as hash and you would not have to do any searching, but would know right a way with just a simple test vs searching the whole array each time.   Wags ;) -Original Message-

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

2003-11-07 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: RE: [Perl-unix-users] Removing files older than 10 days from a directory if ( int( -M $file) > $days || $days == 0 )  The only thing to be careful is if you decide to make this a service or constantly running script, using the -M is the point in time that the script starte

RE: [Perl-unix-users] RFC: Unix Sysadmin perl snippets

2003-09-29 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > Subject: [Perl-unix-users] RFC: Unix Sysadmin perl snippets > > > Hello everyone, > > I do system administration and programming, and I rely heavily on > Perl to do both these duties. I find that, in the course of my work, > I routinely create one-off scripts - snippe

[Perl-unix-users] How to keep Perl in sync over a large number of servers?

2003-03-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I was asked this question and I have no real answer for the individual. (Outside of my company) It is group of Unix flavor servers(group greater 100 servers) and each server has it's own Perl setup. How do you keep everything in sync? I would assume you have a test setu

RE: [Perl-unix-users] foreach and an array of hashes

2003-03-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: foreach and an array of hashes     learn to use Data::Dumper to see what your data looks like. @emp looks like: $VAR1 = [  {    'position' => 'Cook',    'age' => 50,    'name' => 'Bob'  },  {    'position' => 'Receptionist

RE: [Perl-unix-users] changing time from database to CET?

2003-03-07 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Byrne, Dermot wrote: > aha > > so I'm using timelocal function now > but I'm getting > Undefined subroutine ::timelocal > > does this mean there is a seperate timelocal module i need to install? > > I've got > /usr/lib/perl5/5.6.0/Time/Local.pm > /usr/lib/perl5/5.6.0/Time/gmtime.pm > /usr/lib/pe

Re: [Perl-unix-users] Problems with Net::SMTP

2003-01-23 Thread David Weintraub
d you turn on the Debug option? What does it say? -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; -- David Wein

[Perl-unix-users] Problems with Net::SMTP

2003-01-23 Thread david
I am attempting to write a mailing script using Net::SMTP. My code looks something like this: $smtp = Net::SMTP->new("foohost"); $smtp->mail("david");#This is line #53 in my program And I get the following error: Can't call method "mail" on an undefi

RE: [Perl-unix-users] extract the last character or a string

2002-04-11 Thread david . b . deline
Kwabena, Here is an example of how to pull off the last character of a string and print it. You could also store the value returned by the substr function into a variable... $dir='d:/abs/fez'; print substr($dir, length($dir)-1) . "\n"; Here is an example of checking the last character of a strin

RE: [Perl-unix-users] Please help on GREP command

2002-02-18 Thread david . b . deline
Sorry All... The 'die' command should have read: die "ERROR: Problem executing grep, ($!), stopped" if ( $? == 2 ); grep return codes: 0=Found Match; 1=No Match Found; 2=Error. Dave. -Original Message- From: Deline, David B. Sent: Monday, February 18, 2002

RE: [Perl-unix-users] Please help on GREP command

2002-02-18 Thread david . b . deline
The back-tics will automatically execute the grep command. So, $var=`grep -E -i -c "abc|xyz|pqr" test.txt`; will execute the grep command just like from the shell command line. The output from the grep command will be captured in $var. You can check the value of $? for the return value from

RE: [Perl-unix-users] Please help on GREP command

2002-02-18 Thread david . b . deline
Is that the exact line...? Try: $var=`grep -E -i -c "abc|xyz|pqr" test.txt`; Remember to put your shell commands in back-tics... Dave. -Original Message- From: ba2984 [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 1:23 PM To: perl-unix-users Subject: [Perl-unix-users] Please

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

2001-11-01 Thread david . b . deline
Look into DBM files. I've created a process that is similar to yours (parent process forks child processes) and they are all daemons. I used a DBM file to communicate between them. The only draw back was you will have to implement a file locking schema to prevent corrupting your DBM file. Regar

[Perl-unix-users] DBM functionality via tie & untie

2001-10-03 Thread david . b . deline
I'm using 'tie' & 'untie' in manipulating DBM files for IPC (Inter-Process Communication). I know I have to implement a 'locking' strategy to ensure not to corrupt my DBM files. 1) If I 'tie' to the same DBM file in each of my processes do I ever need to 'tie' again with in each process...? I'm

RE: [Perl-unix-users] Frameset

2001-09-27 Thread david . b . deline
d.jeb [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 27, 2001 1:10 PM To: david.b.deline Cc: perl-unix-users Subject: RE: [Perl-unix-users] Frameset thanks david for your answer, but what i want to do is a repetitive submision (unlimited) from The QUERY frame to the RESPONSE Frame. Wh

RE: [Perl-unix-users] Frameset

2001-09-27 Thread david . b . deline
Well Jeb, (If I understand your question correctly...) You can accomplish this by imbedding JavaScript in your query & response HTML. You will need to have named FORMs in each of your FRAMEs to use the following JavaScript examples: Say you have a text object in your query frame. You can update

Re: [Perl-unix-users] use of carraige return \r

2001-06-06 Thread David Owen
counting down from an arbitrarily high number you could pack spaces to pad the shorter numbers to be the same (fixed) width as the largest (first) number printed. Alternatively, there are some fairly standard routines for clearing a line on a screen. I am not sure how well they work on Wi

Re: [Perl-unix-users] Stopping pdf from cacheing

2001-01-09 Thread Cassell . David
pretty much anything you can write a rule for. So I don't see how the original poster's problem can be solved by Perl. A client-side solution in Java may be possible... David -- David Cassell, OAO Corp. [EMAIL PROTECTED] Senior computing specialist math