Re: how does file gets send to remote machine using perl

2008-05-29 Thread Ken Foskey
On Thu, 2008-05-29 at 19:46 -0400, Richard Lee wrote: > Hi, > > Someone wrote a perl script which manipulate a file and sent to number > of remote system. > I ported that exact script to my local machine but I don't see anything > going out. > Peeking into the script, I see no special module be

Re: 3270 connection via perl

2008-05-29 Thread Ken Foskey
On Thu, 2008-05-29 at 15:23 -0500, jm wrote: > does anyone have a sample script for a 3270 connection via perl? > i've read all i can find for the x3270, x3270-script, c3270, etc. but > i can't quite wrap my head around how the scripting should work. i've > done telnet connections with Net::telne

Re: No such file or directory

2008-05-29 Thread Ken Foskey
On Thu, 2008-05-29 at 11:45 +0100, Mimi Cafe wrote: > my script is in the same directory as my files, but it cannot find the file > ABC.txt in open() below. > > foreach my $supplied (@ARGV){ > # Output file name set of element currently processed. > > # Open file to read from. > open (INPUTFI

Re: difference between FTP and SFTP

2008-05-29 Thread Ken Foskey
On Thu, 2008-05-29 at 11:00 +0530, Rajnikant wrote: > Hi everyone, > > I have question about SFTP's connection modes. FTP can use Active or Passive > mode for same. > > Is SFTP also supports such modes? It does not need the distinction. SFTP connects via ssh on port 22 only. Ken -- To uns

Re: DBI question

2008-05-21 Thread Ken Foskey
On Wed, 2008-05-21 at 23:53 +1000, Ken Foskey wrote: > I have a program that will run literally for days and days. It monitors > logs by file tail. Problem is that I think the DBI is causing problems. > It is constantly connecting and reconnecting to DB2 for every > transaction.

DBI question

2008-05-21 Thread Ken Foskey
I have a program that will run literally for days and days. It monitors logs by file tail. Problem is that I think the DBI is causing problems. It is constantly connecting and reconnecting to DB2 for every transaction. What I would like to do is block the subroutine and check the DBI connection

Re: problem with the script in counting

2008-04-05 Thread ken Foskey
On Sun, 2008-04-06 at 05:39 +0530, pradeep reddy wrote: > Can this impletemented in shell script alsso? Why do you ask this in a perl list? look at `uniq -c`. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] h

Re: Constant not working in hash...

2008-04-04 Thread ken Foskey
id this confusion, add a "+" before the constant, > > my $part = $parts{ $key }{ +PART_NUMBER }; Is there any real advantage of use constant PART_NUMBER => 'P/N'; over my $PART_NUMBER = 'P/N'; Yes I know that it can be modified but conventions such as upper

Re: Perl Stops Processing

2008-04-03 Thread ken Foskey
ng? Look up start in the command shell. http://www.ss64.com/nt/start.html -- Ken Foskey FOSS developer

Re: dinamic cgi with perl

2008-04-03 Thread ken Foskey
my script I learnt AJAX from Mastering Ajax tutorial in developerworks http://www.ibm.com/developerworks/library/wa-ajaxintro1.html There is also a module cgi::ajax in CPAN that you might want to look at. -- Ken Foskey FOSS developer

Re: how do check th argument is passing to running file

2008-03-24 Thread ken Foskey
] ) { die "Two arguments required\n sample.pl mm"; } -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to make all files in one directory to an array

2008-03-20 Thread Ken Foskey
On Thu, 2008-03-20 at 18:20 +0530, sivasakthi wrote: > Hi all, > > How to form array by using the files available in particular directory ? > > for example, /tmp contains the following files.. > > #ls /tmp > example.txt > file1.txt > file2.txt > file3.txt > sample.txt > www.txt > zzz.txt > >

RE: diff of two files

2008-03-20 Thread Ken Foskey
Sounds like homework not a genuine work query. On Thu, 2008-03-20 at 15:14 +0530, [EMAIL PROTECTED] wrote: > Hi All, > > Can somebody please help me on this??? > > Regards, > Irfan > > > -Original Message- > From: Sayed, Irfan > Sent: Monday, March 17, 2008 7:52 PM > To: beginners@per

