[18856] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1024 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 31 00:06:00 2001

Date: Wed, 30 May 2001 21:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <991281913-v10-i1024@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 30 May 2001     Volume: 10 Number: 1024

Today's topics:
        Complicated...heh <smichae@ilstu.edu>
    Re: Complicated...heh <uri@sysarch.com>
    Re: Complicated...heh <smichae@ilstu.edu>
    Re: Complicated...heh <godzilla@stomp.stomp.tokyo>
    Re: Complicated...heh <godzilla@stomp.stomp.tokyo>
    Re: Controlling downloads using CGI and Apache <flavell@mail.cern.ch>
        dbi error <todd@designsouth.net>
    Re: dbi error <buggs@geekmail.de>
    Re: Frustrated people (not) answering questions (John Joseph Trammell)
    Re: How Can abtain yesterday or nextday (Eric Bohlman)
    Re: OT: killfiles  (Martien Verbruggen)
        Parsing the arrow operator -> into English (Guy Worthington)
    Re: Parsing the arrow operator -> into English <uri@sysarch.com>
    Re: Parsing the arrow operator -> into English (Damian James)
    Re: Perl Community Stars (?) <mischief@velma.motion.net>
    Re: Perl excercises (Eric Bohlman)
    Re: Perl excercises (E.Chang)
        perl popup <defont@nospam.iinet.net.au>
    Re: perl popup <todd@designsouth.net>
    Re: perl popup <buggs@geekmail.de>
    Re: Problems with CGI-script and stylesheets... (E.Chang)
    Re: Server push and $|? <buggs@geekmail.de>
    Re: Stripping a string down to aplhaNumeric characters/ <not4u@somewhere.in.gl>
    Re: troubleshooting socket problem(s) <uri@sysarch.com>
    Re: Unsure about headers <"relaxedrob@optushome.com.au">
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 30 May 2001 21:45:18 -0500
From: "Steven Michaels" <smichae@ilstu.edu>
Subject: Complicated...heh
Message-Id: <9f4bai$1ra$1@news.ilstu.edu>

Hello!  I was wondering if anyone can help me on this
pretty complex (for me) problem.  I have a program that
reads data from the national weather service (weather
warnings) and translates them onto a map.  There are
county codes on the top of each transmission, and I
use these to color the map.  The problem is that the county
codes must be on one line to be readable by the program.
In some files, they are on two lines, separated by a new
line \n.  The program below currently does the job, but is
EXTREMELY slow, especially considering that it goes
through thousands of files and has to look at each individual
line.  I was wondering if there was a way to simply look at
the end of each line in the file, and if it ended with a -, then
have it remove the \n from that line, making the next line jump
up to the first.  I will post the current SLOW programming,
along with a sample of what I need, and what it gives me:

@essay = split(/\n/,$buf);
foreach $line(@essay){
$length = length($line);
$lengths = $length-2;
$last = substr($line,$lengths);
$justdone = "no";
if ($lasting == 1){
$buf = "$buf$line";
$lasting = 0;
$justdone = "yes";
}
if ($last =~ /-/){
$lasting = 1;
}
$buf = "$buf\n$line" if ($justdone ne "yes" );
}

$buf consists of thousands of weather warnings.  Here is
a file from tonight that is giving me problems since the
county codes (separated by -'s) are on different lines.

TORNADO WATCH
MOC007-015-019-027-029-051-053-085-089-125-131-135-141-151-159-169-
195-310300-
 CENTRAL
  AUDRAIN               BENTON                BOONE
  CALLAWAY              CAMDEN                COLE
  COOPER                HICKORY               HOWARD
  MARIES                MILLER                MONITEAU
  MORGAN                OSAGE                 PETTIS
  PULASKI               SALINE
If you have word wrap on, the two lines are separated by 169
and 195.  I need MOC007...and the next line on the same line,
but can't figure out how to do this without going with the really
slow programming.  Here's what I need:
MOC007-015-019-027-029-051-053-085-089-125-131-135-141-151-159-169-195-31030
0-
Thanks for any help, and sorry for the long post!!
- Steven Michaels
smichae@ilstu.edu




------------------------------

Date: Thu, 31 May 2001 03:24:57 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Complicated...heh
Message-Id: <x7wv6yyzcl.fsf@home.sysarch.com>

>>>>> "SM" == Steven Michaels <smichae@ilstu.edu> writes:

  SM> @essay = split(/\n/,$buf);
  SM> foreach $line(@essay){
  SM> $length = length($line);
  SM> $lengths = $length-2;
  SM> $last = substr($line,$lengths);
  SM> $justdone = "no";
  SM> if ($lasting == 1){
  SM> $buf = "$buf$line";
  SM> $lasting = 0;
  SM> $justdone = "yes";
  SM> }
  SM> if ($last =~ /-/){
  SM> $lasting = 1;
  SM> }
  SM> $buf = "$buf\n$line" if ($justdone ne "yes" );
  SM> }

GACK!!

assuming your text is in buf and only lines ending in - are to be merged
with the next line:

	$buf =~ s/-\n/-/g ;

  SM> Thanks for any help, and sorry for the long post!!

sorry for the short answer. it is the worst i can do.

:)

