Installing and Using Perl Modules

2004-03-25 Thread urvashi mishra
Hi, I am looking forward to learn how to use Perl Modules... Can some one tell me.. 1) How to Install CPAm modules? and 2) how to use them? Waiting for a quick reply - Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time.

Learning how to map a drive in Perl

2004-03-25 Thread neill . taylor
I am looking at how I could connect to share and map a local drive in a perl script. I have cut and pasted the code from the man page from Lanman to understand what is happening. When I run the code below I get the following error Undefined subroutine main::USE_IPC called at map.pl line 5. Am I

Question about cgi forms (slightly OT)

2004-03-25 Thread mike
I am developing a cgi/DBI app which is nearly finished I have this one question The scenario I have a cgi generated form on a web-page, it consists of several records defined by a DB lookup. When I do Search in the web-browser, is there any way to get it to search the values in the fileds of

Re: Confused

2004-03-25 Thread mike
On Wed, 2004-03-24 at 14:19, James Edward Gray II wrote: On Mar 24, 2004, at 7:59 AM, WC -Sx- Jones wrote: while(UPD1) { chomp; s/^\s+//; s/\s+$//; next unless length; There's probably not much reason to chomp() and s/\s+$//, since the later handles both. James Thanks for all

Re: Learning how to map a drive in Perl

2004-03-25 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: I am looking at how I could connect to share and map a local drive in a perl script. I have cut and pasted the code from the man page from Lanman to understand what is happening. When I run the code below I get the following error Undefined subroutine main::USE_IPC called

Re: Installing and Using Perl Modules

2004-03-25 Thread Randy W. Sims
urvashi mishra wrote: Hi, I am looking forward to learn how to use Perl Modules... Can some one tell me.. 1) How to Install CPAm modules? and 2) how to use them? Waiting for a quick reply What OS are you using? If it's a Windows variant, you will do best using ppm to install

Re: Installing and Using Perl Modules

2004-03-25 Thread Hacksaw
using cpan: invoke cpan, either by running perl -MCPAN -e shell; or, if it's set up, just cpan You will get a prompt. If you are trying to find a particular module, but you aren't sure of the whole name, you can search for it as so: cpan i /someModuleName/ It will look it up, and spit

Re: references

