PATH problem

2005-04-25 Thread TapasranjanMohapatra
All, My script goes like this... -- #!/usr/bin/perl print Content-type: text/html\n\n; $cmd = cat file_one; $content = qx!$cmd!; print $content; -- I have a case where file_one is not in the same directory. So I give the

Re: PATH problem

2005-04-25 Thread Sean Davis
Not sure this is the problem, but remember that when you run a CGI script from the command line, you are running as yourself. When you run it in the browser, you are running under whatever username and group the server is running with (and almost always this is different from yourself). So,

grep pattern problem

2005-04-25 Thread TapasranjanMohapatra
All, I am trying to print the output of grep command through cgi. When I do grep on a specific file I get the desired output, but while I try something like grep -Ri pattern ../directoryname/ I get no output when I run cgi(browser) though I get the output correctly run in commandline (perl).

Re: PATH problem

2005-04-25 Thread Wiggins d'Anconia
TapasranjanMohapatra wrote: All, My script goes like this... -- #!/usr/bin/perl print Content-type: text/html\n\n; $cmd = cat file_one; $content = qx!$cmd!; print $content; -- You should not shell out to read a file,

WML/WAP on Perl-CGI

2005-04-25 Thread Chandana
Hi , I need to develop/ migrate my exsiting wap site perl / perl cgi . Can i find proper tutorials on the NET ? Can someone give me proper URLS's ? and Where can i buy relavant Books ? Thank u , chandana

Re: PATH problem

2005-04-25 Thread Lawrence Statton
All, My script goes like this... -- #!/usr/bin/perl print Content-type: text/html\n\n; $cmd = cat file_one; $content = qx!$cmd!; print $content; -- I have a case where file_one is not in the same directory. So I

Re: Lines Interchange

2005-04-25 Thread N. Ganesh Babu
Dear Charles, The rules are as follows: 1. The first tag should be src (single tag) 2 . The second tag should be mkt (single tag) 3. The third tag should fil (may be multiple fil tags) 4. The fourth tag should be pub (single tag) 5. The fifth tag should be cat (single tag) 6. Next, the set of 4

Re: Use Perl to extract keywords

2005-04-25 Thread John Doe
Hi Robert Am Montag, 25. April 2005 01.45 schrieb Robert Kerry: I want to use Perl to extract keywords from plaintext, don't know whether there are some exsiting package / algorithm for doing that? Thank you. In the case you know the keywords (I suppose so, otherwise you would search words,

Re: basic class problem

2005-04-25 Thread John Doe
Hi Graeme [rearranged from bottom:] All I want to do is print off the value of the hash refs at the moment before I start building on it. Due to my bad english I'm not quite shure what you mean by that. You want to print the values to be sure they are right, before using them? I know I'm

one-liner multi-line regex problem

2005-04-25 Thread Kevin Horton
I'm trying to write a perl one-liner that will edit an iCalendar format file to remove To Do items. The file contains several thousand lines, and I need to remove several multi-line blocks. The blocks to remove start with a line BEGIN:VTODO (without the quotes) and end with a line END:VTODO

Re: one-liner multi-line regex problem

2005-04-25 Thread John Doe
Hi Kevin just hints, no solution :-) Am Montag, 25. April 2005 12.59 schrieb Kevin Horton: I'm trying to write a perl one-liner that will edit an iCalendar format file to remove To Do items. The file contains several thousand lines, and I need to remove several multi-line blocks. The

Reading multi line input from user

2005-04-25 Thread christopher . l . hood
I wish to read input from a user that has multiple lines with carriage returns from stdin but not actually stop reading until a single # on a line by itself. Is there a module / package / function that will aid in this? I would like to do something like below: Until(STDIN = #) {

Re: General Enquiry regarding the Perl

2005-04-25 Thread Rajat Dudeja
Hello, Thanks a lot Teddy ,Chris ,Brian and Ashoka for letting me know such a wide scope of perl. Just one more enquiry...hope you guys won't mind. Right now i am reading the book Learning Perl. After going through this book I am intending to read Perl Cookbook ,would it be right ? Or, shall I

RE: Reading multi line input from user

2005-04-25 Thread Bob Showalter
[EMAIL PROTECTED] wrote: I wish to read input from a user that has multiple lines with carriage returns from stdin but not actually stop reading until a single # on a line by itself. You can use perl's $/ variable to define an record separator. The default is \n, but you can change it. Try