if the program is still slow, then it probably is elsewhere. given the
quality of the perl you posted, i bet the rest can be simplified and
sped up a great deal.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html


------------------------------

Date: Wed, 30 May 2001 22:31:23 -0500
From: "Steven Michaels" <smichae@ilstu.edu>
Subject: Re: Complicated...heh
Message-Id: <9f4e11$2io$1@news.ilstu.edu>

Yes, I've tried that before, and it doesn't work for some reason.

"Uri Guttman" <uri@sysarch.com> wrote in message
news:x7wv6yyzcl.fsf@home.sysarch.com...
> >>>>> "SM" == Steven Michaels <smichae@ilstu.edu> writes:
>
>   SM> @essay = split(/\n/,$buf);
>   SM> foreach $line(@essay){
>   SM> $length = length($line);
>   SM> $lengths = $length-2;
>   SM> $last = substr($line,$lengths);
>   SM> $justdone = "no";
>   SM> if ($lasting == 1){
>   SM> $buf = "$buf$line";
>   SM> $lasting = 0;
>   SM> $justdone = "yes";
>   SM> }
>   SM> if ($last =~ /-/){
>   SM> $lasting = 1;
>   SM> }
>   SM> $buf = "$buf\n$line" if ($justdone ne "yes" );
>   SM> }
>
> GACK!!
>
> assuming your text is in buf and only lines ending in - are to be merged
> with the next line:
>
> $buf =~ s/-\n/-/g ;
>
>   SM> Thanks for any help, and sorry for the long post!!
>
> sorry for the short answer. it is the worst i can do.
>
> :)
>
> if the program is still slow, then it probably is elsewhere. given the
> quality of the perl you posted, i bet the rest can be simplified and
> sped up a great deal.
>
> uri
>
> --
> Uri Guttman  ---------  uri@sysarch.com  ----------
http://www.sysarch.com
> SYStems ARCHitecture and Stem Development ------
http://www.stemsystems.com
> Learn Advanced Object Oriented Perl from Damian Conway - Boston, July
10-11
> Class and Registration info:
http://www.sysarch.com/perl/OOP_class.html




------------------------------

Date: Wed, 30 May 2001 20:46:51 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Complicated...heh
Message-Id: <3B15BEAB.C32164F7@stomp.stomp.tokyo>

Steven Michaels wrote:

(various snippage)

> In some files, they are on two lines, separated by a new

> $buf = "$buf\n$line" if ($justdone ne "yes" );

