RE: Active 'back' buttons

2004-03-29 Thread Kipp, James
Hi guys. What's the 'usual' way (if there is one) of implementing an 'active' back button (which does the equivalent of the browser's back button but is implemented in CGI code)? It is usually done with javascript and pretty easy to do. Although you may already be aware of this and

RE: Exit

2004-03-03 Thread Kipp, James
I hope, and think, that I've helped several people to be more eloquent in Perl. Absolutely ! I remain available through my email address, but I have other, rather sad things to do. Thank you all for your intelligent questions and elaborations. I, for one, am a better perl programmer

RE: How to su in a script if su needs a pswd ?

2004-02-17 Thread Kipp, James
Hello, I am running a command as part of my script on a Unix box for which I need to su to a different username. This su requires a password as well. I could not find any option of passing the password in su. Tried the shell script solution of here docs : su TillEnd admin test

shorten code

2004-02-16 Thread Kipp, James
Hi I want to split the string below into rows and then columns. I know i can do a couple of splits, push array refs onto a new array, regex it, etc.. But I was know the talented people on this list can shorten the code considerably. I want to split at each new line for the row, then split the row

RE: shorten code

2004-02-16 Thread Kipp, James
my @rows = map [split], split /\n/, $str; for (@rows) { $_-[2] =~ tr/%//d } Neat. You saved me 6 lines of code :) Thank You !! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: shorten code

2004-02-16 Thread Kipp, James
my @rows = map [split], split /\n/, $str; for (@rows) { $_-[2] =~ tr/%//d } Neat. You saved me 6 lines of code :) Thank You !! Make sure its meaningful to you or someone else maintaining it. I would rather see 6 extra lines of code and have it mean something to me

RE: shorten code

2004-02-16 Thread Kipp, James
$str = /var 0.9950% /usr 0.5871% /tmp 0.49 1% my @rows = map [split], split /\n/, $str; for (@rows) { $_-[2] =~ tr/%//d } Not quite! Because the string starts and ends with newslines

RE: shorten code

2004-02-16 Thread Kipp, James
my @data = map { tr/%//d; [split] } split /\n/, $str; :) Clever! but this may be the point where where it may be confusing as you and Paul mentioned :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: mass-replacing large block of text

2003-12-30 Thread Kipp, James
table border=0 width=100% height=5% How can I replace everything after that particular line with a custom block of text? Thanks. Maybe using tell() and truncate() on the file?, then an inline edit/insert. -- $file = 'yourfile'; open (FH, + $file) or

RE: Frustrated newbie question

2003-12-05 Thread Kipp, James
I have a file whose format looks like this: name1 name2 name3 name4 name5 name6, etc. The names are separated by spaces. I need the names to be one name per line, like this: name1 name2 name3, etc. Here is one way: while () { @line

remove control chars

2003-12-03 Thread Kipp, James
Hi I have some C code that I need to convert to perl and I am pressed for time, which is why I am posting this. All the code does is read each character from either STDIN or a file and replaces any ASCII control characters with a space. Is the perl getc() function the best way to look at one

help with removing control chars

2003-12-03 Thread Kipp, James
Hi I have some C code that I need to convert to perl and I am pressed for time, which is why I am posting this. All the code does is read each character from either STDIN or a file and replaces any ASCII control characters with a space. Is the perl getc() function the best way to look at one

RE: remove control chars

2003-12-03 Thread Kipp, James
Is the perl getc() function the best way to look at one char at a time? The C code looks like below. I have some ideas but I am not sure of the best way to represent these char ranges in perl -- while ( !feof(fin) ) { ch=getc(fin); if ( (ch=0176) (ch=040) ||

RE: remove control chars

2003-12-03 Thread Kipp, James
if ( (ch=0176) (ch=040) || (ch=='\n') ) { putc( ch, stdout ); } else { putc( ' ', stdout ); } } perl -pi.bak -e 'tr/\040-\176\n/ /c' file Thanks. For some reason, this is not working like the C code is ( my desired result) C: echo | cvt adc def hij

RE: remove control chars

2003-12-03 Thread Kipp, James
Thanks. For some reason, this is not working like the C code is ( my desired result) C: echo | cvt adc def hij Perl: echo abc^Hdef\nhij | perl -pe 'tr/\040-\176\n/ /c' abc^Hdef hij perl -pi.bak -e 'tr/\040-\176\n/ /c' file That'll change all characters that are

RE: remove control chars

2003-12-03 Thread Kipp, James
THanks. worked fine as well ! -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 4:24 PM To: [EMAIL PROTECTED] Subject: Re: remove control chars Including \t and \n? Is the perl getc() function the best way to look at one

RE: Can' t read all bytes from Socket

2003-12-02 Thread Kipp, James
I happened to be working on a TCP/IP server when this hit my desk and having Programming Perl open to the correct page, thought I might as well quote the select... line from the client code... select ((select(Server), $| = 1)[0]; print Server Howdy\n; $answer = Server;

RE: Script Exit Status

2003-12-02 Thread Kipp, James
Is there a way to have a perl script exit with a status code? For instance I have ascript that calls another script via system(somescript); I want to then be able to get the exit status of that script. Paul Have you seen the perldoc for system ? snip The return value is the

Can' t read all bytes from Socket

2003-12-01 Thread Kipp, James
Hi I have simple client/server socket scripts that that send some data from the server to the client. It works fine, except the client can't seem to read more than 2920 bytes from the server using sysread(). So the data I am sending over gets cut off. Here is the relevant code: --- connect(SOCK,

RE: Can' t read all bytes from Socket

2003-12-01 Thread Kipp, James
Yes. Calling sysread() gets you what's ready to be read UP TO the amount of data you specify. The rest probably just wasn't available yet. There could be a lot of reasons for this: network lag, operating system buffers, etc. Thanks. I tried turning off buffering on both ends, that

RE: Can' t read all bytes from Socket

2003-12-01 Thread Kipp, James
Thanks. I tried turning off buffering on both ends, that did not work. In your example, you only call sysread() once. Is that how you were doing it? If so, that's the mistake. The one call got you part of the data. Then you would loop, check and eventually call again to get

RE: fixed width variable

2003-12-01 Thread Kipp, James
Greetings, I have been searching for a way to do this and have not had any luck. I am using localtime() to determine the day of the month. I need to make sure the variable it returns will always be 2 digits and padded with zeros. For example currently it is like: $var =

RE: Can' t read all bytes from Socket

2003-12-01 Thread Kipp, James
Yes, make sense, but not sure how to check. Is this where select() comes in? You got it. Let me know if you want to see the entire code I am currently working with. Sure, especially if your client and server are small, post away. Tell me what you're really trying to

RE: Can' t read all bytes from Socket

2003-12-01 Thread Kipp, James
one way simplistic way to try the sysread() approach would be go with something like my $message; my $bytes=1; while ($bytes) { $bytes = sysread(SOCK,$buf,4096); $message .= $buf; # or try say # last if

RE: odd perl linux socket query problem.....

2003-10-06 Thread Kipp, James
use Socket; my $serverip = 194.109.69.91; my $serverport = 27960; my $getstatus = \xFF\xFF\xFF\xFFgetstatus; //THIS IS THE LINE I'M HAVING PROBLEMS WITH IN LINUX BEING SENT $ipaddr = sockaddr_in($serverport, inet_aton($serverip)); $protocol = getprotobyname(udp); socket(SOCKET,

RE: LWP error string

2003-08-21 Thread Kipp, James
Sorry for leaving the suubject out previously! With LWP or LWP::UserAgent I can check if the request was ok and then print the content if it was like so: if ($res-is_success) { print $res-content; } But I havn't found a way to see what the error is if it fails. So I have to

RE: hex2Bin

2003-08-18 Thread Kipp, James
hi , I have a file cointaing 1024 hex numbers . I want to convert them to Bin. Please help try something like this: $hex = 0xff; $bin = unpack(B32, pack(N, hex $hex)); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: hex2Bin

2003-08-18 Thread Kipp, James
$hex = 0xff; $bin = unpack(B32, pack(N, hex $hex)); The above assumes big-endian byteorder. For little-endian use V instead of N. Or just use L when the file has the same byteorder as the machine you are running this script on. Btw, the hex() above is probably wrong. hex()

RE: setting environment variables in IIS

2003-08-14 Thread Kipp, James
How can I set up environment variables to be used in the script in IIS ? use the %ENV hash. example: $ENV{PATH} = /bin/foo:/usr/bin; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Read only variabls

2003-08-14 Thread Kipp, James
I guess what I'm getting at is: If my module exports variables can I make it so they can't be changed? IE use MyStuff qw($_joe $_mama); # now they should have $_joe and $_mama exported from the module. print $_joe $_mama\n; # ok my $joe = $_joe;# ok $joe =~

Why use symbolic refs?

2003-07-31 Thread Kipp, James
In the Advanced Perl book it gives an example of using sym ref: -- process a command-line option such as -Ddebug_level=3 and set the $debug_level variable. This is one way of doing it: while ($arg = shift @ARGV){ if ($arg =~ /-D(\w+)=(\w+)/) { $var_name = $1; $value = $2;

RE: Why use symbolic refs?

2003-07-31 Thread Kipp, James
Or am i missing the point? Yeah, I think you did. This is the real point... $x = foo; $$x = 20;# this sets $foo print $foo; # prints 20 print $x;# still prints foo!. But like I said, this is usually a bad way of doing things. It is better to use a hash when you

RE: Checking for a directory

2003-07-24 Thread Kipp, James
-d $dir #if true than is a dir -f $file #if true than is a regulare file -Original Message- From: Rus Foster [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 8:39 AM To: [EMAIL PROTECTED] Subject: Checking for a directory Hi All, Just trying to work out the code to

RE: hash question

2003-07-23 Thread Kipp, James
maybe someone can enlighten me(if it is possible). I did a very simple loop/save/open/display to test hash. ... ... for(1..99){ $result{$_}=$_; } ##saved it in a dbm file and reopen to the file ##when i open the file i just read all the keys and display ## the key .

RE: Masking bits in variables ?

2003-07-23 Thread Kipp, James
Hi, I am new in PERL. I wanted to know how to perform bitwise operations in PERL like masking some bits , anding oring bits. Also how to have user interfaces in Perl ? Should I use tools like TK Sachin Read perldoc perlop, here is a snip: -- Bitwise And Binary returns its

RE: Masking bits in variables ?

2003-07-23 Thread Kipp, James
Hi, Thanks for the help. I also had another doubt how do i handle hex numbers like if i have a variable as $var = ff how do i get 255 , also if I and 8F to 0F can I get 0F ? sincerely Sachin Please always reply to the group. if your $var contains the string ff, you can print

RE: Porting perl scripts on windows

2003-07-17 Thread Kipp, James
here is a nice tutorial to start with: http://www.sthomas.net/roberts-perl-tutorial.htm -Original Message- From: Gupta, Sharad [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 12:04 AM To: Gupta, Sharad; [EMAIL PROTECTED] Subject: RE: Porting perl scripts on windows Ok,

RE: secure socket connection

2003-07-17 Thread Kipp, James
I'm trying to set up credit card processing and one of the first steps is to establish a secure socket connection - how can i do it? (My host does support it) there are som modules for this: IO::Socket::SSL Net::Daemon::SSL -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Sockets

2003-07-17 Thread Kipp, James
In the documentation of socket appears the fllowing: $sockaddr = 'S n a4 x8' What means this??? it is a template for packing the generic C socket adr structure. readup on sockets for deeper explanation. the adt string is packed into structure of: a signed short, followed by an integer in

RE: Retrieving cookie expiration date

2003-07-16 Thread Kipp, James
read 'perldoc cgi', go to the http cookies section. you can retrieve a cookie into a hash which will include the exp date. HTH Jim -Original Message- From: Sawsan Sarandah [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 16, 2003 12:44 AM To: [EMAIL PROTECTED] Subject: Retrieving cookie

RE: Problems with Sockets

2003-07-16 Thread Kipp, James
use IO::Socket; $server_port = 514; $server = IO::Socket::INET - new(LocalPort = $server_port, Proto = udp) or die Couldn't be a udp server on port $server_port : [EMAIL PROTECTED]; while ($him = $server -recv($datagram, 1024)) { ($portno, $ipaddr) =

RE: Help !!! on sockets

2003-07-16 Thread Kipp, James
When I print the @buffer outside the while loop , I am not getting the output. Note : The commented line i.e. #print Server: $_; works and prints all the lines read from the socket. Please somebody tell me what error have I been making. Regards Rajeev

RE: Low Level Socket Programming

2003-07-09 Thread Kipp, James
hello, I have written a tcp socket server using the Perl Cookbook and Use Socket. This is nice an works well. However, i want to write a server that can listen for a special packet. So i need to get down futher that the Perl Cookbook shows. I want to see each packet and be able to look

RE: RE: Low Level Socket Programming

2003-07-09 Thread Kipp, James
To: Kipp, James Cc: [EMAIL PROTECTED] Subject: Re: RE: Low Level Socket Programming He He, This is a dandy little one. Mark G - Original Message - From: Kipp, James [EMAIL PROTECTED] Date: Wednesday, July 9, 2003 7:45 am Subject: RE: Low Level Socket Programming

RE: Disk space on windows 2000

2003-07-07 Thread Kipp, James
I work with ActiveState version. Downloaded Win32::AdminMisc from ftp://www.roth.net/pub/ntperl/adminmisc/20030625/Bin Can't locate ADMINMISC_XXX.PLL. What am I missing? follow these instructions: - IF you are using the ActiveState's version 5.005 (aka ActivePerl): a) Copy the

RE: TCP/IP question

2003-07-02 Thread Kipp, James
But my server only ever sees the first message from any given client. Subsequent messages to my server are ignored. Does anyone know what I have to do to get my server to handle more than one message? #!/usr/bin/perl use warnings; use strict; my ($server, $server_port,

sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
I am trying to hand pack an net addr. On the server end (linux - i386) it works fine.: $addr = pack($template,AF_INET,$port,$iaddr); bind(MY_SOCKET, $addr) || die $0: Cannot bind .. $!\n; -- on the client end (win2k - i386) it fails. -- $template = 'S n C4 x8'; $port = 6668; $proto =

RE: Disk space on windows 2000

2003-07-01 Thread Kipp, James
Hi, I was looking around google, couldn't find it: how do I get a disk situation report on WIN2K? I want to delete the oldest log files beyond x% out off disk space. for disk space stats you can use: 'Win32::AdminMisc::GetDriveSpace' and also 'Win32::AdminMisc::GetDriveGeometry'. to

RE: sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
maybe because of big Indian small Indian problem ?? just a though I never pack'd it my self. good thinking, but the CPU is the same on both machines. It is Endian btw.. :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Disk space on windows 2000

2003-07-01 Thread Kipp, James
Downloaded the module in zip file, put AdminMisc.pm in c:\perl\lib c:\perl\site\lib. Still I get: Can't locate Win32/AdminMisc.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site /lib .) How do I work with it? check out the readme file that is included. there is a little more to it

RE: sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
$template = 'S n C4 x8'; Your template is wrong. You need 'x C n a4 x8' (or 'n n a4 x8'). Thanks, I will give that a shot. Altough, all of the docs that i read pack the structure with the 'S n C4 x8' template and it does work on the Server end. The returned value from gethostbyname is

RE: sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
Your template is wrong. You need 'x C n a4 x8' (or 'n n a4 x8'). Thanks, I will give that a shot. Altough, all of the docs that i read pack the structure with the 'S n C4 x8' template Is that in the Perl docs somewhere? no, they say to use sockaddr_in() of course. docs I found on

RE: sockets: packing an inet sructure

2003-07-01 Thread Kipp, James
$addr = (gethostbyname(10.1.101.12))[4]; $paddr = pack($template,AF_INET,$port,$addr); If you dump out $paddr right here, you'll see that the address portion is all zeros, so you're really binding to INADDR_ANY and not to the specific address. However, the AF_INET is still out of

RE: File Handles in subroutines

2003-06-25 Thread Kipp, James
What do I need to do in order to use a filehandle that was opened earlier in a program within a subroutine? I've included an example of the code I have that is not doing what I would like. Basically, I never get any output to the file. If I change it so that it doesn't use the

RE: Mastering Learning Perl on Win 32 Systems

2003-06-25 Thread Kipp, James
Any advice on getting through the LP/Win 32 book? I know I can do it but I'm getting tripped up. I've moved on to other chapters and I'm about to read Chapter 7 but I still haven't gotten arrays and hashes. My study routine consists of reading and taking notes; studying the notes; going

RE: perl redirection

2003-06-25 Thread Kipp, James
Does anybody know how to redirect from a perl page with a print Content-type: text/html\r\n\r\n; code line? are you trying to redirect a client to another web site or page? you can try a google search for redirect web page and get tons of info you can use a cgi script like below: use

RE: Mastering Learning Perl on Win 32 Systems

2003-06-25 Thread Kipp, James
Post the exercise and the code you tried. we will help you -Original Message- From: Anthony Beaman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 8:55 AM To: [EMAIL PROTECTED]; Kipp, James; [EMAIL PROTECTED] Subject: RE: Mastering Learning Perl on Win 32 Systems Mostly

RE: perl redirection

2003-06-25 Thread Kipp, James
Yes James, I'm trying to redirect to a php page, but as I use print Content-type: text/html\r\n\r\n; whe I user your cgi use CGI; my $q = new CGI; . print $q-redirect( ../index.php ); it only writes Status: 302 Moved Location: ../index.php can you explain what you are trying

RE: perl redirection

2003-06-25 Thread Kipp, James
Yes James, I'm trying to redirect to a php page, but as I use print Content-type: text/html\r\n\r\n; whe I user your cgi use CGI; my $q = new CGI; . print $q-redirect( ../index.php ); it only writes Status: 302 Moved Location: ../index.php forgot to mention.

RE: How to retrieve a MAC address

2003-06-19 Thread Kipp, James
you can parse ifconfig or arp and get it -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 12:24 PM To: [EMAIL PROTECTED] Subject: How to retrieve a MAC address Hi All, I need to retrieve the MAC address of my local system from

RE: How to retrieve a MAC address

2003-06-19 Thread Kipp, James
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 12:49 PM To: [EMAIL PROTECTED] Subject: RE: How to retrieve a MAC address Do you have any examples of this in action? -Original Message- From: Kipp, James [mailto:[EMAIL PROTECTED] Sent

RE: very beginner

2003-06-11 Thread Kipp, James
Could someone direct me to the correct module to use for monitoring an Internet connection? I just want to see the IP addresses of the machines trying to get into my PC. Get a progam like Ethereal: http://www.ethereal.com/ or: netstat tcpdump lsof and roll your own with Socket

RE: Newbie not getting expected values from s/// operator

2003-05-30 Thread Kipp, James
Next I try to loop through the results and extract parts of each string like so: $tmp = ; while (PROPS) { $tmp .= s/photoshop:([^]+)([^]*)/$1: $2/; } Doing a print on $tmp, yeilds 1 None of the lines in PROPS contain a single digit character so why am I

RE: String removal

2003-03-27 Thread Kipp, James
Hello. I need to know how to remove a substring from a string and a how to remove a simple character occurrence from a string. Thanks in advance! Christian. perldoc -f substr perldoc -f splice perldoc perlre -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

RE: Find Text in files

2003-03-26 Thread Kipp, James
I am looking to write a script that will look in a file for a list of text strings to search for like req_ req_bbb req_ccc and search all the files in a subdirectory and below for the string, if it is found, then it prints out the the original string followed by the file name for

RE: Binary File Reading

2003-03-26 Thread Kipp, James
Hi, I'm new in Perl, and I need to analyze a binary file, byte per byte. $/ = undef; open FILE, file.bin or die $!; binmode FILE; my $data = FILE; is that ok? how can I get one byte, the next, the next, etc? perldoc -f sysread -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Simple perl program

2003-03-25 Thread Kipp, James
I need a very simple command line perl program that takes two arguements, the frist being a filename and the second being a word to be searched for in that file. Then I simply want the result to print yes if arg2 is found, or no if it is not. Thanks for your help what code do you

RE: Simple perl program

2003-03-25 Thread Kipp, James
Im now trying to list a directory, but only the files in that directory that finish with a perticular ending, say .html, i.e *.html. Ive got this far, but having troubles, wondering if you could have a look for me: you are pretty close, try the following use strict; use warnings;

RE: Mkdir 0766

2003-03-25 Thread Kipp, James
Why does this not create a directory with perm drwxrw-rw- instead I get drwx--. man umask man mkdir -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Trying to block out BGCOLOR

2003-03-20 Thread Kipp, James
I'm making something, and need to block out BGCOLOR attribute. The problem is, the BGCOLOR could be with or without quotation marks. This is the code I used: $article =~ s/ bgcolor=(?)(.*?)(?)//gi so you are saying it could be bgcolor or bgcolor ? how about something simple like:

RE: Trying to block out BGCOLOR

2003-03-20 Thread Kipp, James
I'm saying it could be bgcolor=COLOR or bgcolor=COLOR Yes I realize. I believe drieux's solution, or an adaptation of it, is what you need I would of course go with say: # # sub un_colour {

RE: press any key

2003-03-19 Thread Kipp, James
Quite a simple request, but I've had trouble finding an answer. I'd like my program to wait until the user presses any key, and then just continue. Is there an easy way to do this? A way without modules? Hi Nick. This will do the trick: while (1) { print Press

RE: Saving STDERR into a variable

2003-03-19 Thread Kipp, James
I was wondering if it's possible to save the error of a DOS command from the error stream into a variable. you could try the old 21 trick $out = `$cmd 21`; as others have mentioned, the above may depend on your which win32 OS you are using. works fine on my win2k workstation.

RE: Fork ?

2003-03-19 Thread Kipp, James
It doesn't do what I want at all. It spawns way too many processes. (and I get errors in win 2000). Basically, I want to spawn a process which does something (call a subroutine) The main process should just continue pumping data which is spawned up to 10 processes. Else it should wait

RE: Problem with regular expressions!!!

2003-03-18 Thread Kipp, James
This is the code. # $file_completename =~ /(.*?)\.(.*)/; if ($2 eq $extension]) { #DO SOMETHING!!! } # did u turn on warnings and use strict ?? did you catch the ] at the end of $extension? i tried this on my

RE: Conversion of Text file to CSV

2003-03-18 Thread Kipp, James
I need to convert 1+ logs to the CSV file format. Here's an example of both the old and new formats: http://www.geocities.com/pelpme/old.txt http://www.geocities.com/pelpme/new.txt Does anyone have any good methods to share of how to approach this? My background in PERL is

RE: Saving STDERR into a variable

2003-03-18 Thread Kipp, James
Hello, I was wondering if it's possible to save the error of a DOS command from the error stream into a variable. For example, the STDOUT of a DOS command can be saved to a variable this way: $var = `dir`; # Using back quotes but this won't save anything from STDERR. you could

RE: Help with File::Find

2003-03-10 Thread Kipp, James
find { preprocess = sub { grep( /My\s+Documents/, @_) }, wanted = sub { print $File::Find::name\n} }, 'c:/test2'; Firstly don't forget that Windows treats the 'My Documents' directory as a special case. Windows Explorer shows it at the same tree level as My Computer and

RE: Production Mode: Warnings?!

2003-03-10 Thread Kipp, James
I'm just trying to get a general feeling here from the community. I have a script that I am getting ready to turn over in production mode. I am using 'use strict' of course, and during my coding and testing, have enable warnings. you can keep the warnings and use some means of

Help with File::Find

2003-03-07 Thread Kipp, James
Hi Is there a way to get File::Find to TOTALLY ignore a directory?? See comments in code for what I mean: find ( \wanted, 'f:/users/user1'); sub wanted { ## HERE: even though it returns when it sees a dir called # with Profile, it comes right back to where it left of, in other

RE: Help with File::Find

2003-03-07 Thread Kipp, James
Please ignore this post. This was meant for the perl-beginners list. My apologies. -- -Original Message- From: Kipp, James Sent: Friday, March 07, 2003 1:57 PM To: [EMAIL PROTECTED] Subject: Help with File::Find -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Help with File::Find

2003-03-07 Thread Kipp, James
Hi Is there a way to get File::Find to TOTALLY ignore a directory?? See comments in code for what I mean: find ( \wanted, 'f:/users/user1'); sub wanted { ## HERE: even though it returns when it sees a dir called # with Profile, it comes right back to where it left of, in other

RE: Help with File::Find

2003-03-07 Thread Kipp, James
Of course. #!/usr/bin/perl -l use File::Find; use warnings; # # ignore # find { preprocess = sub { grep $_ ne __FILE__, @_ }, wanted = sub { print } }, .; # # don't recurse # find sub { if ($_ eq __FILE__) { ++$File::Find::prune }

RE: Help with File::Find

2003-03-07 Thread Kipp, James
Steve's suggestions worked great for ignoring or not recursing directories, but I am unable to filter out all directories not named My Documents . I have tried using regex and grep to filter them out but no luck this fails, just goes to the root directory and exits, and the docs really don't say

RE: Can't fork using open

2003-03-05 Thread Kipp, James
=Beginning of the citation== '-' is not recognized as an internal or external command, operable program or batch file. =The end of the citation I use windows xp, activestate perl build 804. Can anyone explain why I'm getting this error?

RE: Can't fork using open

2003-03-05 Thread Kipp, James
Not sure if you got an answer to this, but you can not fork opens in Win32 does not work like unix. No, but given that a lot of work has been put into ithreads in V5.8 to make threading platform-independent (or at least functional on Windows) I'm surprised that a language feature like

RE: Can't fork using open

2003-03-05 Thread Kipp, James
No, but given that a lot of work has been put into ithreads in V5.8 to make threading platform-independent (or at least functional on Windows) I'm surprised that a language feature like this hasn't been implemented. As well as that I can see nowhere in the docs where it mentions the

RE: Can't fork using open

2003-03-05 Thread Kipp, James
I just test ran the below and it worked fine. I am running Win2k Pro, AS Perl 5.6.1 build 630: code adapted from the perlipd doc -- $parent = $$; print parent: $parent\n; $pid = open(STATUS, netstat -an 21 |) || die can't fork: $!; while (STATUS) { #next if /^(tcp|udp)/i; }

RE: Can't fork using open

2003-03-05 Thread Kipp, James
That was what I found out and why I chose to use Win32::Process so that interactive sessions/commands could be spawned without leaving the Perl module in the lurch. Try it, you'll like it. yes i have used that module in the past as well. I was just trying to see if it could be done

RE: IP Conversion

2003-02-21 Thread Kipp, James
How do I convert from Domain Name to IP address and vice versa. Mick Spooner read up on sockets. try something like this: $ip = inet_ntoa( scalar gethostbyname($hostname) ); $hostname = gethostbyaddr( inet_aton( 127.0.0.1 ), AF_INET ); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: persisting environment variables

2003-02-20 Thread Kipp, James
Hello list, Does anyone know how to set an environment variable in Perl and then have that variable persist after the Perl script has ended? I'm working in Unix. why not just set the env variable in your unix shell or startup scripts. what flavor of unix are you working with? --

RE: persisting environment variables

2003-02-20 Thread Kipp, James
It's a utility that allows users to change their Oracle environments, so when they logon they can run the utility and select an Oracle environment to set (ORACLE_SID, ORACLE_HOME, etc). It also allows them to change environments, say going from DEV to TEST. I have a Korn shell script

RE: Is there a simple way to do uid - username and usename - ui d mapping?

2003-02-20 Thread Kipp, James
the User::pwent module works well for this. it contains a sub called getpwent() that captures the information from /etc/passwd. check the docs for it there is also the getpwuid built in function you can use -Original Message- From: Ben Siders [mailto:[EMAIL PROTECTED]] Sent: Thursday,

RE: cookies

2003-02-19 Thread Kipp, James
Hello all, Can anyone point me to some good doc on how to create/read/delete cookies? Thanks! Hi Stephen I am new to cookies as well and recently posted a question like this. Here is what I found helpful: Here's a good overview: http://wp.netscape.com/newsref/std/cookie_spec.html Read

RE: copying a file without using module File::Copy

2003-02-14 Thread Kipp, James
Is the only way to copy a file from one directory to another by using the copy module...? Would anyone have a snipet of code copying a file from one dir to another... Any assistance would be appreciated... Have you checked the docs for File::Copy ? one example: use

RE: copying a file without using module File::Copy

2003-02-14 Thread Kipp, James
Is the only way to copy a file from one directory to another by using the copy module...? Sorry. I misread your question. You could shell out to the system copy as Wiggins mentioned. But why not use the module ? one example: use strict; use File::Copy; # a bunch

RE: can I should I shift/push an array in a foreach loop?

2003-02-12 Thread Kipp, James
My question is whethor or not its better to parse the data as I load the array from the program output, or parse the array after the fact, or parse the array after the fact multiple times In either case I seem to get lost in trying to use a foreach and shift at the same time, e.g.:

RE: Passing a Hash to a Subroutine

2003-02-12 Thread Kipp, James
Im trying to pass a hash to a subroutine now. When passing with other variables do I have to pass it as a reference like I do an array. If so how do you dereference it, if you have to at all. I prefer to pass as a reference. # your code was passing an array ref, not a hash, but since you

RE: Finding Duplicates.

2003-02-11 Thread Kipp, James
I have to find duplicate customers in are customer file (around 60,000 customers). The file has been exported into a pipe delimited file. CustCode|Ship2Code|Name|Addr1|Addr2|City|State|ZipCode|Phone|F ax|Country The problem is the duplicates can be misspelled meaning you can't just do

RE: Finding Duplicates.

2003-02-11 Thread Kipp, James
So you are looking for duplicates on any field? Wouldn't you just be looking for a dup on the Name? Shouldn't the CustCode field be unique? Has your company thought about importing these files into a relational database. Would be much faster and easier. This will not solve the

  1   2   3   4   >