Re: Configuration File generator

2005-04-25 Thread Offer Kaye
On 4/24/05, Tommy Nordgren wrote: I wan't links to any useful tools for generating configure scripts in perl. That is, tools to automatically generate the configure script for open-source C/C++ projects. Perl itself uses a Configure script generated using the metaconfig tool, which is (as

getting file name/line num info

2005-04-25 Thread Manish Sapariya
Hello, Can somebody explain me the magic here = sub vprint (@) { return unless $Utils::verbose; my ($file, $line) = (caller)[1,2]; my $subr = (caller 1)[3] || 'main'; $file =~ s!.*/!!; print STDERR $subr($file:$line): , @_; } What

Re: Regular expression help

2005-04-25 Thread Jay Savage
On 4/25/05, John W. Krahn [EMAIL PROTECTED] wrote: Owen wrote: I found a message from Randal Schwartz, Message-ID: [EMAIL PROTECTED]#1/1 which gave a regular expression for a valid Unix name, /^(?=.*?\D)[a-z\d]+$/ That works but why does it work? / ^

Re: getting file name/line num info

2005-04-25 Thread Jay Savage
On 4/25/05, Manish Sapariya [EMAIL PROTECTED] wrote: Hello, Can somebody explain me the magic here sub vprint (@) { # subroutine declaration with prototype return unless $Utils::verbose; # exit sub unless $Utils::verbose flag is set my ($file, $line) =

Re: one-liner multi-line regex problem

2005-04-25 Thread Dave Gray
I'm trying to write a perl one-liner that will edit an iCalendar format file to remove To Do items. The file contains several thousand lines, and I need to remove several multi-line blocks. The blocks to remove start with a line BEGIN:VTODO (without the quotes) and end with a line END:VTODO

Re: How to add my own start method to existing HTML::Parser class to Scrape Screens?

2005-04-25 Thread Wiggins d'Anconia
Siegfried Heintze wrote: I'm trying to screen scape some information off the web. I anticipate that I'll want to have it multi-threaded. As per Lincoln Stein's book, I'm using HTML::Parser and passing a function pointer (you can tell I'm a C programmer) to $parser-handler(start= \start,

Perl one-liner to print columns

2005-04-25 Thread Larsen, Errin M HMMA/IT
Hi Perlers, I typically will type the following to collect a specific column of data from some command's output: # some_command | awk '{print $4}' I wanted to start using perl one-liners more often, so I thought I'd try the column thing first. This is what I came up with: #

Re: Perl one-liner to print columns

2005-04-25 Thread Jay Savage
On 4/25/05, Larsen, Errin M HMMA/IT [EMAIL PROTECTED] wrote: Hi Perlers, I typically will type the following to collect a specific column of data from some command's output: # some_command | awk '{print $4}' I wanted to start using perl one-liners more often, so I thought I'd try

Very basic question about running perl cgi on tomcat

2005-04-25 Thread Robert Kerry
I changed the web.xml file and the .jar suffix as required, and create a new directory WEB-INF/cgi/ under webapps/ directory, I put my first.pl into that directory, and try to visit it using http://localhost:8080/cgi/first.pl but it doesn't work. I've also tried /cgi-bin/first.pl and something

Re: Perl one-liner to print columns

2005-04-25 Thread Jay Savage
On 4/25/05, Jay Savage [EMAIL PROTECTED] wrote: On 4/25/05, Larsen, Errin M HMMA/IT [EMAIL PROTECTED] wrote: Hi Perlers, I typically will type the following to collect a specific column of data from some command's output: # some_command | awk '{print $4}' I wanted to start

Perl One-liner de-compile?

2005-04-25 Thread Larsen, Errin M HMMA/IT
Hi everyone, Here is an example from the perlrun perldoc page: perl -ane 'print pop(@F), \n;' is equivalent to while() { @F = split(' '); print pop(@F), \n; } My question is, can I get Perl to evaluate a command line (like above) and print out the

Re: Perl One-liner de-compile?

2005-04-25 Thread Paul Johnson
On Mon, Apr 25, 2005 at 01:45:15PM -0500, Larsen, Errin M HMMA/IT wrote: Hi everyone, Here is an example from the perlrun perldoc page: perl -ane 'print pop(@F), \n;' is equivalent to while() { @F = split(' '); print pop(@F), \n; } My

RE: Perl One-liner de-compile?

2005-04-25 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 1:53 PM To: Larsen, Errin M HMMA/IT Cc: beginners@perl.org Subject: Re: Perl One-liner de-compile? On Mon, Apr 25, 2005 at 01:45:15PM -0500, Larsen, Errin M HMMA/IT wrote: Hi

'Bad index while coercing array into hash' error

2005-04-25 Thread jason_normandin
Greetings I am getting the following error when running a script using an anonymous array of hashes: Bad index while coercing array into hash at ./nhsDiffSchema.pl line 240 Here is the code snipt that both assigns values to the array of hashes and the code which displays the values back

RE: Perl One-liner de-compile?

2005-04-25 Thread Charles K. Clarkson
Larsen, Errin M HMMA/IT mailto:[EMAIL PROTECTED] wrote: : Or is the @f array a secret array I'm not cleared to know about? We could tell 'ya, but then we'd have to kill 'ya. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Perl One-liner de-compile?

2005-04-25 Thread Jeff 'japhy' Pinyan
On Apr 25, Larsen, Errin M HMMA/IT said: $ perl -MO=Deparse -ane 'print pop(@F), \n;' Note the @F, it's capital-F. # perl -MO=Deparse -nae 'print $f[4]' /some/directory/somefile You're using a lowercase @f here. LINE: while (defined($_ = ARGV)) { our(@F) = split( , $_, 0); print $f[4];

Re: 'Bad index while coercing array into hash' error

2005-04-25 Thread jason_normandin
Hello List. Found the problem: foreach my $record (@{dataFileHash{$datafile}}) { Should have been: foreach my $record (@{$dataFileHash{$datafile}}) { Sorry ! I stared at this for like an hour and didn't notice the missing $ Can anyone tell me what the Argument NH_DATA01 isn't numeric in

RE: Perl One-liner de-compile?

2005-04-25 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 2:42 PM To: Larsen, Errin M HMMA/IT Cc: beginners@perl.org Subject: RE: Perl One-liner de-compile? SNIP You're using a lowercase @f here. SNIP Perl will magically

Re: Perl One-liner de-compile?

2005-04-25 Thread John W. Krahn
Larsen, Errin M HMMA/IT wrote: Ok ... So I tried this: # perl -MO=Deparse -nae 'print $f[4]' /some/directory/somefile ^ LINE: while (defined($_ = ARGV)) { our(@F) = split( , $_, 0); print $f[4]; ^ } -e syntax OK

Re: Reading multi line input from user

2005-04-25 Thread Jay Savage
On 4/25/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I wish to read input from a user that has multiple lines with carriage returns from stdin but not actually stop reading until a single # on a line by itself. Is there a module / package / function that will aid in this? I would like to do

Re: Very basic question about running perl cgi on tomcat

2005-04-25 Thread Robert Kerry
Chris, Thanks. I'm not switching to Apache http server. Unfortunately the same thing happened again. I put the first.pl in the /cgi-bin/ directory and try to access it via http://localhost/cgi-bin/first.pl, it tells me that file not found. I don't know what I should do for httpd.conf file.

DFA::Simple

2005-04-25 Thread Alex Lisbaron
Hi All, I need to create fsa (final state machine). I want to do it using DFA::Simple. How can I install this package on WIN2K? Thank you in advance A. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: one-liner multi-line regex problem

2005-04-25 Thread Kevin Horton
On 25-Apr-05, at 10:06 AM, Jay Savage wrote: On 4/25/05, Kevin Horton [EMAIL PROTECTED] wrote: I'm trying to write a perl one-liner that will edit an iCalendar format file to remove To Do items. The file contains several thousand lines, and I need to remove several multi-line blocks. The blocks

Re: one-liner multi-line regex problem

2005-04-25 Thread Kevin Horton
On 25-Apr-05, at 10:06 AM, Jay Savage wrote: On 4/25/05, Kevin Horton [EMAIL PROTECTED] wrote: I'm trying to write a perl one-liner that will edit an iCalendar format file to remove To Do items. The file contains several thousand lines, and I need to remove several multi-line blocks. The blocks

Re: DFA::Simple

2005-04-25 Thread Edward Wijaya
--- Alex Lisbaron [EMAIL PROTECTED] wrote: How can I install this package on WIN2K? Use PPM, like: dos-prompt ppm then ppm install DFA-Simple --- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]