> $buf consists of thousands of weather warnings.  Here is
> a file from tonight that is giving me problems since the
> county codes (separated by -'s) are on different lines.

 
> TORNADO WATCH
> MOC007-015-019-027-029-051-053-085-089-125-131-135-141-151-159-169-
> 195-310300-
>  CENTRAL
>   AUDRAIN               BENTON                BOONE


> If you have word wrap on, the two lines are separated by 169
> and 195.  I need MOC007...and the next line on the same line,
> but can't figure out how to do this without going with the really
> slow programming.  Here's what I need:
> MOC007-015-019-027-029-051-053-085-089-125-131-135-141-151-159-169-195-310300-


A presumption is made your $buf contains the data as shown
by your example and, you want those county code numbers to
be one single line.

$buf =~ s/(-)\n(\d)/$1$2/;

You could add a g switch for global treatment if this
is suitable for your data.

$buf =~ s/(-)\n(\d)/$1$2/g;

Be careful using this; it will take effect everywhere
in your $buf where, " hyphen newline digit " -\n\d is
found. This might cause problems.



For trivia, here are some pages which may interest you.

http://iwin.nws.noaa.gov/iwin/nationalwarnings.html

http://www.spc.noaa.gov/products/wwa/wwa.gif

http://www.nws.noaa.gov/oso/oso1/oso12/metar.htm

http://www.hamweather.com/requirements.html


Godzilla! Queen Of Science Geeks.


------------------------------

Date: Wed, 30 May 2001 21:05:59 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Complicated...heh
Message-Id: <3B15C327.592CA044@stomp.stomp.tokyo>

Steven Michaels wrote:

> Uri Guttman wrote:
> > Steven Michaels wrote:

(snippage)

> > assuming your text is in buf and only lines ending in - are to be merged
> > with the next line:

> > $buf =~ s/-\n/-/g ;
 
> Yes, I've tried that before, and it doesn't work for some reason.
 
Then your data presented in your article, is not your true data.
Without a precise and exact sample of your data no one person
can provide an answer without guessing.

Should I be presented with this problem, my first test
would be to remove any possible carriage returns, then
try the substitution presented by Uri.

$buf =~ tr/\r//d;
$buf =~ s/-\n/-/g;

If this works, 

$buf =~ s/-\r\n/-/g;

would be a logical code snippet to test.

If this failed, I would work on replacing all characters
with "print visible characters" to discover if there is
something in there which cannot be printed. Usually a
good program editor will find these if you know what
codes to enter for a search and replace.

What type of system is generating your data initially?
Otherwords, where is your data originating? Some systems
add characters which are print invisible.


Godzilla!


------------------------------

Date: Thu, 31 May 2001 02:47:02 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Controlling downloads using CGI and Apache
Message-Id: <Pine.LNX.4.30.0105310243350.17337-100000@lxplus003.cern.ch>

On 30 May 2001, Dave wrote:

> >> Note that this can be implemented in many other langages; your
> >> question is not Perl-specific,

> It's perl specific, because I want to do it in perl,

That's a logical fallacy.  But as I see you've re-posted your question
with more detail on c.i.w.a.cgi, which seems a better place for it to
me, I'll stop heckling here.

good luck



------------------------------

Date: Thu, 31 May 2001 01:37:58 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: dbi error
Message-Id: <WfhR6.89129$I5.21145623@news1.rdc1.tn.home.com>

when i searched on the web, I just got a bunch of pages that have databases
giving them the same error. What's this mean?

 DBI->connect(todd_db) failed: Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (111)




------------------------------

Date: Thu, 31 May 2001 03:53:50 +0200
From: buggs <buggs@geekmail.de>
Subject: Re: dbi error
Message-Id: <9f4842$4oc$07$3@news.t-online.com>

Todd Smith wrote:

> when i searched on the web, I just got a bunch of pages that have
> databases giving them the same error. What's this mean?
> 
>  DBI->connect(todd_db) failed: Can't connect to local MySQL server through
> socket '/tmp/mysql.sock' (111)

dbi error

Buggs


------------------------------

Date: Thu, 31 May 2001 02:51:11 GMT
From: trammell@bayazid.hypersloth.invalid (John Joseph Trammell)
Subject: Re: Frustrated people (not) answering questions
Message-Id: <slrn9hb9th.f19.trammell@bayazid.hypersloth.net>

[jeapordectomy performed; followup trimmed]
On Wed, 30 May 2001 23:44:48 GMT, Michael D. Risser wrote:
> I agree, we all had to start somewhere, and some of us are just coming
> off the starting line. 
> 
> If you feel that the question is stupid, ignore it. I for one would
> rather have my question go unanswered than have someone attempt to
> degrade me for asking. 

How do you feel about someone deriding you for top-posting then?



------------------------------

Date: 31 May 2001 03:55:04 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: How Can abtain yesterday or nextday
Message-Id: <9f4fao$rvi$2@bob.news.rcn.net>

Philip Newton <pne-news-20010530@newton.digitalspace.net> wrote:
> On Wed, 30 May 2001 15:27:03 +0900 (KST), seo kyeong chan
> <seo@linux.nurine.com> wrote:

>> How can I obtain Yesterday , Tomorrow or
>> nowdate + (x)

> "Tomorrow's date" is easy. Here's a solution similar to one suggested by
> Abigail some time ago:

>     sub tomorrow's_date {
>         sleep 86400;
>         return localtime;
>     }