Re: xml::twig help

2008-03-18 Thread ken Foskey
. Definitely worth the time learning XML::Twig. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: xml::twig help

2008-03-17 Thread ken Foskey
Updated to fix memory problem, you have to purge. Takes over 30 minutes for 120K records. I am sure that the whole process can be done better with a good understanding of the module. Will benchmark XML::Rules though. On Tue, 2008-03-18 at 00:55 +1100, Ken Foskey wrote: > I am extract

xml::twig help

2008-03-17 Thread Ken Foskey
I am extracting addresses from an XML file to process through other programs using pipe delimiter the following code works but this is going to get 130,000 records through it it must be very efficient and I cannot follow the documentation on the best way to do this. After this simple one is progr

Re: dinamic cgi with perl

2008-03-14 Thread Ken Foskey
On Fri, 2008-03-14 at 15:14 +0100, Pau Marc Munoz Torres wrote: > To solve it i was thinking on introduce a javascript code into my cgi, but i > don't know how to pass the variable info between perl and javascript. AJAX - I ended up hand coding my AJAX from scratch but there is a module that I

Re: How do I get the contents of a url?

2008-03-12 Thread ken Foskey
ht command or module to this despite looking quite a bit. > > thanks use WWW::Mechanize; Look it up on http://search.cpan.org -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: FTP server

2008-03-08 Thread ken Foskey
e to set a different set of usernames/passwords than those > of the system. Is it possible? > Thank you. If the remote user creates a key you can add that key into a userid on the receiving box. scp myfile.txt [EMAIL PROTECTED]:/my/directory/path http://polishlinux.org/apps/ssh-tricks --

Re: Are comments allowed before package declarations in modules?

2008-02-26 Thread ken Foskey
afe. The perl best practices book recommends that the documentation (POD) appears at the end of the module. I don't personally like this recommendation because it makes it easier for the programmer to forget to maintain the documentation. -- Ken Foskey FOSS developer -- To unsubscribe, e-mai

Re: How to get error?

2008-01-14 Thread Ken Foskey
> the error is shown in bworser window? Or where are error logs stored? I find that this is caused by the failure to put out CGI headers properly and Apache then says that it is not formed correctly. Search your apache log and find the actual messages. -- Ken Foskey FOSS developer -- To u

Re: Controlling external I/O with Perl

2008-01-13 Thread Ken Foskey
re multiple solutions to this. Are you using Windows or Unix or other operating system. What type of IO are you using? Serial, parrallel, etc. The answers will probably come from http://search.cpan.org -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: Ftp to GDG dataset

