[9497] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3091 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 8 03:07:20 1998

Date: Wed, 8 Jul 98 00:00:52 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 8 Jul 1998     Volume: 8 Number: 3091

Today's topics:
    Re: -w on production code (was Re: better way of gettin <ljz@asfast.com>
    Re: -w on production code (was Re: better way of gettin <tchrist@mox.perl.com>
    Re: DESPERATE hitters? <tchrist@mox.perl.com>
    Re: DESPERATE hitters? (Martien Verbruggen)
        Do I understand this? (Phillip George Geiger)
    Re: Do I understand this? (brian d foy)
    Re: Do I understand this? <tchrist@mox.perl.com>
    Re: Do I understand this? (Abigail)
    Re: Do we need lame msgs in discussions? Re : Martien V (Martien Verbruggen)
        Do you know some code for jumping to web sites? (Bin95)
    Re: Do you know some code for jumping to web sites? (brian d foy)
    Re: Gateway (-)
    Re: How can I process a data file from the Web? <snif@xs4all.**>
    Re: How make a variable name from a datafile? (-)
    Re: How to get files in a directory? <tchrist@mox.perl.com>
    Re: HTTP connections WITHOUT the libwww module? <snif@xs4all.**>
    Re: Installing Perl and mSQL on DG/ux, AViiON <scgyong@dev.bbcom.co.kr>
    Re: Is posting via CGI script that dangerous? (Tad McClellan)
    Re: Music w/ Perl (-)
    Re: new charter and moderator for comp.lang.perl.announ <pgunn01@ibm.net>
    Re: newbie Location: syntax help wanted (-)
    Re: on the fly subs with special tag markers Re: method (brian d foy)
    Re: Perl trivia: hash definition w/o initialization? (brian d foy)
    Re: print <<STRING; (-)
    Re: print <<STRING; <ljz@asfast.com>
    Re: print <<STRING; (brian d foy)
    Re: print <<STRING; (Larry Rosler)
        question about objects (Mark-Jason Dominus)
    Re: Two commands, one button. (-)
    Re: What does this error mean? (-)
    Re: What does this error mean? (brian d foy)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 08 Jul 1998 01:17:21 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <lt3ecc9b1a.fsf@asfast.com>

abigail@fnx.com (Abigail) writes:

> Lloyd Zusman (ljz@asfast.com) wrote on MDCCLXXII September MCMXCIII in
> <URL: news:ltr9zx83v6.fsf@asfast.com>:
> ++ 
> ++ If using `-w' was clearly an advantage in all production code, then
> ++ why is this an *option* in the first place?  Wouldn't it be best, if
> ++ this were the case, that `-w' disappear as an option altogether, and
> ++ its behavior be the default?  There could then be a different option
> ++ to turn off these warnings in the odd, occasional, esoteric cases
> ++ where they might not be wanted.
> 
> Backwards compatibility demands that the -w switch cannot suddenly become
> the default.

But this is almost the same reason that some people give for not
wanting to use `-w' in production code: they don't want to have to
deal with the side-effects and consequences of their existing
installed Perl program base (which in some cases is rather large)
suddenly running under this option.  Isn't the totality of Perl code
that is running in the world just an example of larger installed
program base?

And please know that I'm not trying to push the idea of not using
`-w'.  On the contrary, I agree with you and others who state that
it's a good idea to use it.

Perhaps mandatory `-w' processing could be phased in, with more and
more warnings showing up by default in each new Perl release, and with
a new switch which could be used to disable them.  After a few
releases under this scenario, `-w' would end up being essentially a
no-op.

> [ ... ] Furthermore, if you type a quick, one-shot one-liner on
> the command line, you probably don't need -w.  (Although I almost always
> do anyway).

Good point ... although `-e' could also be redefined to disable the
mandatory warnings that would otherwise show up without this switch.


-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: 8 Jul 1998 05:50:24 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6nv1b0$djg$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    cberry@cinenet.net (Craig Berry) writes:
:  BUGS                                
:       The -w switch is not mandatory.
:
:So clearly someone in the Larry/Randal/Tom triumvirate agrees with you
:(and me).

Enough of this silliness.  Randal has never had anything to do
with the free Perl docuematation.  Let's give credit where it's due.

--tom
-- 
A power tool is not a toy.  Unix is a power tool.


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

Date: 8 Jul 1998 05:57:15 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: DESPERATE hitters?
Message-Id: <6nv1nr$djg$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Azman Shariff <azman@bnex.com> writes:
:Selfish lot I would say. 

You seem to have mistaken this newsgroup for comp.lang.perl.helpdesk,
which you'll find just down the block on your left.

--tom
-- 
    > This made me wonder, suddenly: can telnet be written in perl?
    Of course it can be written in Perl.  Now if you'd said nroff, 
    that would be more challenging...   --Larry Wall


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

Date: 8 Jul 1998 05:47:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: DESPERATE hitters?
Message-Id: <6nv15s$pe9$2@comdyn.comdyn.com.au>

In article <35A1A114.7B783B07@bnex.com>,
	Azman Shariff <azman@bnex.com> writes:

> Anyway no offence to the lot of you flamers..... just that what we need
> is REAL help and advice.... if should you need to 'attack' someone for
> his stupidity or ignorance.... please use a better approach ... maybe
> you lamers should read the book entitled "Flaming for IDIOTS".. thank
> you :)

You, sir, are what is commonly known as a troll.

You seem to have a big mouth for someone who has 8 posts to this group
archived on dejanews. Maybe you should stay around a lot longer, and
then talk again.

[Followups]

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 8 Jul 1998 05:19:19 GMT
From: geiger@cs.ucdavis.edu (Phillip George Geiger)
Subject: Do I understand this?
Message-Id: <6nuvgn$ie8$1@mark.ucdavis.edu>


I want to put some advertising banners on my web site.  They generally
pay a set amount per click from a unique IP address.

What I want to do is replace the link to their site with a link
to a cgi program which does some bookkeeping for me and then
redirects the client to the sponsor's web site.

But someone told me that
	print:  "Location: http://www.mysponsor.com/?mycode\n\n";
will cause *my* server to send an http request to the sponsor's
site, get the data, and then forward it to the client's computer.
This is no good, since from the sponsor's point of view every 
click would seem to be coming from my server -- not the client.

Is this correct?  It seems to me that the smart way for my server
to handle a redirect is to send the client browser the address, and
let *it* directly contact the other site.  Why should my server
be a "middleman" between my sponsor's site and the client who's
browsing my site?  Did my source lie to me?  :)

My apologies if this belongs in a cgi newsgroup, or if it has
been addressed a zillion times before.  Every FAQ I could find
did not specifically address this issue, DejaNews was no help,
and even browsing a half dozen CGI books at a local bookstore
didn't help.

Thanks in advance.


-- 
Phil Geiger
Visit the Linux Book Guide
http://members.bellatlantic.net/~ptgeiger/guidehome.htm


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

Date: Wed, 08 Jul 1998 01:47:48 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Do I understand this?
Message-Id: <comdog-ya02408000R0807980147480001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6nuvgn$ie8$1@mark.ucdavis.edu>, geiger@cs.ucdavis.edu (Phillip George Geiger) posted:

>But someone told me that
>        print:  "Location: http://www.mysponsor.com/?mycode\n\n";
>will cause *my* server to send an http request to the sponsor's
>site, get the data, and then forward it to the client's computer.

that person needs a bit more quality time with the RFCs and
broswer theory.  the web just doesn't work like that.

>My apologies if this belongs in a cgi newsgroup, or if it has
>been addressed a zillion times before.  Every FAQ I could find
>did not specifically address this issue, DejaNews was no help,
>and even browsing a half dozen CGI books at a local bookstore
>didn't help.

it's the HTTP specification, and it's definately not Perl.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: 8 Jul 1998 05:59:59 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Do I understand this?
Message-Id: <6nv1sv$djg$4@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    geiger@cs.ucdavis.edu (Phillip George Geiger) writes:
:I want to put some advertising banners on my web site.  

Gosh, that'll sure win you a lot of friends.

--tom
-- 
You are the sponsor for the account andrew (Andrew Hume).


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

Date: 8 Jul 1998 06:37:11 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Do I understand this?
Message-Id: <6nv42n$j15$1@client3.news.psi.net>

Phillip George Geiger (geiger@cs.ucdavis.edu) wrote on MDCCLXXII
September MCMXCIII in <URL: news:6nuvgn$ie8$1@mark.ucdavis.edu>:
++ 
++ But someone told me that
++ 	print:  "Location: http://www.mysponsor.com/?mycode\n\n";
++ will cause *my* server to send an http request to the sponsor's


Please read the RFC.


This is not a Perl question.



Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: 8 Jul 1998 05:43:04 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Do we need lame msgs in discussions? Re : Martien Verbruggen
Message-Id: <6nv0t8$pe9$1@comdyn.comdyn.com.au>

In article <35A1A291.475F043F@bnex.com>,
	Azman Shariff <azman@bnex.com> writes:
> Why would a simple request to know how to check the size of an array be
> given a reply that is included with a flame from you??

Again, very slowly:

You deserved the flame because you stated that you couldn't be
bothered to look it up yourself. The rest of the post clearly told you
what the answer was, and how to get to it. It also advised you to get
familiar with a subset of the documentation that is just needed to be
able to program in perl. If you feel hurt by the post, instead of
taking what it said to heart, then that is your problem. Not mine.

> I have asked some obvious questions before here ( i admit) but then the
> replies i get are great like
> 
> "please refer to the docs by typing        perldoc blah blah "
> 
> That is much a better reply... than one that comes from the 3rd class

3rd class of what? You mean school or so?

> The moment i got your reply i was shocked to receive a stopid remark
> with the answer at the bottom. Think about it.... or go play with your
> granchildren.

My grand children?

never mind. I'm too busy to get drawn into this.

[follow-ups and kill]

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.       | selective about it's friends.
NSW, Australia                      | 


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

Date: 8 Jul 1998 05:04:17 GMT
From: bin95@aol.com (Bin95)
Subject: Do you know some code for jumping to web sites?
Message-Id: <1998070805041700.BAA06355@ladder03.news.aol.com>

I am trying to add to my perl cgi script for processing a form. I want it to
jump to a differant web page than the one the form/ cgi is modifying. Do you
know some code for jumping to web sites?
Also syntax to add a subbrouteen to do this? Any help would be much
appreciated, please email bin95@aol.com Thanks
bin95@bin95.com


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

Date: Wed, 08 Jul 1998 01:38:31 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Do you know some code for jumping to web sites?
Message-Id: <comdog-ya02408000R0807980138310001@news.panix.com>
Keywords: from just another new york perl hacker

In article <1998070805041700.BAA06355@ladder03.news.aol.com>, bin95@aol.com (Bin95) posted:

>I am trying to add to my perl cgi script for processing a form. I want it to
>jump to a differant web page than the one the form/ cgi is modifying. Do you
>know some code for jumping to web sites?
>Also syntax to add a subbrouteen to do this?

sub go_elsewhere
   {
   print "Location: http://www.pm.org\n\n";
   }

you might also see the documentation for CGI.pm as well.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: Wed, 08 Jul 1998 05:20:20 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Gateway
Message-Id: <35a30170.2234785@nntp.idsonline.com>

"Just this guy, you know" <aaron@soltec.net> Said this:

>HI
>
>I was wondering
>
>is there a news to email gateway for comp.lang.perl.misc like there is for
>the sendmail newsgroup?
>
>Unfortunately, I can't read newsgroups at work, and would like to keep up
>with this one
>

Why not? just get free agent or any usenet client, or use (if you
absolutely have to) deja news.




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

Date: Wed, 8 Jul 1998 08:04:20 +0200
From: "jonkers" <snif@xs4all.**>
Subject: Re: How can I process a data file from the Web?
Message-Id: <6nv242$324$1@news.gns.getronics.nl>

brian d foy wrote in message ...
>In article <Pine.SOL.3.96.980707182240.2897A-100000@ux10.cso.uiuc.edu>, I
know Alan Wong! <shargo@students.uiuc.edu> posted:
>
>>        I want to be able to process a .dat file from another server, and
>>I don't know if there's an easy way to do it or not (I expect that there
>>is). A co-worker suggested LWP; I don't know anything about it, and I
>>figured a lot of people on this newsgroup have done this before.
>
>LWP comes with great documentation and plenty of examples.

And there is a 13 line example on page 207 of Learning Perl, 2nd edition
that will get you started.

Sander






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

Date: Wed, 08 Jul 1998 05:00:57 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: How make a variable name from a datafile?
Message-Id: <35a2fb09.595293@nntp.idsonline.com>

mgjv@comdyn.com.au (Martien Verbruggen) Said this:

>In article <6mppuq$7r8$1@news.alliance.net>,
>	munn@bigfoot.com (Thomas Munn) writes:
>>   All:
>>      
>>      I am writing a perl program that stores the following data:
>>      
>>      First name is User ID, and the one that I want to Key off of.  The 
>>      rest of the data should be stored in the variable name (automatically 
>>      parsed) from the first name.  I talked to a friend and he suggested 
>>      "hard" references.  Frankly, I read about them but I have no idea as 
>
>I'd suggest a hash table.
>
<snip>
>
># The hash to hold all the data
>#
># perldoc perldata
>#
>my %data;
>
># read each record in turn from __DATA__
>#
>while (<DATA>)
>{
>	# Store all the fields in an array
>	#
>	my @fields = split /\n/;
>
>	# The first field is the identifier
>	#
>	my $key = shift(@fields);
>
>	# You didn't specify how you wanted the rest of the data stored.
>	# I'll store it as an anonymous array reference.
>	#
>	# perldoc perlref
>	# perldoc perllol
>	#
>	$data{$key} = \@fields;
>}
>

I just got my summer issue of The Perl Journal, so I'm still soaking
it all in...... but anyway.  Your answer is the best solution, but it
may be the hardest one to figure out.  I'm going to make a feeble
attempt to make it clearer - not that you weren't clear, just that
references are confusing as hell. (I'd also suggest getting the summer
issue of TPJ just for that one article alone)

I'll use the example from the article, as it seems to be similar to
what Thomas is trying to do:

You have a file of city and state names like this:

Chicago, Illinois
New York, New York
Albany, New York
Springfield, Illinois
Trenton, New Jersey
Evanston, Illinois

and you want to produce output like this:

Illinois: Chicago, Evanston, Springfield.
New Jersey: Trenton.
New York: Albany, New York.

the code to do that is as follows....

while (<>)	 {
	chomp;
	my ($city, $state) = split /, /;
	push @{$table{$state}}, $city;
}

foreach $state (sort keys %table) {
	print "$state: ";
	my @cities = @{$table{$state}};
	print join ', ', sort @cities;
	print ".\n";
}

So what happens is you've created something that looks like this:

%table = ( "Illinois" => [Chicago, Evanston, Springfield], 
	"New Jersey" => [Trenton],
	"New York" => [Albany, New York] );

I'm probably really way off the mark here, but my understanding is
that what you have here is a hash that consists of arrays for values -
that's the simplest answer I can come up with to make sense of it.  


	push @{$table{$state}}, $city;

this line pushes the contents of $city into an array, which is the
value of $state key  in the hash %table.  Hey, I'm just trying to make
it easier to understand.... help me if I'm making it more complicated
;)





># To prove that it works:
>#
>foreach my $key (keys %data)
>{
>	print "KEY:    $key\n";
>	print 'VALUES: ', join(' : ', @{$data{$key}}), "\n\n";
>}
>
>__DATA__
>skklk02
>ken l. kolassa
>16
>132
>708533
>
>uscgme02
>garnet m. eckstrand
>2
>17
>68710
>uskcab05
>
>OUTPUT:
>KEY:    skklk02
>VALUES: ken l. kolassa : 16 : 132 : 708533
>
>KEY:    uscgme02
>VALUES: garnet m. eckstrand : 2 : 17 : 68710 : uskcab05
>
>Martien
>-- 
>Martien Verbruggen                  | 
>Webmaster www.tradingpost.com.au    | 75% of the people make up 3/4 of the
>Commercial Dynamics Pty. Ltd.       | population.
>NSW, Australia                      | 



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

Date: 8 Jul 1998 05:46:27 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to get files in a directory?
Message-Id: <6nv13j$djg$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, tadmc@flash.net (Tad McClellan) writes:
:   Maybe because globbing is system specific and
:   and opendir() and friends work on all perl ports?

glob() or <*> is a Perl operator that is defined to work
wherever Perl is. 

--tom, who is tired of hearing the word "portable" used
       to mean "runs even on microsuck".
-- 
*** The previous line contains the naughty word "$&".\n
                if /(ibm|apple|awk)/;      # :-)
            --Larry Wall in the perl man page


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

Date: Wed, 8 Jul 1998 08:26:12 +0200
From: "jonkers" <snif@xs4all.**>
Subject: Re: HTTP connections WITHOUT the libwww module?
Message-Id: <6nv3d1$3n4$1@news.gns.getronics.nl>

>> "David Thompson" <domainsource@usa.net> writes:
>>
>> }Is it possible to retrieve a URL (and store for later parsing) WITHOUT
>> }using the LibWWW module?


Yes, you can (sorry for the Dutch words en comments):




############################### get_page ##########################3



# get_page haalt een informatie (page) via HTTP
# usage get_page(systeem,pagina,poort);


sub get_page {

 my($n,@values);
 ($n,@values) = @_;
 my(@result);

 my($them,$pagina,$port);
 ($them,$pagina,$port)=@_;

 $them = 'localhost' unless $them;
 $pagina = '/' unless $pagina;
 $port = 80 unless $port;

 #print "#debug: them is $them, pagina is $pagina, port is $port\n";
 #@result=(1,2,3);
 #return @result;

 $AF_INET = 2;
 $SOCK_STREAM = 1;

 $SIG{'INT'} = 'dokill';
 sub dokill {
     kill 9,$child if $child;
 }

 $sockaddr = 'S n a4 x8';

 #chop($hostname = `hostname`);

 ($name,$aliases,$proto) = getprotobyname('tcp');
 ($name,$aliases,$port) = getservbyname($port,'tcp')
     unless $port =~ /^\d+$/;;
 ($name,$aliases,$type,$len,$thisaddr) =
  gethostbyname($hostname);
 ($name,$aliases,$type,$len,$thataddr) = gethostbyname($them);

 $this = pack($sockaddr, $AF_INET, 0, $thisaddr);
 $that = pack($sockaddr, $AF_INET, $port, $thataddr);

 if (socket(S, $AF_INET, $SOCK_STREAM, $proto))

     print stderr "socket ok\n";
 }
 else {
     die $!;
 }

 if (bind(S, $this)) {
     print stderr "bind ok\n";
 }
 else {
     die $!;
 }

 if (connect(S,$that)) {
     print stderr "connect ok\n";
 }
 else {
     die $!;
 }

 select(S); $| = 1; select(STDOUT);

 print S "GET $pagina\n"; # vergeet niet die \n !!!!

 while( <S> ) {
  #chop;
      #print "$_\n";
  push(@result,$_);
 }

 return @result;

} # sub get_page




Sander






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

Date: Wed, 08 Jul 1998 14:40:28 +0900
From: "Kim, Ki-Yong" <scgyong@dev.bbcom.co.kr>
Subject: Re: Installing Perl and mSQL on DG/ux, AViiON
Message-Id: <35A3064C.D3DB111C@dev.bbcom.co.kr>

I (almost) successfully built perl5 without Fcntl extension.
Though there were some errors when I executed 'make test',
that doesn't matter.

Currently, my problem is building mSQL. :)

and, the above is not right answer.

- scgyong@nownuri.net -



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

Date: Tue, 7 Jul 1998 23:52:17 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Is posting via CGI script that dangerous?
Message-Id: <1utun6.b43.ln@localhost>

yup@my-dejanews.com wrote:

: I've seen loads of messages talking about how people can EASILY intercept
: information that is not passed through a secure server (SSL), I've also noted
: some IP sniffers.  IS it really that EASY to take information sent via web
: forms/shopping carts that are not SSL?


   Usenet is divided up into groups with a particular interest.

   The folks that read *this* newsgroup are interested in things
   about Perl.


   If you have something to say about Perl, then post it here.

   If not, then post it somewhere else.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 08 Jul 1998 05:33:59 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Music w/ Perl
Message-Id: <35a3035b.2725773@nntp.idsonline.com>

prakashpatel@my-dejanews.com Said this:

>I have about 5 .ram audio files and I'm wondering if I could have them all
>play just by one click of mouse button.  Instead of visitors having to click
>on them seperately after every song is over.  I need to know if I can do that
>through perl cgi-script.

Well, if you want to change the order of the songs, or add new songs
"on the fly" you can use perl to do that..... otherwise, simply list
each .ra file in your ram file like this:

pnm://ra.someserver.com/songone.ra
pnm://ra.someserver.com/songtwo.ra
pnm://ra.someserver.com/songthree.ra
pnm://ra.someserver.com/songfour.ra

The real audio player will retrieve songone.ra and play it, then
retrieve songtwo.ra and so on and so on.

But, I have a sneaking suspicion that you are using the ram file
incorrectly, or worse, you are using someone else's files off of their
server - if that's the case, you need to go back to square one and
rethink a few things.






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

Date: Wed, 08 Jul 1998 01:54:58 -0400
From: Pat Gunn <pgunn01@ibm.net>
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <35A309B2.4228@ibm.net>

Tad McClellan wrote:
> 
> Pat Gunn (pgunn01@ibm.net) wrote:
> 
> : I would like to nominate myself as moderator for comp.lang.perl.misc.
> 
>    s/misc/announce/;

Doh! (Slapping head on computer monitor)
Despite what it seems, I am not clueless... I'm just sleepy. :)

-- 
---------------------------------------------------
Pat Gunn, moderator:comp.sys.newton.announce
comoderator:comp.os.os2.moderated
"You can always judge a man by the quality of his enemies." -- Dr Who
http://junior.apk.net/~qc
------------------------------------------------


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

Date: Wed, 08 Jul 1998 05:16:22 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: newbie Location: syntax help wanted
Message-Id: <35a30043.1933271@nntp.idsonline.com>

JKraaijeveld@askesis.nl (Joost Kraaijeveld) Said this:

>Hi,
>
>Can anyone give me a working perl script that just returns the name of
>a file that has to be displayed
>
>I tried the following file (without the c style comments) :
>
>/********************** start of file.pl ***************************/
>#!/usr/bin/perl
>
>   Location: myfile.html
>
>/********************** end of file.pl ***************************/
>

I have to say, you really need to read up on perl.  First off, you
need to print() anything that you want sent to standard output.....

print "Location: myfile.html\n\n";

the \n\n is two linefeeds, which tells the browser that it is the end
of the response header.  





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

Date: Wed, 08 Jul 1998 01:26:00 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: on the fly subs with special tag markers Re: methods to insert/substitute blocks of text?
Message-Id: <comdog-ya02408000R0807980126000001@news.panix.com>
Keywords: from just another new york perl hacker

In article <35A2E79F.EEF@flash.net>, dtbaker_@flash.net posted:

>brian d foy wrote:
>
>> time for your homework ;)

>ok ok, I get the point. The standard RFM response is a little daunting
>to those of us who HAVE been reading desperately and are still a little
>confused and looking for a little straightforward help... I realize that
>if I read every Oreilly book out there I'd probably have the answer! The
>question is a matter of when....

>If all you want to do if point me to a book, I'd find it more helpful if
>you could give a hint like maybe what chapter, or page you you don't
>want to re-type.

actually, i'll breifly outline what i do when learning some new perl
thingy.  i usually don't go past 4a).  it might seem cumbersome
at first, but the more you practice, the better you get :)

1a.  if it's something i expect to be in one of the books, i
look at the index to find which pages it is on.  sometimes
this takes a few tries to find the index terms.  a
familiarity of the table of contents of the Llama, Camel,
Panther, et alia helps me to know which book to go to.  i
still frequently check the Camel chapter 3.

1b.  i check the perlfaq* for the appropriate subject, and
sometimes other manpages.  sometimes i curse at the
docmentation at this stage, but realize that the answer is
there.  generally i pick up tidbits unrelated to my problem
by doing this, which is a Good Thing.  the perl man page
is helping in finding which man page to go to for the ones
i don't read often. some man pages seem to be a frequent read :)

2.  if it's a module, i check the *.readme for that module
on CPAN to make sure it's gonna do something like i expect
it to do.  after that, i skim the POD for it (not reading
everything).  this gives me the general flavor of what i'm
going to need to do.

3a.  almost always, i go to DejaNews
(<URL:http://www.dejanews.com>) and search
comp.lang.perl.misc for appropriate terms, and sometimes the
author's email since the author usually has the best tidbits
or examples of the module.

3b. some thingys, such as DBI and mod_perl, have mailing lists
that are archived, so i check those if necessary.  they're
bookmarked in my browser :)

4a.  then i play around with the new feature/module in toy
programs that use very specific features where i can easily
control the other bits. if i can't get it to work, i wait a
day then come back to it.  if i still can't get it, i wait a
few more days before even thinking about asking anyone about
it.  i assume any wierd effects in these programs are my
fault rather than Perl's, which should eliminate the need
to immediately ask questions due to risk of "D'oh!'s".  
careful inspection of the POD occurs at this phase, and maybe
a peek at the module code.

4b. i've found that the Mere Exposure Effect has a lot to
do with finding an answer - now that i have become
interested in the subject, i'm more likely to notice posts
about it in the newsgroup.  usually the question is asked by
someone else at this point. :)

4c. i just try things to see what happens then cogitate on
the results. change the input data around to see what it
doues to the output.  comment out a line to see how things
change.  try doing it in a completely different fashion. 
this can be very frustrating, but it saves a lot of questions,
and i learn others things along the way.

5. if i still haven't figured it out, perhaps i'll post.  i 
think i've only done this a few times though.  but, by this
time, i have a pretty good idea how to frame my question
and demostrate my problem.  the post usually sits in a file
overnight in case i have a revelation in my sleep.  usually,
i end up deleting the file.

6. only rarely have i ever emailed authors asking about some
point, and usually in reference to some patch i had made to
my local copy.  i hestitate to do this even more that 5) since
i'm almost demanding the author to waste time to pay attention 
to me.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: Wed, 08 Jul 1998 01:36:21 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl trivia: hash definition w/o initialization?
Message-Id: <comdog-ya02408000R0807980136210001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6nuu43$9nm@news1.panix.com>, k y n n <NOSPAMkEynOn@panix.comNOSPAM> posted:

>Quoth the camel: "A hash element... can only be defined if it exists,
>but the reverse doesn't necessarily hold true...".  So I was curious
>about whether there was a way to define a hash corresponding to a
>whole list of key values, without initializing the individual hash
>elements.  (Of course, this question falls under the heading of "Perl
>trivia"; there's nothing wrong with "%some_set = map { $_, 1 }
>@items".)

you can have an undefined value for an existing key and not
a defined value for a non-existent key.  the key has to be
there, not the value.

   #!/usr/bin/perl
   
   %hash = map { $_, undef } qw(just another new york perl hacker);
   
   while( my($key, $value) = each %hash )
      {
      print "$key: [$value]";
      print " undefined!" unless defined $value;
      print "\n";
      }
      
   __END__
   
   another: [] undefined!
   new: [] undefined!
   perl: [] undefined!
   york: [] undefined!
   hacker: [] undefined!
   just: [] undefined!

perhaps that is what you wanted?

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: Wed, 08 Jul 1998 05:06:01 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: print <<STRING;
Message-Id: <35a2fe00.1354588@nntp.idsonline.com>

"James Lee" <james@soft.net.uk> Said this:

>Hi People
>
>Just a quick one.  I'm having a few problems with this
>
>if ()
>{
>}
>else
>{
>	print <<STRING;
>	text
>	STRING
>}
>
>I'm getting error 'Can't find string terminator "STRING" anywhere before
>EOF'.
>
>Can anybody, shed some light.

Got me.  Try print <<"STRING"; but I thought that just added variable
parsing within the print HERE block.    ??




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

Date: 08 Jul 1998 01:24:19 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: print <<STRING;
Message-Id: <ltzpek7w58.fsf@asfast.com>

root.noharvest.\@not_even\here.com (-) writes:

> "James Lee" <james@soft.net.uk> Said this:
> 
> [ ... ]
>
> >if ()
> >{
> >}
> >else
> >{
> >	print <<STRING;
> >	text
> >	STRING
> >}
> >
> >I'm getting error 'Can't find string terminator "STRING" anywhere before
> >EOF'.
> >
> >Can anybody, shed some light.
> 
> [ ... ]

One way to fix this is to make sure that the STRING delimiter at the
end of the block gets left justified, as follows:

else
{
        print <<STRING;
        text
STRING
}

Depending on your application, you might want "text" to be left
justified, as well.

This is part of the documented behavior for here documents in Perl.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: Wed, 08 Jul 1998 01:44:54 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: print <<STRING;
Message-Id: <comdog-ya02408000R0807980144540001@news.panix.com>
Keywords: from just another new york perl hacker

In article <35a2fe00.1354588@nntp.idsonline.com>, root.noharvest.\@not_even\here.com posted:

>"James Lee" <james@soft.net.uk> Said this:

>>else
>>{
>>       print <<STRING;
>>       text
>>       STRING
>>}

>>I'm getting error 'Can't find string terminator "STRING" anywhere before
>>EOF'.

>Got me.  Try print <<"STRING"; but I thought that just added variable
>parsing within the print HERE block.    ??

the ending token of the here document has to appear by itself on
the line.  no leading or trailing whitespace.

by default, <<EOM is the same teh form with the double quotes, <<"EOM".

see the documentation on here documents where all of this is very
clearly and unequivably stated. :)

from the perldiag man page, which contains more verbose warnings
(see also "use diagnostic;"):

     Can't find string terminator %s anywhere before EOF
         (F) Perl strings can stretch over multiple lines.  This
         message means that the closing delimiter was omitted.
         Because bracketed quotes count nesting levels, the
         following is missing its final parenthesis:

             print q(The character '(' starts a side comment.);

         If you're getting this error from a here-document, you
         may have included unseen whitespace before or after your
         closing tag. A good programmer's editor will have a way
         to help you find these characters.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: Tue, 7 Jul 1998 23:43:13 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: print <<STRING;
Message-Id: <MPG.100cb4daee960148989724@nntp.hpl.hp.com>

In article <35a2fe00.1354588@nntp.idsonline.com> on Wed, 08 Jul 1998 
05:06:01 GMT, root.noharvest.\@not_even\here.com (-) 
<root.noharvest.\@not_even\here.com (-)> says...
> "James Lee" <james@soft.net.uk> Said this:
 ...
> >	print <<STRING;
> >	text
> >	STRING
> >}
> >
> >I'm getting error 'Can't find string terminator "STRING" anywhere before
> >EOF'.
> >
> >Can anybody, shed some light.
> 
> Got me.  Try print <<"STRING"; but I thought that just added variable
> parsing within the print HERE block.    ??

Your response is nonsense.  The double-quotes are irrelevant.

The question (which is a FAQ) was answered several times on June 24 (when 
it was submitted), by people including Tom Christiansen and Tom Phoenix.  
What value does a response like yours add to this newsgroup?

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 8 Jul 1998 02:52:37 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: question about objects
Message-Id: <6nv4vl$k63$1@monet.op.net>


Organization: Plover Systems


>In comp.lang.perl.misc, 
>    mjd@op.net (Mark-Jason Dominus) writes:
>:Gosh, I wish I'd thought of this.  A package where `unimport' imports
>:a tied variable and `import' unimports it is just the kind of thing I
>:want to be writing.

In article <6nupov$3eq$2@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
>Strange, I didn't see any importing (read: symbol table assignments).

New semantics are exported.  That's what I meant.

>Seems to be that this kind of "use" and "no" distinction is quite
>intuitive, and that to go the other way would be extremely confusing.

I agree 100%.  It's wonderful, and I wish I'd thought of it.



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

Date: Wed, 08 Jul 1998 05:26:24 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Two commands, one button.
Message-Id: <35a3025b.2469829@nntp.idsonline.com>

"Darren Sweeney" <darrensw@pacbell.net> Said this:

>I am currently reconfiguring a script, the question I have is can one submit
>button perform two functions, one after the other.
>
>e.g. I have one button which submits data to a HTML screen and another that
>then takes me to that screen
>
>    <INPUT TYPE = "submit" NAME = "add_to_form" VALUE = "Add Data">
>    <INPUT TYPE = "submit" NAME = "view_form" VALUE = "View Form">
>
>Can the value function accept two commands, if so what is the divider?
>

I'm not even sure what or why you are trying to do.....  neither
button should be "submitting data" to any "HTML screen".  The form
should have an action that it's pointing to, (I would hope a PERL
script, since this is comp.lang.misc.perl) that will receive the data
and then print something out to the browser.

So, if you submit your data to a perl script, you can have that perl
script store the form data in a file, email it, or whatever, and then
print the form data in a nice formatted manner to the web browser.
It's all one simple action.




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

Date: Wed, 08 Jul 1998 05:13:52 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: What does this error mean?
Message-Id: <35a2ff80.1738111@nntp.idsonline.com>

JKraaijeveld@askesis.nl (Joost Kraaijeveld) Said this:

>I have a simple script that return this error if run on a UNIX
>commandline:
>
>Can't find string terminator "EOF" anywhere before EOF at file.pl line
>12.
>
>The per version used is:
>
>This is perl, version 5.003 with EMBED
>        built under linux at Oct 18 1996 10:17:50
>        + suidperl security patch
>
>
>
>On Windows NT all is fine 
>
>The script is:
>
>#!/usr/local/bin/perl
>#
>print "Content-type: text/html\n\n" ;
>
># Print the HTML response page to STDOUT
>print <<EOF ;

Try using a different here string....  EOF may be conflicting with
something internal to perl

Just a shot in the dark.


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

Date: Wed, 08 Jul 1998 02:09:45 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: What does this error mean?
Message-Id: <comdog-ya02408000R0807980209450001@news.panix.com>
Keywords: from just another new york perl hacker

[comp.lang.perl is dead!]

In article <35a2ff80.1738111@nntp.idsonline.com>, root.noharvest.\@not_even\here.com posted:

>Try using a different here string....  EOF may be conflicting with
>something internal to perl
>
>Just a shot in the dark.

no need for shots in the dark when you can read the docs.  see
correct posts to the same question in earlier this week.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3091
**************************************

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