> This returns a list (from the localtime function) describing tomorrow's
> date.

And getting yesterday's date is just as easy:

sub yesterday's_date {
  sleep -86400;
  my $temp=localtime; #now it's yesterday
  sleep 86401; #return to tommorrow possibly losing a second
  $temp;
}



------------------------------

Date: Thu, 31 May 2001 02:06:04 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: OT: killfiles 
Message-Id: <slrn9hb9oc.epd.mgjv@verbruggen.comdyn.com.au>

On 30 May 2001 18:53:04 GMT,
	Eli the Bearded <elijah@workspot.net> wrote:
> In comp.lang.perl.misc, Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>> 	Abigail <abigail@foad.org> wrote:
>> > Several movies have been made about Godzilla.
>> Yes, but I wouldn't really classify her as a Perl person, more as a
>> cargo-cult misinformant. Or has she improved since my killfile started
>> taking care of threads containing posts from her?
> 
> You killfile the whole thread? Or all followups?

followups, which is enough for my puprose.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.   | again. Then quit; there's no use
NSW, Australia                  | being a damn fool about it.


------------------------------

Date: 30 May 2001 20:29:05 -0700
From: guyw@multiline.com.au (Guy Worthington)
Subject: Parsing the arrow operator -> into English
Message-Id: <33f78556.0105301929.1922c51@posting.google.com>

I don't think in Perl, e.g., the expression $$pointer{$i}, I 
translate to "get the hash value at address $pointer{$i}", 
where $$ I think of as the unary operator "get".  Given the 
equivalent statement $pointer->{$i}, the best I can do is to 
parse from right to left as "the value of the hash for key $i 
access indirectly with pointer $pointer"; this is clumsy.  

I've seen some lucid explanations of Perl code, from 
contributers to this list, perhaps someone would be kind 
enough to give me a better word picture of the infix arrow
operator.


------------------------------

Date: Thu, 31 May 2001 03:44:09 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Parsing the arrow operator -> into English
Message-Id: <x7snhmyygl.fsf@home.sysarch.com>

>>>>> "GW" == Guy Worthington <guyw@multiline.com.au> writes:

  GW> I don't think in Perl, e.g., the expression $$pointer{$i}, I 
  GW> translate to "get the hash value at address $pointer{$i}", 
  GW> where $$ I think of as the unary operator "get".  Given the 
  GW> equivalent statement $pointer->{$i}, the best I can do is to 
  GW> parse from right to left as "the value of the hash for key $i 
  GW> access indirectly with pointer $pointer"; this is clumsy.  

$$ is not an operator in any way. the leading $ dereferences (as a
scalar) the following scalar value. there is no get in that. also that
expression is not proper. $ binds tighter than the hash index so that is
really:

	($$pointer){$i}

which is usually wrong.

  GW> I've seen some lucid explanations of Perl code, from 
  GW> contributers to this list, perhaps someone would be kind 
  GW> enough to give me a better word picture of the infix arrow
  GW> operator.

	$foo->{'bar'}

get the 'bar' element from the hash referred to by foo.

lookup bar in foo's hash

get bar from the foo ref

remember -> is a dereference operator. it always works from a reference
value.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html


------------------------------

Date: 31 May 2001 03:47:54 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Parsing the arrow operator -> into English
Message-Id: <slrn9hbfne.ocg.damian@puma.qimr.edu.au>

Guy Worthington chose 30 May 2001 20:29:05 -0700 to say this:
>I don't think in Perl, e.g., the expression $$pointer{$i}, I 
>translate to "get the hash value at address $pointer{$i}", 
>where $$ I think of as the unary operator "get".  Given the 
>equivalent statement $pointer->{$i}, the best I can do is to 
>parse from right to left as "the value of the hash for key $i 
>access indirectly with pointer $pointer"; this is clumsy.  