2007-10-11 Thread Ken Foskey
r come back and > tell us what kind of mainframe it is. (No, it will not be of any use > to me, but maybe there's someone around here who does have some > experience with those mainframes.) Is your gdg base properly defined? Have you set the site command to specify the correct line lengths? -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Limiting a program to a single running instance

2007-10-03 Thread Ken Foskey
ly. http://search.cpan.org/~elizabeth/Sys-RunAlone-0.07/lib/Sys/RunAlone.pm Another design for this sort of thing is a mutex. There are a few modules for this. This means you can lock out smaller parts of code and keep two copies running concurrently doing different work. -- Ken Foskey F

Re: How to insert data onto an existing XML file

2007-10-03 Thread Ken Foskey
ttom of the file and then create a new 'working' file by simply concatenating the main file with the trailer: File 1 File 2 You can append to file 1 and then concat File 1 and File 2 to create the actual final XML file. In our case creating the final static file in the web

Re: Strange error

2007-09-25 Thread Ken Foskey
there a hyphen not a dot? backatcha.cgi -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Process ID

2007-09-24 Thread Ken Foskey
I am writing the output to a log only you can put all the logic into the loop. open( $process, '|-', $command ) or croak "Unable to create process $command, $!"; while( $line = <$process> ) { print $log $line; } clos

Re: CSV file

2007-09-21 Thread Ken Foskey
x27;,' and saving renaming the text file to CSV will > help or is there any other way to do it?Also I need to bold the header in my > CSV. CSV is comma separated variable. It is a text format and therefore cannot be 'bold'. -- Ken Foskey FOSS developer -- To unsubscrib

Re: PERL/LDAPS

2007-09-19 Thread Ken Foskey
did you install? What error messages have you got? -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: parsing csv-file for inserting in database

2007-09-17 Thread Ken Foskey
between quotes, field delimiters, and newlines: In this case I would use: http://search.cpan.org/~hmbrand/Text-CSV_XS-0.31/CSV_XS.pm I can then set the sep_char in new. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: parsing csv-file for inserting in database

2007-09-16 Thread Ken Foskey
backslash it will divide the output for every character. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: unable to use perl script with post on university wireless network

2007-09-15 Thread Ken Foskey
you are on Unix hit Control-D to end input and see if that completes the process. Run the script in debugging to find out what it is doing: perl -d script -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: want to make a list of all users connected to a network

2007-09-09 Thread Ken Foskey
a reverse DNS lookup. I would start with a search.cpan.org on DNS. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: spliting

2007-09-04 Thread Ken Foskey
ldoc -f sysread read 60 bytes of the file at a time. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Transform my algorithm in perl. Ideas?

2007-09-03 Thread Ken Foskey
> Do you have ideas to say "If there is a file which is old likewise of 10 > days" in perl? Please post what you have done and we can help, otherwise there are many sites on the Internet to hire a contractor for a small job. -- Ken Foskey FOSS developer -- To unsubscribe, e-ma

Re: Parsing qmail-qread data

2007-08-31 Thread Ken Foskey
e( $line = <> ) { if( $line =~ m/#\d/ ) { # hash and a digit $count = 0; while( $line = <> ) { if( $line !~ m/remote/ ) last; # exit first while loop $count++; } print "Count $count\n"; } } -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: type comparison in perl

2007-08-31 Thread Ken Foskey
On Fri, 2007-08-31 at 15:08 -0400, Hunter Barrington wrote: > is there a type() function in perl? i need to be able to test the > contents of an array and > if (type($value)=='string' or type($value)=='int') {print "i win";} if( $value =~ m/^\d+$/ ) {

Re: Printing asterisks in screen

2007-08-25 Thread Ken Foskey
} Think in terms of values: Use 6 instead of $num1 and think about what it says. if ((6 >= 1 && 6 <= 30) # yes this works > { > for (my $i=1 ; $i < 30 ; $i++) > { > while (6 == $i) # infinite loop because $i does not change. > { &

Re: modification

2007-08-20 Thread Ken Foskey
orrect the code. Pet peeve is 'use warnings' and then not cleaning them up. -- Ken Foskey FOSS developer * Just because it is tested and has been in production does not mean it is not wrong. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

modification

2007-08-20 Thread Ken Foskey
intf "%06d", $array[0]; and this causes a non numeric warning. Is there a 'better' way to do this. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Array to Hash

2007-08-13 Thread Ken Foskey
On Mon, 2007-08-13 at 07:47 -0700, Paul Lalli wrote: > On Aug 13, 9:40 am, [EMAIL PROTECTED] (Ken Foskey) wrote: > > On Sun, 2007-08-12 at 22:55 -0400, yitzle wrote: > > > I got an array of values where the order is relevent, eg the ages of > > > Alice, Bob and Charles

Re: Array to Hash

2007-08-13 Thread Ken Foskey
]); > Is there a more elegent way to do it? This is not elegant in this example but it possibly is the answer you are looking for. my %ages{ 'alice', 'bob', 'charles'} = @r; -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: New to Perl

2007-08-10 Thread Ken Foskey
a) where and how I can get it? >b) How to install it on my PC Perl package manager or ppm. This is the ActiveState version of cpan. http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html -- Ken Foskey FOSS developer -- To unsu

Re: Passing each of the files in a directory as parameter to the perl script

2007-08-08 Thread Ken Foskey
ow a maildir works. In most systems I have worked on the /tmp directory is a different file system. Sometimes the time taken to move the file from one file system to another is significant enough to cause problems on a fully loaded system. This solution may break on systems under excessive load. --

