Re: Fw: Could [you] [please] tell me how to remove white spacees presentbetween delimiter[s]

2005-09-02 Thread James Taylor
#!/usr/bin/perl my $st1="'---'~^ '123PS01D'~^"; for(split(/\~\^/,$st1)) { $_ =~ s/\s//g; # Do something with your variable } Is that what you're asking? I'm unsure [EMAIL PROTECTED] wrote: '---'~^ '123PS01D'~^ here delimiter is ~^ '---'~^'123PS01D'~^ Do u see the d

Re: Mod_Perl Pass Associative Arrays

2004-12-11 Thread James Taylor
Chris Devers wrote: On Fri, 10 Dec 2004, James Taylor wrote: Hi everyone, wondering if anyone knew how to pass an associative array via POST to mod_perl. Something like: HTML forms don't really provide for complex data structures, so any solution is going to have to be cobbled togethe

Mod_Perl Pass Associative Arrays

2004-12-10 Thread James Taylor
Hi everyone, wondering if anyone knew how to pass an associative array via POST to mod_perl. Something like: then it posts to say.. example.pl my $r=Apache->request; my $req=Apache::Request->new(shift); my %stuff=$req->param('search'); That for example doesn't work, but... I'd like it to

Mod_Perl Target Headers

2004-11-04 Thread James Taylor
I posted this to the mod_perl list originally, but noone ever answers my questions on there. Guess my noob questions don't belong on that list: Again, this is for mod_perl Should be a pretty simple question, looking for an option in header_out to target a frame. For example... snip $r=Apach

Re: Mod Perl Helper Functions

2004-10-05 Thread James Taylor
Bob Showalter wrote: FWIW, That example works OK for me under Apache 1.3.31, mod_perl 1.29 when I run under Apache::Registry. I had to add a declaration for %somehash, but otherwise it runs without error. Is main.pl running under Apache::Registry, or is it a PerlHandler or some other type of handle

Mod Perl Helper Functions

2004-10-05 Thread James Taylor
I posted this to the mod_perl list 2 days ago, but it seems a bit inappropriate there as the discussion is much more advanced than my question... That and I haven't gotten a response, so sorry for the crosspost :) I'm running apache 1.3.x with the associated version of mod_perl, but am having t

Re: Modifying STDIN

2004-03-16 Thread James Taylor
I actually can't do it that way, this is a part of a custom perl module that someone wrote, and those are just 2 lines from the module. On Mar 15, 2004, at 11:01 PM, Randy W. Sims wrote: On 03/16/04 00:06, James Taylor wrote: I'm modifying a script someone wrote that basically reads a

Modifying STDIN

2004-03-15 Thread James Taylor
I'm modifying a script someone wrote that basically reads a file file into STDIN, and I was curious if there was anyway of modifying the stdin value without having to first open the file, modify it, close the file, and then open it into stdin. Basically, looks like: open(STDIN,$filename) || di

Re: regex multiple lines

2004-01-02 Thread James Taylor
r=$a.$repl.$d; I'd still like to know if you can do this via regex however. On Jan 2, 2004, at 5:38 PM, James Taylor wrote: I'm trying to parse a bit out of an HTML file, where the formatting could change daily as far as spaces/newlines go. Say for example I have something like this:

regex multiple lines

2004-01-02 Thread James Taylor
I'm trying to parse a bit out of an HTML file, where the formatting could change daily as far as spaces/newlines go. Say for example I have something like this: $str=< Hello this is juts an example blahahahaha http://www.somewhere.com";> HELLO Hello world EOF $repl="Replacement Text"; $str =

Re: CGI Script Fork

2003-11-22 Thread James Taylor
The reason I need to run it in the background and just display the message is that the person that's going to be running this program wants to be able to close the window. The process running in the background can take up to 10 minutes and he's afraid that he may accidentally close the window

CGI Script Fork

2003-11-21 Thread James Taylor
I'm working on a cgi script that basically, upon running it, runs a separate script in the background, and displays a message saying "Script is running. Should be done soon." on the web browser and... that's it. The browser can be closed, and the script will continue to run in the background. He

conf files

2002-06-10 Thread James Taylor
I have this app I just wrote, and I wanted to give my users a more 'standard' .conf file, instead of forcing them to open up the script, and dig through and change variables (Some people get confused by this... Go figure). SO, I wanted to give a .conf sort of like the apache conf file where y

CHAP?

2002-06-05 Thread James Taylor
I have a program I wrote, client and server, that communicate through sockets - There currently is no sort of authentication between the two other than hosts.allow allowing the IP of the client for that port, and that's all. People wanting to use my program have told me they won't use it unle

another regex question

2002-04-22 Thread James Taylor
Hmm, it looks like something was wrong with my mail server, so I'm sending this question again - If you already got this, I apologize: I'm have this program that reads over mail logs looking for spammers, and depending on certain conditions, they're marked as a spammer. If the reverse lookup

another regex question

2002-04-22 Thread James Taylor
I'm have this program that reads over mail logs looking for spammers, and depending on certain conditions, they're marked as a spammer. If the reverse lookup on the relay used matches their email address however, no matter what, we're not marking them as a spammer. However, I've run across a

TK madness

2002-04-18 Thread James Taylor
I'm trying to develop a user interface for a program I've written - What I need the program to do is print out the results of the current process to the TK interface. I absolutely can not figure out how to do a simple printing to TK function!@@!# For example, I would have a program that does

More Bidirectional Sockets w/ Win32 Client