It's better not to think of references in Perl as being the same as
pointers in the C universe: this is the road to madness. Instead (if you
must) think of them as *like* pointers, but not the same thing. 
Never refer to them as pointers, always as references.

I find it easiest to keep in mind that a reference is *always* a scalar
value. Then you make sure to disambiguate the $ sigil that belongs to the
reference. So if $pointer is a hash reference, then

	$$pointer{$i} 

is bad - you can't tell just by looking at it whether you mean

	${$pointer{$i}} ### the hash value is a ref to a scalar
or
	${$pointer}{$i} ### $pointer is a hashref

So always use the braces to disambiguate, though I do prefer the ->
notation:

	$pointer->{$i}

I almost always think of -> as 'dereference', and nearly forget there is
any indirection going on. The only bad habit this seems to lead me into is
sometimes using hashes and hashrefs interchangeably. 

But for what you say above, I'd describe this as "the value for key $i in
the anonymous hash referred to by $pointer". 
	
>I've seen some lucid explanations of Perl code, from 
>contributers to this list... 

I hope this is lucid enough :-).

HTH,
Cheers,
Damian
-- 
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;)
{@;[$;,$:]=@;[$:,$;]if($:=rand$;+$|)!=$;}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3.1 -- a JAPH in progress, I guess...


------------------------------

Date: Thu, 31 May 2001 03:56:07 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Perl Community Stars (?)
Message-Id: <thbg6n51hfbr56@corp.supernews.com>

Abigail <abigail@foad.org> wrote:
> Chris Stith (mischief@velma.motion.net) wrote on MMDCCCXXIX September
> MCMXCIII in <URL:news:thanqdj5b32156@corp.supernews.com>:
> :}  
> :}  I think one reason there are so many well-known people in the
> :}  Perl community is because the language is so vast. It takes
> :}  someone with an exceptional knowledge of the language to know
> :}  the best ways to do a wide range of things. In C, you can
> :}  consult Knuth then write code that optimizes well. In Perl,
> :}  there's room for many people to contribute many ways to do the
> :}  same thing to the same group, and to have nearly equally
> :}  performing implementations.


> It looks like you are implying that you can't take Knuth then write
> optimized code in Perl.

One can do this, but it's not always going to be the fastest
way to do it, let alone the clearest (not that Knuth always
is the clearest compared to naive algorithms). Since so much
optimization goes on behind the scenes with Perl (and other
languages at a similar level), it's more difficult to judge
how code will perform without the experience (and often,
it's still difficult with experience and without Benchmark).

> That might be true. But I wouldn't call that a positive thing for Perl.

I don't think it's true. I think one can do a fairly straight
translation from MIX in Knuth to Perl, but I don't think that
a _straight_ translation will be the _best_ translation much of
the time.

Chris

-- 
You must not lose faith in humanity. Humanity is an ocean;
if a few drops of the ocean are dirty, the ocean does not
become dirty.  -- Mohandas K. Gandhi



------------------------------

Date: 31 May 2001 03:50:18 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Perl excercises
Message-Id: <9f4f1q$rvi$1@bob.news.rcn.net>

Lynn <lglessner@hotmail.com> wrote:
> You're right, I haven't figured it out. I personally *like* people to post
> the reply at the top so I don't have to scroll down. I have seen people
> complain about "top-posting" before, though, so I guess I'm in the minority.
> I'll just try and remember to put my answer at the bottom even though it
> makes no sense to me - just do it.

Jeopardy quoting works just fine in a help-desk environment, where a
"transaction" consists of asking a single question and getting a single
answer.  It doesn't work so well in a conversational environment (like
this newsgroup) where an initial post leads to a thread of responses and
it's often that case that one needs to follow up to something said in a
response rather than the initial post.  In the latter case, it's 
impossible to quote that something in a proper context without doing a lot 
of rearrangement.

The scrolling problem can be completely eliminated by taking care to quote 
only the portion of the post that you're actually replying to rather than 
the whole thing; snipping is *not* considered rude unless you do it in 
such a way as to misrepresent what the original poster said.  If you're 
responding to more than one point, quote enough of the first point to 
provide context, respond to it, quote enough of the second point to 
provide context, respond to it, etc. rather than lumping all the responses 
together.