Re: Detect Html

2007-08-08 Thread Ken Foskey
On Wed, 2007-08-08 at 11:59 +0530, kapil.V wrote: > Hi, > I tried this to see if the file is an html: > perl -ne '!.+?!s and print "html\n"' html.htm > This does not work. What is the problem? The is rarely on the same line as the in a html file so this

Re: How to read a very large file??

2007-08-08 Thread Ken Foskey
ave read the lines for first 5 min then after some > time it reads the same line also , so it take more time & it is a > waste of time.. Look up File::Tail in CPAN. If you are trying to follow the file as it grows then this is what you want. -- Ken Foskey FOSS developer -- To unsub

use of end

2007-08-06 Thread Ken Foskey
I have a script that must update the reconciliation system using a module. >From a design perspective how safe is it to use DB2 updates in an END block? -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] h

Re: customizing eof chatacter

2007-08-06 Thread Ken Foskey
to change wins. You just have to set them up in the right order and it is not that hard. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: customizing eof chatacter

2007-08-05 Thread Ken Foskey
;', "MYMacFile.txt" ) or die "Unable to open MYMacFile.txt $!"; while( <$input> ) { ... } close( $input ); } -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Cygwin like Module in perl

2007-08-04 Thread Ken Foskey
you will learn the very small differences. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: automatically open ports

2007-08-04 Thread Ken Foskey
n and perform actions. IF you want to reconfigure a router then it is possible that you would connect to the router webserver and reconfigure it. I have to say I would not recommend this, you have lag between reboot and rebuild for a start. -- Ken Foskey FOSS developer -- To unsubscribe,

Re: automatically open ports

2007-08-03 Thread Ken Foskey
u would like a system that is somehow brought up and closed automatically before and after use? -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: FILEHANDLE problem

2007-08-02 Thread Ken Foskey
o take the update and put into another file for processing. I found File::Tail dead easy and it has been running for months monitoring transmission logs on our servers at work. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

Re: Problem with my code

2007-08-02 Thread Ken Foskey
} Or even this to make code predictable: foreach my $key (sort keys %hash) { print $OUT_FILE $hash{$key}; } -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: FW: Html within code

