RE: system call question

2001-05-02 Thread J. Patrick Lanigan
V{REMOTE_ADDR} has been logged."; } my @output = `man $manpage | perl -pe 's/(?:.\cH)//g'`; print ""; foreach (@output) {$_ =~ /\w/; print }; print ""; > From: Kevin Meltzer wrote: > > On Wed, May 02, 2001 at 04:20:49P

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
print end_form, hr; } print end_html(); Thanks again, Patrick > --- Casey West <[EMAIL PROTECTED]> wrote: > > On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote: > > : Thanks to Paul and Mike for the quick response. > > : > >

RE: system call question

2001-05-02 Thread J. Patrick Lanigan
Thanks to Paul and Mike for the quick response. Now, does anyone know how I can trim out the unwanted charecters from the output of a man page so that I can display it in a browser? Sample as is: NNAAMMEE ls - list directory contents SSYYNNOOPPSSIISS llss [_O_P_T

system call question

2001-05-02 Thread J. Patrick Lanigan
Now that I have CGI working with apache on my server, I am experimenting. Anyhow, I wrote the following script and was wondering how to capture the output of a system call. I am trying to capture the output so that I can format it for the browser. #!/usr/bin/perl -w use strict; use CGI qw(:standa

RE: CGI Problem

2001-05-02 Thread J. Patrick Lanigan
nt STDERR "\nGot this far\n"; > > This will put the text into the server's error log if the script gets > run. If the line doesn't appear, you've got a configuration problem. > > Definitely lastly, remove/rename the script and see if it makes any > di

RE: CGI Problem

2001-05-01 Thread J. Patrick Lanigan
son king wrote: > > J. Patrick Lanigan writes .. > > >I tried them on th CLI first. I even su'ed to user nobody to > >match the env of apache. > > and on the CLI - I presume that they outputted exactly what you > expected .. > ie. > > "Content-type:

RE: CGI Problem

2001-05-01 Thread J. Patrick Lanigan
I tried them on th CLI first. I even su'ed to user nobody to match the env of apache. > King, Jason wrote: > > J. Patrick Lanigan writes .. > > > >I am getting an "Internal Server Error" returned to my > >browser. The error > >log shows the foll

CGI Problem

2001-05-01 Thread J. Patrick Lanigan
I am getting an "Internal Server Error" returned to my browser. The error log shows the following: "[Wed May 2 00:04:39 2001] [error] [client 192.168.0.10] Premature end of script headers: /path/to/filename" I have set the directory and file to 755 and the correct ownership. I have tried a coup

RE: RegEx Prob WAS: Problem with reading string

2001-05-01 Thread J. Patrick Lanigan
I just keep learning. This list is making learning much easier. Thanks to Dan and Jason, Patrick > you need the global modifier .. what you're trying to do is do the current > match globally throughout the whole string (not zero or more) > > $mystring =~ s/\'/\\'/g;

RegEx Prob WAS: Problem with reading string

2001-05-01 Thread J. Patrick Lanigan
Opps, I forgot to change the subject. I think I need to get outside and get some fresh air. > I was using: > > $mystring =~ s/\'/\\'/; > > ...to replace ' with \' in $mystring. It was working find I > thought, until I > encountered a string with multiple apostrophies. How do I replace > 0 or

RE: Problem with reading string

2001-05-01 Thread J. Patrick Lanigan
I was using: $mystring =~ s/\'/\\'/; ...to replace ' with \' in $mystring. It was working find I thought, until I encountered a string with multiple apostrophies. How do I replace 0 or more? Ex: "No More 'I Love You's'" ...should become: "No More \'I Love You\'s\'" I

RE: Hash of Arrays Question

2001-05-01 Thread J. Patrick Lanigan
Thank you so much for your help Gary and Jason. I tried the following and it works perfectly. Patrick #!c:/perl/bin/perl -w use strict; my %tracks=(); # create empty hash $tracks{'test'}->{artist}='test_artist'; $tracks{'test'}->{title}='test_title'; $tracks{'test2'}->{artist}='test_artist2'; $

RE: Hash of Arrays Question

2001-05-01 Thread J. Patrick Lanigan
> > > Surely, a hash of hashes would be better then. > > > > my %tracks=(); # create empty hash > > > > Then to populate the data you do something like: > > > > $tracks{$fname}->{artist}=$artist; > > $tracks{$fname}->{title}=$title; > >

RE: Hash of Arrays Question

2001-05-01 Thread J. Patrick Lanigan
urn wrote: > > Surely, a hash of hashes would be better then. > > my %tracks=(); # create empty hash > > Then to populate the data you do something like: > > $tracks{$fname}->{artist}=$artist; > $tracks{$fname}->{title}=$title; > > Gary > > On

RE: Hash of Arrays Question

2001-05-01 Thread J. Patrick Lanigan
and INSERT the info into a PostgreSQL DB. I am completely open to any other suggestion for a way to collect a dataset with a unique identifier. I've got all the other code working, this is the last piece to my puzzel. Thanks, Patrick > Jason King wrote: > > J. Patrick Lanigan writ

Hash of Arrays Question

2001-05-01 Thread J. Patrick Lanigan
I haven't quite sorted out the more complex data structure in perl yet. Anyhow, I need to take the following hash of arrays... my %tracks = (); push @{$tracks{$filename}}, $_, # tracks.filename

RE: open file, find lines and print to a second file....

2001-04-30 Thread J. Patrick Lanigan
Try this... #!c:/perl/bin/perl -w use strict; my $file = 'old_websites.txt'; my $outfile = 'old_web2.txt'; open(INFO, "$file") or die "$!"; # file open w/error check open(RESULT, ">$outfile"); # tried "$outfile" as well... while (){ print RESULT $_ unless grep {/_vti_cnf/} $_; } close INFO;

RE: Can't figure out find()

2001-04-30 Thread J. Patrick Lanigan
I am very new to perl myself. I was having the same type of problem the other day. I came up with the following which has worked for me, but like I said I am a newbie, so it could prolly be done much better: #!/usr/bin/perl use File::Find; @DIRS = ('.') unless @ARGV; %seen = (); $lastArtist = $l