Re: Reading the file using tell and seek method

2007-11-06 Thread sivasakthi
Sorry..the actual tried coding is following, #!/usr/bin/perl use strict; use warnings; use Tie::File; my ($Ltimestamp,$Lelapsed,$Lhost,$Ltype,$Lsize,$Lmethod,$Lurl,$Luser, $Lhierarchy,$Lconttype); my($name,$pos,$name1,$no,$tmp,$Ltimestamp1); our $tmpp; my $file="/file/path"; open(FH,"tmp.txt") ||

Re: simplest of simple web servers

2007-11-06 Thread Willy West
> http://search.cpan.org/ > > Cheers! > > --Tom Phoenix > Stonehenge Perl Training > Well of course! *laugh* funny how staring at a book for hours on end addles the brain. http://search.cpan.org/~jesse/HTTP-Server-Simple-0.27/lib/HTTP/Server/Simple.pm seems to have what I want. it will t

Reading the file using tell and seek method

2007-11-06 Thread sivasakthi
Hi All, I have one requirement, the file content is following, it is a dynamic file, 1194240905.451105 127.0.4.56 TCP_MISS/200 2853 GET cache_object://localhost/info - NONE/- text/plain 1194240905.452 0 127.0.0.1 TCP_MISS/200 2853 GET cache_object://localhost/info - NONE/- text/plain 11

Re: simplest of simple web servers

2007-11-06 Thread Jeff Pang
Writting a webserver by yourself is not so easy I have to say. You must know well about http protocal handling and http connection status. Lincoln Stein has made a simple web server in his book "network programming with perl", you may take that as a reference. -Original Message- >From: W

Re: simplest of simple web servers

2007-11-06 Thread Tom Phoenix
On 11/6/07, Willy West <[EMAIL PROTECTED]> wrote: > Anyway, I'd like to make a perl webserver as simply as possible so > that I can play with dynamic web pages without configuring apache > everywhere I go.. actually a webserver in a USB key would be fun :) > > I figured that I'd come here to see

simplest of simple web servers

2007-11-06 Thread Willy West
just the simplest webserver one can imagine. I made a POE web server a long time ago and it was fun. I've long since lost that code. Anyway, I'd like to make a perl webserver as simply as possible so that I can play with dynamic web pages without configuring apache everywhere I go.. actually a

XP UDP broadcast

2007-11-06 Thread kenTk
I am posting this problem and the solution to spread the news a little about a nasty bug in XP. PROBLEM I have a Perl (activestate) 5.8.8 script that uses IO::Socket::INET; and opens a broadcast UDP socket. The packets are received successfully by another host running a similar script as long as I

Re: Referencing a hash to be dereferenced...

2007-11-06 Thread Paul Lalli
On Nov 6, 12:55 pm, [EMAIL PROTECTED] (Chas. Owens) wrote: > On 11/6/07, Paul Lalli <[EMAIL PROTECTED]> wrote: > snip> > my $filekey = $filekey.$sched_id; > > > This makes no sense. You're declaring a variable on the left and > > assigning it to be a string that results in part from t

Re: Referencing a hash to be dereferenced...

2007-11-06 Thread Paul Lalli
On Nov 6, 12:55 pm, [EMAIL PROTECTED] (Chas. Owens) wrote: > On 11/6/07, Paul Lalli <[EMAIL PROTECTED]> wrote: > snip> > my $filekey = $filekey.$sched_id; > > > This makes no sense. You're declaring a variable on the left and > > assigning it to be a string that results in part from t

Re: Issue while calling the subroutine dynamically

2007-11-06 Thread Chas. Owens
On 11/6/07, Ab <[EMAIL PROTECTED]> wrote: snip > Now, The thing I am trying to achieve is to call abhinav::test::test2 > on the runtime. > ie, I am passing the value 'abhinav::test::test2' in a variable, and > trying to exec in the code below, and this place I am failing. > Can someone help me as t

Re: Referencing a hash to be dereferenced...

2007-11-06 Thread Chas. Owens
On 11/6/07, Paul Lalli <[EMAIL PROTECTED]> wrote: snip > > my $filekey = $filekey.$sched_id; > > This makes no sense. You're declaring a variable on the left and > assigning it to be a string that results in part from the > concatenation of that variable on the right. When the right

Re: Referencing a hash to be dereferenced...