Another reason to avoid Jeopardy quoting here is that there are some 
services that make this newsgroup available in mailing-list form, with a 
digest available.  When you jeopardy-quote inside a digest, you force the 
digest reader to skip over the same thing being quoted over and over again 
(even worse is what happens when an uninformed person uses Outlook Express 
to reply to a message in a digest on an unmoderated list; they wind up 
posting a quoted copy of the whole digest).



------------------------------

Date: Thu, 31 May 2001 04:03:42 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: Perl excercises
Message-Id: <Xns90B21187D328echangnetstormnet@207.106.92.86>

"Lynn" <lglessner@hotmail.com> wrote in
<vDdR6.3477$651.193814@newsread1.prod.itd.earthlink.net>: 

[...]

>You're right, I haven't figured it out. I personally *like* people
>to post the reply at the top so I don't have to scroll down. I have
>seen people complain about "top-posting" before, though, so I guess
>I'm in the minority. I'll just try and remember to put my answer at
>the bottom even though it makes no sense to me - just do it.
>

See http://www.geocities.com/nnqweb/nquote.html for a good example of 
how top-posting can become very confusing .  

[...]

-- 
EBC


------------------------------

Date: Thu, 31 May 2001 09:35:10 +0800
From: "Banshee" <defont@nospam.iinet.net.au>
Subject: perl popup
Message-Id: <3b159fbd$0$12445@echo-01.iinet.net.au>

Hi,

I was wondering if it is possible to write a perl script that pops up a
window (at predefined size) to dynamically display info. Rather like a
Javascript on-the-fly pop up window.

Is this possible or is it beyond the scope of perl?

TIA,
Malissa




------------------------------

Date: Thu, 31 May 2001 01:38:43 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: perl popup
Message-Id: <DghR6.89130$I5.21146071@news1.rdc1.tn.home.com>


"Banshee" <defont@nospam.iinet.net.au> wrote in message
news:3b159fbd$0$12445@echo-01.iinet.net.au...
> Hi,
>
> I was wondering if it is possible to write a perl script that pops up a
> window (at predefined size) to dynamically display info. Rather like a
> Javascript on-the-fly pop up window.
>
> Is this possible or is it beyond the scope of perl?
>

perl is interpreted on the server, not in the browser. I guess you could
have it output javascript.




------------------------------

Date: Thu, 31 May 2001 03:47:23 +0200
From: buggs <buggs@geekmail.de>
Subject: Re: perl popup
Message-Id: <9f47nu$4oc$07$2@news.t-online.com>

Banshee wrote:

> Hi,

Hoi
 
> I was wondering if it is possible to write a perl script that pops up a
> window (at predefined size) to dynamically display info. Rather like a
> Javascript on-the-fly pop up window.
> 
> Is this possible or is it beyond the scope of perl?

use Tk;

Buggs


------------------------------

Date: Thu, 31 May 2001 02:39:17 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: Problems with CGI-script and stylesheets...
Message-Id: <Xns90B1E6ECB99EEechangnetstormnet@207.106.92.86>

"Rene Scheibe" <Rene.Scheibe@gmx.net> wrote in
<9f3m18$249k4$1@ID-65612.news.dfncis.de>: 

> I have a website which autoloads a cgi-script
> written in perl. The output of the script is the
> following:
>     Content-type: text/html
>     <HTML>
>     <HEAD>
>     <meta http-equiv="content-type"
>     content="text/html;charset=iso-8859-1"> <link rel="stylesheet"
>     href="css/menue_left.css"> </HEAD>
>     <BODY>
>     Externe IP: 217.80.140.34
>     </BODY>
>     </HTML>
> 
> My problem is that the browser doesn't use the stylesheet-file.
> But when I copy the code by hand to an html-file and put it on
> my apache-webserver everything works fine.
> Can you tell me something about it.
> Yes I know it's not really content of this NG.
> 
Right.  Better to try comp.infosystems.www.authoring.cgi for such 
questions.

First guess is that the script is not in the same directory that the 
static .html files are.  If that's the case, the browser is asking for 
the css file from the wrong place.  For example, the script might be  
at http://what.where.net/cgi-bin/script.cgi and the stylesheet at 
http://what.where.net/css/sheet.css.  You can either provide the full 
path to the stylesheet file or print a base path in the script output.