2007-07-29 Thread Ken Foskey
On Thu, 2007-07-26 at 20:42 -0400, Mr. Shawn H. Corey wrote: > Tom Phoenix wrote: > > On 7/25/07, Johnson, Reginald (GTI) <[EMAIL PROTECTED]> wrote: > > > >> open (OMARFILE, "http://learn.perl.org/

Re: reading from a file

2007-07-24 Thread Ken Foskey
ne using: > > tail -n 1 /path/to/file tail -f is the follow option, look it up man tail. The solution you propose you will eventually miss lines from the file, tail -f wont. I have used File::Tail successfully as recommended by Angerstein. It has run for months without issue or mis

Re: connect a database in remote server (can connect to the server via SSH)

2007-07-18 Thread Ken Foskey
ule that you can use. http://perltraining.com.au/talks/dbdproxy.pdf -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Fork()ing and CGI?

2007-07-17 Thread Ken Foskey
date flag. Currently I am reading up on AJAX that seems to be the correct solution to the problem and makes for some slick applications. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: Spreadsheet::WriteExcel problem with large file

2007-07-16 Thread Ken Foskey
On Mon, 2007-07-16 at 14:23 -0700, a_arya2000 wrote: > I have like around 24K rows. Thank you. Sounds like a design problem. Use a database and connect the excel spreadsheet to that data source. Seems a lot easier. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTEC

Re: obtaining file properties

2007-07-14 Thread Ken Foskey
is use of the Win32::File module. However that > would just return the attributes. Im looking to find "size" and "create > date/time". Could someone point me in a good direction so I can read into > further? > I appreciate the help, size is dead easy -s filena

Re: Dynamically loading perl code

2007-07-13 Thread Ken Foskey
On Fri, 2007-07-13 at 08:37 -0400, Mr. Shawn H. Corey wrote: > If you want to run scripts, you should use system(). See `perldoc -f > system` or: open( PROG, '|-', 'myscript.sh options' ) or die ... while( ) { } close PROG if( $? ) { die "I have failed&quo

Re: Global symbol "$var1" requires explicit

2007-07-08 Thread Ken Foskey
On Sun, 2007-07-08 at 15:43 -0700, Paul Lalli wrote: > On Jul 8, 1:25 pm, [EMAIL PROTECTED] (Kilaru Rajeev) wrote: > > On 7/8/07, Ken Foskey <[EMAIL PROTECTED]> wrote: > > > On Sun, 2007-07-08 at 22:27 +0530, kilaru rajeev wrote: > > > > Please explain me whats

Re: Global symbol "$var1" requires explicit

2007-07-08 Thread Ken Foskey
t; Global symbol "$var2" requires explicit package name at sample.pl line 4. > Global symbol "$var1" requires explicit package name at sample.pl line 4. > Global symbol "$var2" requires explicit package name at sample.pl line 5. > Execution of sample.pl aborted due to c

Re: help with syntax using an if statement

2007-07-04 Thread Ken Foskey
he i modifier is ignore case. I think there is a word boundary \< and \> that might be useful rather than ^$ as well. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Problem with runaway format

2007-07-01 Thread Ken Foskey
On Sun, 2007-07-01 at 05:40 -0400, Mathew Snyder wrote: > I have a script which places data 4 levels deep in a HoHoHoH. It grabs > tickets > in our ticket system using the systems API and places attributes about each > piece of activity into the hash. The has is called %tickets. It looks like >

Re: Parsing a file within a jar file

2007-06-27 Thread Ken Foskey
On Wed, 2007-06-27 at 08:11 -0500, Daniel W. Hurn wrote: > Does anyone have any suggestion on how to examine/parse a file within a > jar file? jar is a java file and I think it is simply a zipped file. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: Reading a particular line from a file

2007-06-20 Thread Ken Foskey
rds, the index is then manipulated and I can read the records in new order by doing a seek. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Iterate through a hashref using XML::Simple (real post)

2007-06-15 Thread Ken Foskey
would this reasonably handle 70,000 statements containing LOTS of details in them? I need to process this statement by statement but it would totally blow memory. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Removing decimal points

2007-06-10 Thread Ken Foskey
On Fri, 2007-06-08 at 19:52 +, ash wrote: > Hello there! > > I need to remove decimal points from numbers. For eg 1.23 or 1.77 > would be just 1. Any suggestion is appreciated. Thank you. $i = 1.77; $j = int $i; print $j; -- Ken Foskey FOSS developer -- To unsubscribe, e-

Re: CPAN and Windows

2007-06-01 Thread Ken Foskey
nto perl for windows? Look for ppm Perl Package Manager and install with that. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Outlook CSV Parser

2007-05-30 Thread Ken Foskey
ia a remote connection? Is there another format available? I doubt a simple regex will do it if the CSV modules do not work. What data do you have problems with? Without samples there is nothing we can do. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Re: RegEx again

2007-05-19 Thread Ken Foskey
oin '|',@search; > print "1" if ( grep $searchRegEx, @list1 ); > print "2" if (grep $searchRegEx, @list2); Problem is you need slashes. print "2" if (grep /$searchRegEx/, @list2); I also wonder why you did not use the simpler: $searchRegEx = '

overriding posix::uname

2007-05-18 Thread Ken Foskey
sub is_dev { my ($server, $host) = POSIX::uname(); if ($host eq "aixmbk10") { return 1; I want to test this module in a test script. SO I want to code the various servers and check that it works. Is there a way to override the call to POSIX::uname Thanks Ken --

Re: Thoughts on comments

2007-05-15 Thread Ken Foskey
On Mon, 2007-05-14 at 02:16 -0400, Mathew Snyder wrote: > Is it possible to use too many comments? I'm looking at a script I wrote and > think I may have made it less clear by trying to make it more clear. Absolutely. Commenting in a useful clear way I believe takes years to master. Maintaining

Re: File Handling. Reading and Writting.

2007-05-15 Thread Ken Foskey
> It looks as if you're trying to edit a text file "in place". Although > that's possible for some simple cases, it's generally easier to use > Perl's $^I functionality. > What is $^I? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn

Re: About a reg expression ?:

2007-05-13 Thread Ken Foskey
> The syntax is as follow: > > */**a (?:black|grey|white) cat/* Try this: * Regex Coach ( http://weitz.de/regex-coach/ ) Nice to explain how things work -- Ken Foskey FOSS developer PS: Thanks goes to http://perltraining.com.au/ for showing me this one. -- To unsubsc

Re: regexp ...

2007-05-12 Thread Ken Foskey
On Fri, 2007-05-11 at 10:46 -0700, oryann9 wrote: > > > > Funny I had to explain split /|/, $str returning an > > array of characters. > > > > -- > > Ken Foskey > > FOSS developer > > > > Excellent Ken, > > thank you, but why th

Re: regexp ...

2007-05-11 Thread Ken Foskey
(split //, $str) { > } Funny I had to explain split /|/, $str returning an array of characters. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: hash containing a hash, sorting keys help

2007-05-05 Thread Ken Foskey
On Sat, 2007-05-05 at 07:19 -0700, Tom Phoenix wrote: > On 5/5/07, Ken Foskey <[EMAIL PROTECTED]> wrote: > > > foreach my $child (sort keys( $parent{$pid} )) { > > dump_process( $child ); > > } > > > > Type of arg 1 to keys must be

hash containing a hash, sorting keys help

2007-05-05 Thread Ken Foskey
'user' => 1 }, #!/usr/bin/perl -w # vi:set sw=4 ts=4 et cin: # $Id:$ =head1 SYNOPSIS Provide a tree function of processes on a unix server usage: visualise.cgi user=username =head1 DESCRIPTION Use the PS command to generate a tree of command

Re: regular expression

2007-05-04 Thread Ken Foskey
On Sat, 2007-05-05 at 01:01 +0200, xavier mas wrote: > HI list!, > > I have a file with labels and a small text inside. When this text is > different > of a pattern text (n, for instance), this label must be deleted, for > instance: > > f(more text)n(more text)mpl... > > (labels containing so

Re: file lists and diffs?

2007-05-04 Thread Ken Foskey
or > some such and adding all those files to a tar command or some such. > > Has anyone done such a thing or know of a module I should look at to achieve > this? You might want to look at the rsync command rather than rolling your own. -- Ken Foskey FOSS developer -- To unsubs

Re: File::Basename issues

2007-04-28 Thread Ken Foskey
//server/share/directory Activestate is a perl implementation that is straight windows if you like. This might be a better fit to your task. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

really bad use of postfix

2007-04-28 Thread Ken Foskey
] ne > "VPS"); > > > if ($a2kqual[4] eq "VPS") { > exec_rqst('stga2k_vps.pl',$FileNameIn); > } > else { > exec_rqst('stga2kif.sh',$FileNameIn); > } > -- Ken Foskey FOSS d

Re: Test of scripts with Test::More

2007-04-26 Thread Ken Foskey
/bin/perl -w # vi:set sw=4 ts=4 et cin: # $Id: SafeMove.t,v 1.2 2006/04/24 02:43:07 foskey Exp $ =head1 NAME SafeMove.t =head1 DESCRIPTION Ensure that the SafeMove module is functioning correctly. =HEAD1 AUTHOR Ken Foskey =cut # Libraries use strict; use warnings; use Test::More; use

Re: Perl error

2007-04-26 Thread Ken Foskey
On Wed, 2007-04-25 at 10:20 -0500, Kevin Viel wrote: >Thanks. I have been using this program without problem for a while, > I'd like to say over a year, but I am not sure. > >So, could it be that somehow the environment path variable relating > to perl had been changed? Otherwise, I c

Re: File::Basename issues

2007-04-26 Thread Ken Foskey
On Wed, 2007-04-25 at 17:15 -0700, Nishi wrote: > Hi: > > The File::Basename from 5.8.0 doesnot work in Perl 5.8.2 or Perl 5.8.7. Is > there any particular reason. Are yhou using activestate or cygwin perl. cygwin will do that because the filename you provided is not a cygwin filename. cygpath

Re: Mails should not go in SPAM Box

2007-04-12 Thread Ken Foskey
NS looks up where the email is supposed to come from ie internal.mydomain.com.au and it fails because this is not a public machine address. Solution was to fiddle the email address to remove the machine name. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: Dialog and Tempfiles in Perl

2007-04-11 Thread Ken Foskey
On Wed, 2007-04-11 at 12:09 -0300, Rodrigo Tavares wrote: > Hello, > > I like to know, if exist anything as tempfile and http://search.cpan.org/~tjenness/File-Temp-0.18/Temp.pm > dialog program in Perl. http://search.cpan.org/~uncle/Dialog-0.03/Dialog.pod There are many other better solutions

Re: Sorting dir output

2007-04-10 Thread Ken Foskey
module File::Find this should be able to help you. For a simplification of the other process you can use opendir function to read the files in a directory one by one and then issue the stat as in the other answer. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: How to "source" another perl-file into one

2007-04-08 Thread Ken Foskey
do it with ". > filename", and in perl? > > Thanks for any ideas and help. Modules is what you are after. create your subroutines or definitions that you want to use in a file called xyz.pm (xyz should be something meaningful) use lib '/where/my/module/is/'; use xyz

Re: Calling bash things inside perl script.

2007-04-03 Thread Ken Foskey
gt; I wanted to call and use them in a perl script.I am not sure how > to do this.I did a cpan search but did not find anything > helpful. > > Any idea how to do this ? look up dotsh it has some ability to integrate shell and perl. -- Ken Foskey FOSS developer -

Re: MS Word translation

2007-04-03 Thread Ken Foskey
On Tue, 2007-04-03 at 11:56 +0800, Jen mlists wrote: > Hello, > > Would you please tell me what's the correct module for translating a > word document to the plain text?Thanks. There is a Perl Interface in OpenOffice.org that might be useful for you. -- Ken Foskey FOSS d

zoned decimal

2007-03-26 Thread Ken Foskey
Is there a module that deals with zoned decimal from the mainframe '}' is plus zero for example, after it is converted to ASCII? Convert::IBM390 only seems to handle it in ebcdic format and it is already mucked up before we get the file. -- Ken Foskey FOSS developer -- To unsubscri

Re: perldoc -q "How can I make my Perl program run faster?"

2007-03-24 Thread Ken Foskey
7;t then don't waste your time looking to tenths of a second spend it on answering another business question that may make thousands of dollars. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: GUI with Perl

2007-03-17 Thread Ken Foskey
On Thu, 2007-03-15 at 23:33 -0400, yitzle wrote: > TIme for a quick factoid about me: I'm running Perl off Cygwin. No > Gnome installed here. GTK is available on Windows, I am reasonably sure it is in cygwin as well. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Question about system call

2007-03-13 Thread Ken Foskey
On Tue, 2007-03-13 at 02:29 -0400, Mathew wrote: > I recently forgot about the unlink function and had been trying to > remove files using the less efficient system call to run "rm -f > /path/to/files". I found, however, that this didn't work at all. > > I've since replaced it with unlink and get

Re: private method

2007-03-04 Thread Ken Foskey
On Sun, 2007-03-04 at 14:31 +0100, D. Bolliger wrote: > Chas referred to a _convention_ - which does not enforce privacy. > IMO it's useful, otherwise it would not be widely used, and for example, > Test::Pod::Coverage would require subroutines starting with an underscore to > be documented. :-)

Re: Home directory

2007-02-26 Thread Ken Foskey
On Mon, 2007-02-26 at 11:40 -0500, [EMAIL PROTECTED] wrote: > Or depending on when you need this found. you might able to use. > > chomp($home=`pwd`); This is so unlikely to work I would never do this. I start scripts in my home directory < 10% of the time. -- Ken Foskey FO

Re: converting to mixed case

2007-02-26 Thread Ken Foskey
est way to deal with this is to build your input application so that you know what is a state and what is a suburb, you do have hope of doing something sensible then. -- Ken Foskey FOSS developer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

  1   2   >