2002-04-16 Thread James Taylor
I have figured out how to set up bidirectional communication through sockets by forking the server and the client - The client forks just fine under Linux, but if I take the script to Win32 fork doesn't seem to work. This is the code for both the server and client: Here's the server: #!/usr/

Bidirectional Sockets

2002-04-15 Thread James Taylor
I'm sure this is frequently asked, and I am truly sorry if it is, but reading through my mail I don't see this question anywhere: Curious as to how I would go about creating bidirectional sockets, ie. client sends information to the server, then server responds to the client. I need to know h

Fidning the index of an array

2002-04-11 Thread James Taylor
How can I get the current index of an array while processing the array in a loop? I know I can do it with a counter type function, but I was curious if there was a better way of doing this. For example: my @array = (1 .. 100); my $counter = 0; for (@array) { print "index -> $counter elem

Re: Regex!

2002-04-10 Thread James Taylor
There's a few problems with your script. This one works: $money = '$27.50'; $money =~ s/\$//; Use single quotes instead of double, and don't forget the =~ instead of = Daniel Falkenberg wrote: >Hi Tim, > >I just tried running $money = s/\$//: over > >$money = "$21.80"; > >And my returned resu

Looping over Hashes of Arrays

2002-04-03 Thread James Taylor
How do you get a list of all keys in a hash of arrays? I'll have a hash where the data would look something like: %myhash = ('client19' => [ 'client2', 'client5', 'client7' ], 'client20' => ['client3', 'client4', 'client8']); I need to basically get a list of the hash val

Re: Converting Unix time...

2002-04-02 Thread James Taylor
Look into Time::Local Daniel Falkenberg wrote: >G'day all, > >What would be the best way of converting Unix time into a ddmmyy format? >I am a little stuck with this so any ideas would be greatly appriciated. > >Dan > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

Re: random word from array

2002-03-27 Thread James Taylor
Hrm, try this: @tea = "Meba", "Shaun", "Mark", "Jason", "Rick", "Dan"; srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`); print "$tea[rand(5)]\n"; On Wednesday 27 March 2002 03:25 pm, you wrote: > I decided to write a little script to help choose who will make the tea on > our gaming night [t

DBI really quick question

2002-03-19 Thread James Taylor
CPAN is running exremely slow (as per usual) and I just have a quick question. How do I CREATE a database from within perl with MySQL? Generally the first command you give for DBI will be a statement to connect to a db, but what if I have to have the db created first? This is for a script tha

Re: what's the point of Foreach?

2002-03-01 Thread James Taylor
Oops, sorry it was just pointed out to me today that this was already asked today :) There are over 1000 unread messages in my Perl folder and I didn't think to look through them all On Friday 01 March 2002 11:52 am, you wrote: > I'm really curious what the point of foreach is considering for d

what's the point of Foreach?

2002-03-01 Thread James Taylor
I'm really curious what the point of foreach is considering for does the same exact thing? For example: @myarray = (1 .. 10); for (@myarray) { print "$_\n"; } Or, you could swap the for for a foreach and the same thing would get accomplished... The only difference I can think of is a sli

Fwd: Re: Sending email via Postfix

2002-02-20 Thread James Taylor
Hmm, I'm not 100% sure whether or not it comes with this in Mandrake or not, but if you download postfix and compile it (or install the package I suppose) it comes with a binary called 'sendmail' which is basically used for this purpose. So, you might want to just do a 'locate sendmail'. Maybe yo

Re: Very Basic Help

2002-02-14 Thread James Taylor
You should probably read about about the CGI module before attempting to create CGI programs... BUT, to answer your question, you would do something like this: #!/usr/bin/perl use CGI qw/:standard/; use strict; my $test = 1000; print header; print start_html; print "$test\n"; print end_ht

Re: Help can't figure this one out

2002-02-14 Thread James Taylor
Just because you CAN take shortcuts in Perl doesn't necessarily mean that you should. Even though it's less typing, it might be more difficult to understand what's going on to someone else reading your code, or to yourself after looking at the code some time later. That's what I always

Re: [PHP] Browse and Upload file

2002-02-13 Thread James Taylor
Oh Jesus, I'm on too many mailing lists. Ignore this On Wednesday 13 February 2002 05:44 pm, you wrote: > There are scripts like this all over the net, but here's one for you to > save you searching time: > > use CGI qw(:standard); > > $| = 1; > $i=param('fileuploadname'); > > open(OUTPUT, ">/li

Re: [PHP] Browse and Upload file

2002-02-13 Thread James Taylor
There are scripts like this all over the net, but here's one for you to save you searching time: use CGI qw(:standard); $| = 1; $i=param('fileuploadname'); open(OUTPUT, ">/lists/$i") or die "cannot find output: $!"; while ($bytes = read($i,$buffer,1024)) { $bytesread += $bytes; print OU

Re: foreach loop problems

2002-02-13 Thread James Taylor
4 different machines using a script similar to > > that one. I don't think all programs are going to be that nice. > > > > Can anyone explain how ssh got the keyboard input?! Doesn't perl have > > control of or does it pass that off to the spawned process > &g

Re: foreach loop problems

2002-02-13 Thread James Taylor
tested it out and was > able to call up ssh for 4 different machines using a script similar to > that one. I don't think all programs are going to be that nice. > > Can anyone explain how ssh got the keyboard input?! Doesn't perl have > control of or does it pass that

Re: foreach loop problems

2002-02-13 Thread James Taylor
I don't believe this is what he's asking - What the problem is in this code is that after the first instance of SSH runs, and then exits, it will not continue on to the next key in the array. I can't figure out why it won't do it, I don't generally write programs using system calls :) On Wed