-- 
EBC


------------------------------

Date: Thu, 31 May 2001 03:43:17 +0200
From: buggs <buggs@geekmail.de>
Subject: Re: Server push and $|?
Message-Id: <9f47gg$4oc$07$1@news.t-online.com>

BCC wrote:

> I have been reading up on the server push stuff from CGI.pm and am
> unclear on something.
> 
> Why is it recommended that you set $| to 1 to avoid buffering problems?

Because you probably want to transmit a whole chunk of data.
Imagine for example one chunk of data represents one site.
Without autoflushing the last part of the site migth stay in the buffer.

> I should be doing in all of my perl scripts?

No, only where you need it.

> Also (somewhat off topic) does there exist perl server push that works
> with IE?  I scoured CPAN and came up empty.

You tried CGI::Push ?

Buggs


------------------------------

Date: Wed, 30 May 2001 23:37:53 -0200
From: "Steffen Moeller" <not4u@somewhere.in.gl>
Subject: Re: Stripping a string down to aplhaNumeric characters/Using variables  in Reg Expressions
Message-Id: <newscache$2ze6eg$njf$1@news.greennet.gl>

Hello,

Would somebody please help me expand this statement to include the danish
character represented by the html entity '&oslash' ? (This would make the
statement multilingual :-) )

Any reply would be appreciated.

Thanks,

- Steffen

"James" <james@NOSPAMPLEASEthesinner.co.uk> wrote in message
news:9f0f8g$jn9$1@phys-ma.sol.co.uk...
> >
> > $text_string =~ tr/a-z0-9//cd;
> >
> >
> > John





------------------------------

Date: Thu, 31 May 2001 02:28:45 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: troubleshooting socket problem(s)
Message-Id: <x766ei1cbm.fsf@home.sysarch.com>

>>>>> "DS" == Derek Shaw <he.is@bigfoot.com> writes:

  DS> #   Configuration file for redirex version 1.0
  DS> #
  DS> #   If your system doesn't use standard System V values for
  DS> #   the following (as is the case for some BSD-derived systems
  DS> #   such as SunOS 4.x), replace them with the correct values
  DS> #   from your /usr/include/sys/socket.h and /usr/include/sys/errno.h
  DS> #   files.  The proper Perl way to do is to include .ph files created
  DS> #   by h2ph from the corresponding C include files, but I've found
  DS> #   many Perl installations have not set up these files correctly.
  DS> #   Hard coding is ugly, but it avoids having to fight with the Perl
  DS> #   installation just to get this program running.  The comment gives
  DS> #   the directory in C notation, usually below /usr/include, where
  DS> #   the definition can usually be found.

that is very stupid stuff. all modern perl's have those constants
available in Socket.pm. hardwiring them is gonna bite you know matter what.


  DS> $AF_INET = 2;               # Internet address family <sys/socket.h>

  DS> #   Default port to listen to. If the -p switch is used
  DS> #   to specify another port, this value will not be used.


  DS> the socket.h, errno.h and included files from the Linux box:

  DS> CONTENTS of /usr/include/bits/socket.h (see include statement in
  DS> /usr/include/sys/socket.h)

  DS> Since I fear I have already included too much, I will omit the
  DS> contents of both the redirex script and /usr/include/sys/socket.h,
  DS> unless someone thinks it would help.


so what is your problem? stop using his stupid include crap. just put in

use Socket ;

and even better use the IO::Socket module and the INET class. it does
all the socket stuff you want. throw out all the socket making code and
replace it with that.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html


------------------------------

Date: Thu, 31 May 2001 03:07:32 GMT
From: "Rob" <"relaxedrob@optushome.com.au">
Subject: Re: Unsure about headers
Message-Id: <UziR6.5282$25.19080@news1.eburwd1.vic.optushome.com.au>

Howdy all!

<cut>
> My problem is this: even though I can see that the new form attributes are
being
> received each time the script calls itself, the sql object seem to be stuck
with
> old values.

Because I am using mod_perl, the script instance sticks around - with the last
values it had stored.. that was my problem.

Rob





------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 1024
***************************************


home help back first fref pref prev next nref lref last post