2007-11-06 Thread Paul Lalli
On Nov 6, 9:36 am, [EMAIL PROTECTED] (Lawrence Statton) wrote: > > I have a function in a lib that we use that has two referenced > > hashes. > > No, you have a method in a class that has two referenced hashes. > Computers are frustratingly pedantic, and mastering the art requires > the same level

Re: Referencing a hash to be dereferenced...

2007-11-06 Thread Lawrence Statton
> > No, you have a method in a class that has two referenced hashes. > Computers are frustratingly pedantic, and mastering the art requires > the same level of attention do detail at the human leve. level. And exceent prufreeding skils. -

Re: Referencing a hash to be dereferenced...

2007-11-06 Thread Lawrence Statton
> I have a function in a lib that we use that has two referenced > hashes. No, you have a method in a class that has two referenced hashes. Computers are frustratingly pedantic, and mastering the art requires the same level of attention do detail at the human leve. > > > > my $zone = $se

Re: Referencing a hash to be dereferenced...

2007-11-06 Thread Paul Lalli
On Nov 5, 7:45 pm, [EMAIL PROTECTED] (Beach Cruise) wrote: > I have an interesting issue that I am not able to seem to get around. > > I have a function in a lib that we use that has two referenced > hashes. > > > my $zone = $self->{'zone'}; > my $params = $self->{'report-params'}; > my %zon

Re: How to get teh line before a last from file

2007-11-06 Thread Paul Lalli
On Nov 6, 5:28 am, [EMAIL PROTECTED] (Sivasakthi) wrote: > How to get the line before a last line from file?? Here's a few off the top of my head. I'm sure there's more. #1 open my $fh, '<', $file or die $!; my $before_last = (<$fh>)[-2]; #2 open my $fh, '<', $file or die $!; my ($last, $before

Re: Issue while calling the subroutine dynamically

2007-11-06 Thread John W . Krahn
On Tuesday 06 November 2007 00:40, Ab wrote: > I have a package with the following contents. > --- > package abhinav::test; > > use strict; > use warnings; > > sub test1 > { > return "\nHello World"; > } > > sub test2 > { > my ($include) = @_; > foreach my $row (@$

Re: Problem with scope in CGI script

2007-11-06 Thread John W . Krahn
On Tuesday 06 November 2007 00:24, Gunnar Hjalmarsson wrote: > John W . Krahn wrote: > > On Sunday 04 November 2007 18:06, Mike Martin wrote: > >> sub run_cmd { return print > > > > print() returns either true or false. Why are you returning this > > value from your sub? > > > >> span( { -class =>

Referencing a hash to be dereferenced...

2007-11-06 Thread Beach Cruise
I have an interesting issue that I am not able to seem to get around. I have a function in a lib that we use that has two referenced hashes. my $zone = $self->{'zone'}; my $params = $self->{'report-params'}; my %zone_list = (); $count = $zone->generate_zone_list(\%zone_list,\%params);

Issue while calling the subroutine dynamically

2007-11-06 Thread Ab
I have a package with the following contents. --- package abhinav::test; use strict; use warnings; sub test1 { return "\nHello World"; } sub test2 { my ($include) = @_; foreach my $row (@$include) { push (@$row, @$row[0] + 1

How to get teh line before a last from file

2007-11-06 Thread sivasakthi
Hi All, How to get the line before a last line from file?? Thanks, Siva

Re: Get the byte position of previous line from last line in file

2007-11-06 Thread Gunnar Hjalmarsson
sivasakthi wrote: I have the text file as following, this first line this is the second line this the third line this is the fourth line this is the sixth line this is the seventh line while opening and reading that text file, is it possible to get the byte position of "this is the sixth line"

Re: regexp with capture of multiple lines matching a line pattern

2007-11-06 Thread Frank Bergemann
In case s.o. else will have the same problem. Here's, how i solved it "my way": [...] # storage for APN data (multiple lines) my %APNdata; my @APNarray; [...] APNID PDPADDEQOSID VPAA PDPCHPDPTY PDPID (?:[ ]+(\\d+)(?{\$APNdata{'APNID'} = \$^N;})[ ]+(\\d+)(?{\ $APNdata{'EQOS

Re: Problem with scope in CGI script

2007-11-06 Thread Gunnar Hjalmarsson
John W . Krahn wrote: On Sunday 04 November 2007 18:06, Mike Martin wrote: sub run_cmd { return print print() returns either true or false. Why are you returning this value from your sub? span( { -class => 'place_cmd' }, submit( -name => 'action', -value => shift ) ), p }; ... run_cmd(