2004-03-25 Thread Joe Mecklin
On Wed, 2004-03-24 at 15:08, Wiggins d Anconia wrote: i know this should be a simple step or two that i'm missing, and i haven't been able to figure it out from reading yet... i have the following code: $sth = $mysql_dbh-prepare(select subroutine_pointer from

Re: sort function?

2004-03-25 Thread Flemming Greve Skovengaard
Use this: __BEGIN__ use strict; use warnings; die No file name supplied.\n unless @ARGV; my $oldest_name = shift @ARGV; my $oldest_age = -C $oldest_name; foreach (@ARGV) { my $age = -C; ($oldest_name, $oldest_age) = ($_, $age) if ($age $oldest_age); } printf The oldest

Re: Question about cgi forms (slightly OT)

2004-03-25 Thread WC -Sx- Jones
mike wrote: When I do Search in the web-browser, is there any way to get it to search the values in the fileds of the form? Currently all the values show up, but they dont seem to appear to be in scope for searching Show some code -- likely your logic is wrong -- if using CGI module then

Re: Confused

2004-03-25 Thread WC -Sx- Jones
mike wrote: This worked s/\s+$/; One question will this only take out blank lines? eg: if I have this line anytext tabe space newline will the non-printing characters be removed and the text be added to the beginning of the next line? This will only remove whitespace from the END of a line. If

RE: sort function?

2004-03-25 Thread Bob Showalter
Radhika Sambamurti wrote: Hi, I have written a small script that is supposed to tell me the oldest file in my directory (as per ctime). I have read the various times the various files were created, into an array called times. I have then sorted this array - @sorted_times. when i do ls -l i

sorting multi dimensional array

2004-03-25 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi All, I have an array that is build like this foreach $i ( 0 .. @array1) { foreach $j ( 0 .. @array2) { $array3[$i][$j] = $array2[$j]; } } The array3 has m rows and n columns of data. This code is written by some one else and I am trying to get the statistics

Re: Question about cgi forms (slightly OT)

2004-03-25 Thread mike
On Thu, 2004-03-25 at 13:18, WC -Sx- Jones wrote: mike wrote: When I do Search in the web-browser, is there any way to get it to search the values in the fileds of the form? Currently all the values show up, but they dont seem to appear to be in scope for searching Show some

RE: Question about cgi forms (slightly OT)

2004-03-25 Thread Guay Jean-Sébastien
Hello, mike wrote: When I do Search in the web-browser, is there any way to get it to search the values in the fileds of the form? Currently all the values show up, but they dont seem to appear to be in scope for searching Show some code -- likely your logic is wrong -- if

Re: Question about cgi forms (slightly OT)

2004-03-25 Thread WC -Sx- Jones
mike wrote: This results in a html page of forms which is populated, I can tab through the fields, edit etc, but if I do a control F for instance, the values in the fields are not found. What I would like is for users to be able to search for a value and then go tothat record I was afraid that

RE: sorting multi dimensional array

2004-03-25 Thread Charles K. Clarkson
N, Guruguhan (GEAE, Foreign National, EACOE) [EMAIL PROTECTED] wrote: : : I have an array that is build like this : : foreach $i ( 0 .. @array1) { : foreach $j ( 0 .. @array2) { : $array3[$i][$j] = $array2[$j]; : } : } Are you sure this code functions correctly? Looks like

Hash Help Needed !

2004-03-25 Thread jason_normandin
Hey List. I have run into a situation that I am unclear on. I am making the following assignment during a loop: push @{$response_hash{$request_id}},{time = $time,ip_addr = $ip_address,oids = %response_values}; Where: response_values is a simple hash containing key,value pairs and $time and

RE: Hash Help Needed !

2004-03-25 Thread Charles K. Clarkson
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: : : I have run into a situation that I am unclear on. : : I am making the following assignment during a loop: : : push @{$response_hash{$request_id}},{time = $time,ip_addr : = $ip_address,oids = %response_values}; I didn't test your code but

RE: Hash Help Needed !

2004-03-25 Thread Wiggins d Anconia
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [snip] : : print Time : $record-{time}\n; : print IP : $record-{ip_addr}\n; : foreach my $response ($record-{keys %response_values} ) In addition to what Charles already stated, once you have cleared up the

Re: RE: Hash Help Needed !

2004-03-25 Thread jason_normandin
Got it. I missed your note on the whitespace. Thanks everyone !! From: Charles K. Clarkson [EMAIL PROTECTED] Date: 2004/03/25 Thu PM 03:35:08 GMT To: [EMAIL PROTECTED], [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: RE: Hash Help Needed ! [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Streaming a file to a remote user

2004-03-25 Thread Price, Jason (TLR Corp)
I'm trying to figure out a way to stream a file to a remote user, and be able to determine that the download completed, so I can delete the file being streamed. I may be missing an obvious way to do this, so I'm hoping you all can help me out. Here's the sequence of events I'm after: 1. User

RE: Hash Help Needed !

2004-03-25 Thread Wiggins d Anconia
Please bottom post Hi I am scoping the %response_values hash at the top. I dont understand why it would need to be temporary as I am referancing that hash outside of the loop when I iterate through. It doesn't have to be temporary, but you overstep the help that 'strict' would have

RE: Hash Help Needed !

2004-03-25 Thread Normandin, Jason
Charles It does not print anything even though I know the time and ip_address objects are populated as they print correctley. I added the following ( and use Data::Dumper 'Dumper'; to the top of the script ) foreach my $request (sort keys %response_hash) { #print Response to request_id

RE: Hash Help Needed !

2004-03-25 Thread Normandin, Jason
Hi I am scoping the %response_values hash at the top. I dont understand why it would need to be temporary as I am referancing that hash outside of the loop when I iterate through. I changed the syntax to referance the oids rather then the hash name and I get the following error: Can't use

RE: Hash Help Needed !

2004-03-25 Thread Normandin, Jason
Charles I was able to get the data dumper to work. According to the output, the oids referance is referancing the hash for response_values: $VAR1 = { 'oids' = '%response_values', 'time' = '03/25/2004 03:16:39' }; $VAR1 = { 'oids' = '%response_values',

Re: Streaming a file to a remote user

2004-03-25 Thread Paul D. Kraus
On Thursday 25 March 2004 12:02 pm, Price, Jason (TLR Corp) wrote: I'm trying to figure out a way to stream a file to a remote user, and be able to determine that the download completed, so I can delete the file being streamed. I may be missing an obvious way to do this, so I'm hoping you all

RE: Hash Help Needed !

2004-03-25 Thread Guay Jean-Sébastien
Hello Jason, $VAR1 = { 'oids' = '%response_values', 'time' = '03/25/2004 03:16:39' }; ... If so, what is wrong with my assignment statement ? push @{$response_hash{$request_id}},{time = $time,oids = %response_values}; That is exactly what Charles told you in

RE: Fuzzy string matching

2004-03-25 Thread McMahon, Chris
Hi Juman... -Original Message- From: juman [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:31 AM To: [EMAIL PROTECTED] Subject: Fuzzy string matching I have two strings I want to compare doing some kind of fuzzy matching? Is there some good way to that in perl

Make a nice buffer?

2004-03-25 Thread David Busby
List, I want to make a buffer for my application to write log data to. I've created a fifo (`mkfifo /tmp/buf`) Then I made my PERL script that reads from /tmp/buf. Other programs open and write to /tmp/buf but when they close then my program that is reading from /tmp/buf stops. I want the

Playing with Unicode

2004-03-25 Thread James Edward Gray II
Why when I run this one-liner: perl -e 'print \x{2660}\n' do I see this: Wide character in print at -e line 1. I'm assuming that's a warning, since I still get the expected output, but why am I getting it, when I didn't ask for them? Is there a better way to drop in a unicode character?

sort

2004-03-25 Thread ewalker
any modules out there that can sort things such as.. BB10, BB1100,BB11. I want it to be in this order. BB10,BB11,BB1100. Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

String differences

2004-03-25 Thread David Busby
Any differences between strings quoted with ' vs ? I know the '' delimited strings don't get variables and other nice things converted to values, does that make '' faster when using constant strings than ? /djb -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: sort

2004-03-25 Thread James Edward Gray II
On Mar 25, 2004, at 4:51 PM, [EMAIL PROTECTED] wrote: any modules out there that can sort things such as.. BB10, BB1100,BB11. I want it to be in this order. BB10,BB11,BB1100. I'm not sure about the modules, but it's generally pretty easy to roll your own sort, in Perl. See if this code gets

Re: sort

2004-03-25 Thread lists
On Thu, 25 Mar 2004 [EMAIL PROTECTED] wrote: any modules out there that can sort things such as.. BB10, BB1100,BB11. I want it to be in this order. BB10,BB11,BB1100. yeah, if you have 5.8 you can use mergesort from the sorts module use strict; use warnings; # always! use sort

Re: sort

2004-03-25 Thread James Edward Gray II
On Mar 25, 2004, at 5:45 PM, [EMAIL PROTECTED] wrote: On Mar 25, 2004, at 4:51 PM, [EMAIL PROTECTED] wrote: any modules out there that can sort things such as.. BB10, BB1100,BB11. I want it to be in this order. BB10,BB11,BB1100. I'm not sure about the modules, but it's generally pretty easy to

Re: sort

2004-03-25 Thread James Edward Gray II
On Mar 25, 2004, at 6:02 PM, [EMAIL PROTECTED] wrote: James Yea,, now thats a ringer.. Glad you were able to look outside the box. :) now my next question is that I got say 75 different string all starting like the previous list. R50, AB11,BB110,BCD34...etc... Think this will sort the entire

Re: sort

2004-03-25 Thread James Edward Gray II
On Mar 25, 2004, at 6:11 PM, [EMAIL PROTECTED] wrote: James Hey james.. One other thing, I know its cause your a wise perl programmer, but how do you know on those lines not to put semi colons and that the data will be auto piped the next command? map() builds up a list and returns it. sort()

Re: String differences

2004-03-25 Thread WilliamGunther
In a message dated 3/25/2004 6:02:03 PM Eastern Standard Time, [EMAIL PROTECTED] writes: Any differences between strings quoted with ' vs ? I know the '' delimited strings don't get variables and other nice things converted to values, does that make '' faster when using constant strings than ? '

Re: Playing with Unicode

2004-03-25 Thread Randy W. Sims
On 3/25/2004 5:42 PM, James Edward Gray II wrote: Why when I run this one-liner: perl -e 'print \x{2660}\n' do I see this: Wide character in print at -e line 1. I'm assuming that's a warning, since I still get the expected output, but why am I getting it, when I didn't ask for them? Is there

noob needs help

2004-03-25 Thread Gallimore, Christopher
Being a total Perl noob I get tasked with some log parsing duties. The project involves parsing the apache access log. What I need to be able to do is get the time served data per hour per page. Something like: script.pl url time would return all the logged instances of that url and how long it

Re: Playing with Unicode

2004-03-25 Thread david
James Edward Gray II wrote: Why when I run this one-liner: perl -e 'print \x{2660}\n' do I see this: Wide character in print at -e line 1. I'm assuming that's a warning, since I still get the expected output, but why am I getting it, when I didn't ask for them? different version

Re: noob needs help

2004-03-25 Thread Randal L. Schwartz
Christopher == Christopher Gallimore [EMAIL PROTECTED] writes: Christopher Being a total Perl noob I get tasked with some log Christopher parsing duties. The project involves parsing the apache Christopher access log. What I need to be able to do is get the time Christopher served data per hour

Re: Hash Help Needed !

2004-03-25 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: foreach my $response ($record-{keys %response_values} ) What is this? It looks like you are trying to use a list as a hash key. I don't think that is going to work. A hash element should take a scalar as its key, not a list: Greetings!

warn ?!

2004-03-25 Thread Jayakumar Rajagopal
Hi, In my program , $sth-execute fails since oracle tables already present. It is very natural. But the waring message output line 37 is different(just behaves as print) from same kind of message at line 57. Any suggestions please.. regards, Jay regression Testing table( default :

Show/download file from a non public folder

2004-03-25 Thread Alex A.
Hi, I have files(.jpg, .pdf, .rtf, .xls) in the following non-public folder: /home/alex/documents/ I need to show these files (jpg), or allow the download (.pdf, .rtf ...) from a script for users who already are authenticated and have a session opened in the server (this part is already

Using Perl Expect.pm

2004-03-25 Thread TapasranjanMohapatra
Hi, Can someone tell me how to handle the vt100 sequences using expect module of perl. I have used the same sequences while using TCL Expect. It works fine. But I don't understand what is the problem while I try doing the same thing using Perl Expect. If my TCL Expect Code goes like:-

Re: Using Perl Expect.pm

2004-03-25 Thread Andrew Gaffney
TapasranjanMohapatra wrote: Hi, Can someone tell me how to handle the vt100 sequences using expect module of perl. I have used the same sequences while using TCL Expect. It works fine. But I don't understand what is the problem while I try doing the same thing using Perl Expect. If my TCL Expect

Apache::Session question

2004-03-25 Thread Perl
My implementation of Apache::Session::MySQL dies along the way, and gives unclear warning. [error] Died at /usr/lib/perl5/site_perl/5.8.0/Apache/Session/Generate/MD5.pm line 40. I decided to implement session as a module call Store::Session, so as to minimize recoding it in many script.

Fwd: Apache::Session question

2004-03-25 Thread B. Fongo
My implementation of Apache::Session::MySQL dies along the way, and gives unclear warning. [error] Died at /usr/lib/perl5/site_perl/5.8.0/Apache/Session/Generate/MD5.pm line 40. I decided to implement session as a module call Store::Session, so as to minimize recoding it in many script. Babs

Re: Hash Help Needed !

2004-03-25 Thread R. Joseph Newton
Normandin, Jason wrote: Hi I am scoping the %response_values hash at the top. I dont understand why it would need to be temporary as I am referancing that hash outside of the loop when I iterate through. I changed the syntax to referance the oids rather then the hash name and I get the

Re: Playing with Unicode

2004-03-25 Thread R. Joseph Newton
James Edward Gray II wrote: Why when I run this one-liner: perl -e 'print \x{2660}\n' do I see this: Wide character in print at -e line 1. Makes sense. 2660 would overflow a one-byte character. I'm assuming that's a warning, since I still get the expected output, but why am I

Re: Passing file name /filehandle as argument to a subroutine...

2004-03-25 Thread John W. Krahn
Urvashi Mishra wrote: hi; Hello, i am trying to take input from multiple files Various I/P files are specified at command line... Can anyone tell me how to pass the file name to a routine that opens it for parsing the same function is to be called for all the I/P files...

Home made mail news search tool, and folded header lines

2004-03-25 Thread Harry Putnam
I'm writing a home boy mail/news search tool and wondered if there is a cononical way to handle folded or indented header lines. An example would be that I wanted to run a series of regex against each line of input (While in headers) grabing the matches into an array for printing. Something

Re: sort

2004-03-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote: any modules out there that can sort things such as.. BB10, BB1100,BB11. I want it to be in this order. BB10,BB11,BB1100. Perl's built-in sort does that: $ perl -le'@x = qw[BB11 BB10 BB1100]; print for @x; print; print for sort @x' BB11 BB10 BB1100 BB10 BB11 BB1100