Re: what is a .ph file

2002-12-21 Thread John W. Krahn
Ramprasad wrote: > > I was just going thru some perl tutorial I came across 'h2ph' utility > which converts c header files to .ph files > > Ok man h2ph would give this much information , but what is the use of > h2ph. When I have the need of any modules I create Packages and > 'require' or 'use'.

until/if and private array errors

2002-12-21 Thread Al Lukaszewski
Greetings, It seems my earlier post ['foreach' and error diagnosis] was not clear enough for some people on list. I will therefore clarify what I am trying to do and appeal for further assistance. I have a grammatical database in a comma-delimited file. The first field is the line reference. T

@INC question after conversion to linux.

2002-12-21 Thread Michael Hooten
I have added RedHat linux as a boot alternative to Win 2k. Of course, the stability of linux is superb but I am not yet accustomed to compiling every single thing I need that is not pre-installed. As far as perl, I would like to permanently add /usr/local/lib/perl to @INC without specifically havi

problems with @ARGV

2002-12-21 Thread Pam Derks
I'm having difficulties with @ARGV... I have a several files: access_log.021204 access_log.021205 access_log.021206 that I want to read in using @ARGV and then pass these file names to 2 subroutines At the command line I've tried: myprogram.pl access* myprogram.pl get_file(@ARGV) get_match(@AR

Need to change file columns

2002-12-21 Thread Ashutosh Jog
Folks, I am wokring on a script which at one point works on a txt file. The file's format is as under: 40abc 35def 28ghi 17jkl 08mno What I want to do is take the column on the right and shift it entirely to the left and take the column on the left and mo

Re: @INC question after conversion to linux.

2002-12-21 Thread Paul Johnson
On Fri, Dec 20, 2002 at 04:13:49PM -0500, Michael Hooten wrote: > I have added RedHat linux as a boot alternative to Win 2k. Of course, > the stability of linux is superb but I am not yet accustomed to > compiling every single thing I need that is not pre-installed. Have you tried Red Hat's packa

Re: until/if and private array errors

2002-12-21 Thread Rob Dixon
Hi Al I'm still a little confused, but it seems that you are as well. Your problem is that you are misunderstanding the distinction between array and scalar variable types. You declare array @newQA but your comment says "holding scalar for the output". You then treat it both as a scalar ( @newQA .

Re: Need to change file columns

2002-12-21 Thread Rob Dixon
I don't really like providing 'instant solutions', but I'm feeling too lazy to help you to your own solution! This should do the trick, with the disclaimer that I haven't tested it in any way. open INP, "< inp.txt"; open OUT, "> out.txt"; printf OUT "%-10s%s\n", reverse split while ()

Re: Need to change file columns

2002-12-21 Thread LRMK
# this must get the job done open (FH,'; close(FH); chomp @recs; $c=-1; while ($c<$#recs){ $c++; @parts = split(/\s+/,$recs[$c]); $recs[$c] = "$parts[1] $parts[0]"; } open (FH,'>filename'); select(FH); foreach $line (@recs){ print "$line\n"; } close(FH); - Original Message - From

Re: problems with @ARGV

2002-12-21 Thread Rob Dixon
Hi Pam. See in-line. "Pam Derks" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm having difficulties with @ARGV... > > I have a several files: > access_log.021204 > access_log.021205 > access_log.021206 > > that I want to read in using @ARGV > > and then pas

Re: Need to change file columns

2002-12-21 Thread Ashutosh Jog
Hey, Thanks a ton. The method that I was using was disturbing the formatting, but this did the trick. -Cheers. Rob Dixon wrote: I don't really like providing 'instant solutions', but I'm feeling too lazy to help you to your own solution! This should do the trick, with the disclaimer that I hav

HTTP Requests

2002-12-21 Thread LRMK
Is there a module to send HTTP requests to any web server and retrieve the web pages like a browser

Re: HTTP Requests

2002-12-21 Thread Wiggins d'Anconia
Yes. In particular you want to look at LWP. http://search.cpan.org/author/GAAS/libwww-perl-5.66/lib/LWP.pm In general have a look at this category: http://search.cpan.org/modlist/World_Wide_Web http://danconia.org LRMK wrote: Is there a module to send HTTP requests to any web server and retri

Fw: HTTP Requests

2002-12-21 Thread LRMK
What I want is when a visitor came and post something to my cgi script that script must post some of that information to another cgi script on another web server get the results and send back to the visitor how do I do that? > - Original Message - > From: "Wiggins d'Anconia" <[EMAIL PROTECT

Re: Fw: HTTP Requests

2002-12-21 Thread Wiggins d'Anconia
Right. And that is what the LWP module is for. From the docs on the first URL I posted earlier: An Example This example shows how the user agent, a request and a response are represented in actual perl code: # Create a user agent object use LWP::UserAgent; $ua = LWP::UserAgent->new; $

RE: File version info

2002-12-21 Thread Gary Hawkins
> So why won't a multi-line match work with Unicode? This from perldoc perlunicode probably applies: WARNING: As of the 5.6.1 release, the implementation of Unicode support in Perl is incomplete, and continues to be highly experimental. Tried installing 5.8 but it did not go wel

Re: until/if and private array errors

2002-12-21 Thread Rob Dixon
Hi Al OK I'm being lazy again, this time partly because you are in a hurry. The following code works with your dataset. You were badly misunderstanding arrays - I've taken out all of them! Let me know if you need anything explaining. Cheers, and good luck. Rob #!/usr/bin/perl #

Re: Fw: HTTP Requests

2002-12-21 Thread Randal L. Schwartz
> "Wiggins" == Wiggins D'Anconia <[EMAIL PROTECTED]> writes: Wiggins> Right. And that is what the LWP module is for. From the docs on the Wiggins> first URL I posted earlier: Wiggins># Create a request Wiggins>my $req = HTTP::Request->new(POST => Wiggins> 'http://www.perl.com/cgi-bin/

Re: Fw: HTTP Requests

2002-12-21 Thread Rob Dixon
Randal There's nothing wrong with Wiggins' advice. Take a look at "the first URL [he] posted earlier" and you'll find nothing about the HTTP::Request::Common module at all. In fact I can't find anywhere it tells you not to use the constructor directly - the nearest I've come across is in the POD f

Re: Fw: HTTP Requests

2002-12-21 Thread Wiggins d'Anconia
Randal L. Schwartz wrote: "Wiggins" == Wiggins D'Anconia <[EMAIL PROTECTED]> writes: Wiggins> Right. And that is what the LWP module is for. From the docs on the Wiggins> first URL I posted earlier: Wiggins># Create a request Wiggins>my $req = HTTP::Request->new(POST => Wiggins> 'http

HTTP Requests

2002-12-21 Thread LRMK
What I want is when a visitor came and post something to my cgi script that script must post some of that information to another cgi script on another web server get the results and send back to the visitor how do I do that? - Original Message - From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>

foreach, if/else, and concatenation

2002-12-21 Thread Albert L. Lukaszewski
At the earlier suggestion of Rob Dixon (rob[at]dixon.nildram.co.uk), I here present a sample of the data I am trying to convert, the output I desire, and the program as I have written it thus far. I am using "4Q246.db" as a sample of the larger file. In between each text, I want it to add three C

Re: foreach, if/else, and concatenation

2002-12-21 Thread Rob Dixon
Hi Al OK I'm being lazy again, this time partly because you are in a hurry. The following code works with your dataset. You were badly misunderstanding arrays - I've taken out all of them! Let me know if you need anything explaining. Cheers, and good luck. Rob #!/usr/bin/perl #

Re: until/if and private array errors

2002-12-21 Thread Jeff Westman
Comments below... --- Al Lukaszewski <[EMAIL PROTECTED]> wrote: > Greetings, > > It seems my earlier post ['foreach' and error diagnosis] was not clear > enough for some people on list. I will therefore clarify what I am > trying to do and appeal for further assistance. > > I have a grammatical

Re: foreach, if/else, and concatenation

2002-12-21 Thread John W. Krahn
"Albert L. Lukaszewski" wrote: > > At the earlier suggestion of Rob Dixon (rob[at]dixon.nildram.co.uk), I > here present a sample of the data I am trying to convert, the output I > desire, and the program as I have written it thus far. > > I am using "4Q246.db" as a sample of the larger file. In

Re: file handle as a sub arg in perl

2002-12-21 Thread R. Joseph Newton
Hi Christopher, I just dealt with a corrolary issue--how NOT to pass a file handle, which seems to happen by default if I declare the handle inline without scalar notation: open(MY_FILE, $FileName). In a recursive routine such as: sub ListFilesContainingText { #... variable declareations et al