[18375] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 543 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 21 18:06:04 2001

Date: Wed, 21 Mar 2001 15:05:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <985215920-v10-i543@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 21 Mar 2001     Volume: 10 Number: 543

Today's topics:
    Re: `pwd` doesn't work on all servers? <jazrant@zsc.nrcan.zc.ca>
    Re: `pwd` doesn't work on all servers? <tony_curtis32@yahoo.com>
        accessing hash from within a for loop doesn't work <jhall@ifxonline.com>
        Autoincrementing a variable inside a rename function <kimmfc@mydeja.com>
    Re: Autoincrementing a variable inside a rename functio <bmb@ginger.libs.uga.edu>
    Re: Autoincrementing a variable inside a rename functio (Abigail)
    Re: Beginner's question <juex@deja.com>
        checkbox problem <tomcat@visi.com>
    Re: checkbox problem (Damian James)
        diag question <dbohl@sgi.com>
    Re: diag question (Abigail)
    Re: diag question (Damian James)
    Re: File filters in File::Find (was:Trying to capture c dmeyers+news@panix.com
    Re: h2xs recursive failure in assign_typemap_entry (Ilya Zakharevich)
    Re: Hash Problem Solved <uri@sysarch.com>
    Re: how do you pass arguements into the "do" command? <uri@sysarch.com>
        How to insert comma seperated txt file into Excel <mmb12@yahoo.com>
    Re: How to insert comma seperated txt file into Excel (Damian James)
    Re: How to sort ? (Gwyn Judd)
        Newbie : Can I open a file from another web server ? <mart@markel.demon.co.uk>
    Re: Newbie : Can I open a file from another web server  <dave@dave.org.uk>
        Perl & CGI N00b - CGI troubleshooting <f.b.scholten-10@student.utwente.nl>
    Re: Perl & CGI N00b - CGI troubleshooting (Damian James)
    Re: Perl 5.6 - Spinning cursor routine? (Rich Lafferty)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 21 Mar 2001 17:47:03 -0500
From: "John A. Grant" <jazrant@zsc.nrcan.zc.ca>
Subject: Re: `pwd` doesn't work on all servers?
Message-Id: <99bb90$n0b2@nrn2.NRCan.gc.ca>

<nobull@mail.com> wrote in message news:u91yrwf0vn.fsf@wcl-l.bham.ac.uk...
> Bart Lateur <bart.lateur@skynet.be> writes:
>
> > nobull@mail.com wrote:
> >
> > >> The point was that the OP was having problems with `pwd` so switching
to
> > >> Cwd::cwd won't help.
> > >
> > >But switching to Cwd::getcwd will.
> >
> > It doesn't, in my particular case.
>
> In that case, like I said, it's probably impossible.  On Unix the only
> way you can get the name of the PWD is to follow the chain of '..'
> directory entries back up to the root directory.  If there is any
> directory between the PWD and the root that you are not permitted to
> read then you cannot find out the name of you PWD.

    My sysadmin guy told me:

    "CGI scripts should not assume that the PATH environment
     variable includes /usr/bin.  Try the following:
        chomp($cwd=`/usr/bin/pwd`);
    "

    So I guess I will have to make that part of the configuration
    of the script:
        my $PWD="/usr/bin/pwd";
    (along with SENDMAIL and others).


    It seems like a shortcoming that Cwd module doesn't try
    harder to find pwd.  AFAIC, system modules for any
    language should always work if they are properly set up.
    I have never had a problem in C with system() or getcwd()
    failing just because of a path problem.  It's Yet Another
    Perl Weakness I guess. Sigh.

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here





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

Date: 21 Mar 2001 17:00:40 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: `pwd` doesn't work on all servers?
Message-Id: <87g0g64tif.fsf@limey.hpcc.uh.edu>

>> On Wed, 21 Mar 2001 17:47:03 -0500,
>> "John A. Grant" <jazrant@zsc.nrcan.zc.ca> said:

>     "CGI scripts should not assume that the PATH
> environment variable includes /usr/bin.  Try the
> following: chomp($cwd=`/usr/bin/pwd`); "

> I have never had a problem in C with system() or
> getcwd() failing just because of a path problem.  It's
> Yet Another Perl Weakness I guess. Sigh.

A C program running as a CGI program without "standard"
directories on its PATH envariable would suffer the same
fate if you used system() [with a basename for the
executable].

It's really about the dangers of CGI rather than a
language problem.

-- 
Just reach into these holes.  I use a carrot.


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

Date: Wed, 21 Mar 2001 22:16:47 GMT
From: "John Hall" <jhall@ifxonline.com>
Subject: accessing hash from within a for loop doesn't work
Message-Id: <jL9u6.55710$o7.2408784@news1.rdc1.sdca.home.com>

Sorry for the re-post, but i'm tearing my hair out and nobody has responded:

Working code first;

For $value, this works fine:

_____________________________________________________
sub do_adminedsearch {

    open_infile($searchcrit);

    dbmopen(%sitedb,"$datadir/$sitedb", 0644) or die "dbmopen: $!";
    dbmopen(%permdb,"$datadir/$permdb", 0644) or die "dbmopen: $!";
    @usrkeys = keys(%permdb);

    $value = $sitedb{user1};

    for ($i=0;$i<@usrkeys;$i++) {

        unless ($usrkeys[$i] eq '_ADMINPW_' || $usrkeys[$i] eq '_ADMIN_' ||
$usrkeys[$i] eq '_SECTIONS_') {

        $list .= <<HTML;

        stuff, including $value

HTML
        }

        untie %permdb;
        untie %sitedb;
        $content=~s/<--MESSAGE-->/$list/;
    }

}

_____________________________________________________
But this DOESN'T!!??!??:
_____________________________________________________
sub do_adminedsearch {

    open_infile($searchcrit);

    dbmopen(%sitedb,"$datadir/$sitedb", 0644) or die "dbmopen: $!";
    dbmopen(%permdb,"$datadir/$permdb", 0644) or die "dbmopen: $!";
    @usrkeys = keys(%permdb);

    for ($i=0;$i<@usrkeys;$i++) {

        unless ($usrkeys[$i] eq '_ADMINPW_' || $usrkeys[$i] eq '_ADMIN_' ||
$usrkeys[$i] eq '_SECTIONS_') {

        $value = $sitedb{user1};

        $list .= <<HTML;

        stuff, including $value

HTML
        }

        untie %permdb;
        untie %sitedb;
        $content=~s/<--MESSAGE-->/$list/;
    }

}
_____________________________________________________


When it's working I want $value to be $sitedb{"$usrkeys[$i]"}; so it needs
to be inside the for loop...

Thanks for any assistance.







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

Date: Wed, 21 Mar 2001 19:36:14 GMT
From: Kim C <kimmfc@mydeja.com>
Subject: Autoincrementing a variable inside a rename function
Message-Id: <610ibtk9bban3o6k8dkbo1k1pm8kefs8kr@4ax.com>

Hi,

I'm having trouble incrementing a variable nested inside a the string
I'm trying to rename to:

##########
use strict;
use warnings;

while (@_){
	rename (shift , "$some_dir/some_string++$_") || die $!
}

##########

I've also tried:

	rename (shift , " .......{++$_}") || die $!

The first example warns of uninitialized concatenation and renames to
the literal string "some_string++"

The second example does the same and also prints the braces as
literals.  What is wrong here?

Much thanks

Kim.


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

Date: Wed, 21 Mar 2001 15:07:52 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Autoincrementing a variable inside a rename function
Message-Id: <Pine.A41.4.21.0103211502380.17380-100000@ginger.libs.uga.edu>

On Wed, 21 Mar 2001, Kim C wrote:
> I'm having trouble incrementing a variable nested inside a the string
> I'm trying to rename to:
> 
> ##########
> use strict;
> use warnings;
> 
> while (@_){
> 	rename (shift , "$some_dir/some_string++$_") || die $!
> }
> 
> ##########
> 
> I've also tried:
> 
> 	rename (shift , " .......{++$_}") || die $!
> 
> The first example warns of uninitialized concatenation and renames to
> the literal string "some_string++"
> 
> The second example does the same and also prints the braces as
> literals.  What is wrong here?

Almost there.

"$some_dir/some_string${\(++$_)}"

Brad



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

Date: Wed, 21 Mar 2001 20:49:44 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Autoincrementing a variable inside a rename function
Message-Id: <slrn9bi4v8.33r.abigail@tsathoggua.rlyeh.net>

Kim C (kimmfc@mydeja.com) wrote on MMDCCLIX September MCMXCIII in
<URL:news:610ibtk9bban3o6k8dkbo1k1pm8kefs8kr@4ax.com>:
** Hi,
** 
** I'm having trouble incrementing a variable nested inside a the string
** I'm trying to rename to:
** 
** ##########
** use strict;
** use warnings;
** 
** while (@_){
** 	rename (shift , "$some_dir/some_string++$_") || die $!
** }
** 
** ##########
** 
** I've also tried:
** 
** 	rename (shift , " .......{++$_}") || die $!
** 
** The first example warns of uninitialized concatenation and renames to
** the literal string "some_string++"
** 
** The second example does the same and also prints the braces as
** literals.  What is wrong here?


What's wrong is your idea of how interpolation works. Perl interpolates
things starting with $ and @, and either followed by an identifier
or a block. Interpolation doesn't start with ++.

There are several ways of doing what you want to do:

    rename shift, "$some_dir/some_string" . ++$_ or die;

    rename shift, "$some_dir/some_string${\++$_}" or die;


Abigail


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

Date: Wed, 21 Mar 2001 11:31:58 -0800
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Beginner's question
Message-Id: <3ab901af$1@news.microsoft.com>

"Jeff Myers" <myers@infinet.com> wrote in message
news:3ab8f3e0$0$53493$f5f63664@news.tdin.com...
> This script below (run in MacPerl) generates a "can't use an undefined
value as a symbol reference"
> error in the last line.

> %words = qw(
Here you are creating a hash

> print $words($temp);
and here you are accessing ..., well what is this? Applying the function
reference stored in scalar $words to $temp? Something obscure like that.

Anyhow, you want to use curly braces instead of brackets here.

jue




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

Date: Wed, 21 Mar 2001 21:36:37 GMT
From: uNcONvEntiOnaL <tomcat@visi.com>
Subject: checkbox problem
Message-Id: <F99u6.1536$SB2.127971@ruti.visi.com>

Here is a snippet from a script that gets input from a html form.

$phone = $in{"phone"};
$whotocheckboxes = $in{"whotocheckboxes"};

phone is a textbox, whotocheckboxes is a checkbox array.
The values of phone and the checkbox array (multiple if multiple
ones are checked) need to be passed to another web page.

print "<a HREF='http://www.sasha.com/contact2.html?phone=$phone&
whotocheckboxes=$whotocheckboxes'>Return</a>\n";
    
whotocheckboxes only has one value in it, it doesn't remember
all the checked boxes.  Does someone know what else I need
to add to capture and pass on all chosen checkboxes?

Thanks    Tom

-- 
On the Hiway to Hell...             //    www.informationhiwaytohell.com  
The Information Hiway to Hell...  AC\\DC   tomcat@visi.com  uNcONvEntiOnaL
                                    //            
    When encryption is made illegal, then *7^%,"JJr3%a}Z@9((l:^%$Hhr=+!


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

Date: 21 Mar 2001 22:30:54 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: checkbox problem
Message-Id: <slrn9bias6.29c.damian@puma.qimr.edu.au>

uNcONvEntiOnaL chose Wed, 21 Mar 2001 21:36:37 GMT to say this:
>Here is a snippet from a script that gets input from a html form.
>
>$phone = $in{"phone"};
>$whotocheckboxes = $in{"whotocheckboxes"};
>

You don't say how you have populated %in. If you are using CGI.pm (which
you really, really should be doing), you could access these fields with:

	my $cgi = CGI->new();
	my $phone = $cgi->param('phone');

>phone is a textbox, whotocheckboxes is a checkbox array.
>The values of phone and the checkbox array (multiple if multiple
>ones are checked) need to be passed to another web page.
>
>print "<a HREF='http://www.sasha.com/contact2.html?phone=$phone&
>whotocheckboxes=$whotocheckboxes'>Return</a>\n";
>    
>whotocheckboxes only has one value in it, it doesn't remember
>all the checked boxes.  Does someone know what else I need
>to add to capture and pass on all chosen checkboxes?

Since I don't know how you have populated %in above, I can't say what
$in{whotocheckboxes} might contain. Even if it does contain a reference to
an anonymous array, you are not dereferencing it as such. If you are using
CGI.pm, you can just say:

	my @whotocheckboxes = $cgi->param('whotocheckboxes');

to get an array containing the values. To make this usefule in the URL you
specify above, you need to pass the assignment multiple times:

	my $whotocheckboxes = join(
		'&',
		map { "whotocheckboxes=$_" } @whotocheckboxes
	);

though you will need to url-escape the values.

For more details, see the documentation for CGI.pm -- it is part of the
standard distribution of Perl, and as such should already be sitting on
your hard drive. Try typing 'perldoc CGI' at the command prompt.

Cheers,
Damian
-- 
@;=0..23;@;{@;}=split//,<DATA>;while(@;){for($;=@;;--$;;){next if($:=rand($;
+1))==0+$;;@;[$;,$:]=@;[$:,$;]}print map{$;{$_}}(@| ,@;);push@|,shift@;if$;[
0]==@|;$|=1;select$&,$&,$&,1/80;print"\b"x(@;+@|)}print"\n"__END__
Just another Perl Hacker


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

Date: Wed, 21 Mar 2001 16:06:09 -0600
From: Dale Bohl <dbohl@sgi.com>
Subject: diag question
Message-Id: <3AB925D1.5EF3CDE9@sgi.com>


Can anyone tell me which is better to use during
debugging and production?

#!/usr/bin/perl -w

or

use diagnostics;

-- 

Thanks in advance,
Dale

Dale Bohl
SGI Information Services
dbohl@sgi.com
(715)-726-8406
http://wwwcf.americas.sgi.com/~dbohl/


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

Date: Wed, 21 Mar 2001 22:16:21 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: diag question
Message-Id: <slrn9bia1l.33r.abigail@tsathoggua.rlyeh.net>

Dale Bohl (dbohl@sgi.com) wrote on MMDCCLIX September MCMXCIII in
<URL:news:3AB925D1.5EF3CDE9@sgi.com>:
== 
== Can anyone tell me which is better to use during
== debugging and production?
== 
== #!/usr/bin/perl -w
== 
== or
== 
== use diagnostics;


Define "better".


use diagnostics don't give you any more warnings than a plain -w.
It's just a lot more verbose, and I believe you quickly tire from
it.




Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


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

Date: 21 Mar 2001 22:37:52 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: diag question
Message-Id: <slrn9bib99.29c.damian@puma.qimr.edu.au>

Dale Bohl chose Wed, 21 Mar 2001 16:06:09 -0600 to say this:
>
>Can anyone tell me which is better to use during
>debugging and production?
>
>#!/usr/bin/perl -w
>
>or
>
>use diagnostics;
>

Both, and:

use strict;

The -w flag tells perl to generate warnings, the diagnostics pragma
translates them into a more verbose explanation for you. Strict forces
a certain amount of discipline upon your coding, which is invaluable if you
are hoping to write scalable, robust, maintainable and/or complex
programs.

I don't see any good reason to turn off -w or strict on production systems,
though I don't see a reason to keep diagnostics.

FYI, under Perl 5.6 and higher, you can replace the -w flag with 'use
warnings', but be warned, it then only applies per module (like strict and
diagnostics).

HTH

Cheers,
Damian
-- 
@;=0..23;@;{@;}=split//,<DATA>;while(@;){for($;=@;;--$;;){next if($:=rand($;
+1))==0+$;;@;[$;,$:]=@;[$:,$;]}print map{$;{$_}}(@| ,@;);push@|,shift@;if$;[
0]==@|;$|=1;select$&,$&,$&,1/80;print"\b"x(@;+@|)}print"\n"__END__
Just another Perl Hacker


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

Date: 21 Mar 2001 14:12:07 -0500
From: dmeyers+news@panix.com
Subject: Re: File filters in File::Find (was:Trying to capture current directory in variable)
Message-Id: <yob4rwnq6m0.fsf@panix3.panix.com>

tadmc@augustmail.com (Tad McClellan) writes:
> Michael Rolfe <mumble[anti-spam]@maths.uct.ac.za> wrote:

> >Hokay, I've now done that and discover that
> >http://www.perl.com/pub/doc/manual/html/lib/File/Find.html describes
[snip]
>    perldoc File::Find

> >    find(\&wanted, '/foo','/bar');

> >and tells in detail what the first parameter is.  Experimentation reveals
> >that '/foo' is the starting directory of the walk but I can't figure out
> >what '/bar' is.

> Arguments after the first one are a list of starting directories.


It's rather odd, actually.  While it seems pretty obvious,
looking at that perldoc page, it is nowhere explicit that
that is a list of starting directories.

I suppose it never occurred to me that they could be anything
else, but for some newbie, especially one using a Windows box
wherein they may believe that directories are separated by
backslashes and that forward-slashes are used for options,
could (apparently) be confused by this.

--d


-- 
dmeyers@panix.com


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

Date: 21 Mar 2001 21:43:13 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: h2xs recursive failure in assign_typemap_entry
Message-Id: <99b79h$a9c$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to 
<davidz@carterz.net>],
who wrote in article <99at9i$7hd$1@news.netmar.com>:
> Stack trace shows that we're in what appears to be an infinite loop,
> recursively calling sub 'assign_typemap_entry' from line 1616 in that sub.
> I'm not 100% certain, but it appears that $type is being continuously
> appended to.
> 
> What's different about this struct from the others in %types_seen that we've
> already processed? Only thing I see is that it contains union
> arm_user_metric1_u, which appears later in the (sorted) list %types_seen.
> 
> Any thoughts as to what's going on here, and what I can do to fix it?

Thank you for tracing this far.  The next step is to isolate the
problem: remove the dependencies (like you did with windows.h), and
those parts of the .h file which are irrelevant to the failure.

Let us know the results.  [Better Cc me.]

Hope this helps,
Ilya


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

Date: Wed, 21 Mar 2001 19:30:00 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Hash Problem Solved
Message-Id: <x7vgp23op3.fsf@home.sysarch.com>

>>>>> "J" == Jason  <jason.baker@stdbev.com> writes:

  J> As it turns out, we werent losing the hash at all.  We had a typo
  J> calling adding to the hash, so only the final entry was every
  J> recorded.  Thats what we get for coding in the a.m.  Thank you all
  J> for your help.

and that is what you get for not using strict and -w. hope you learn
that lesson.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 21 Mar 2001 19:29:15 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: how do you pass arguements into the "do" command?
Message-Id: <x7zoee3oqb.fsf@home.sysarch.com>

>>>>> "D" == David  <dsedrich@yahoo.com> writes:

  D> I'm trying to pass an arguement into a perl program that I am
  D> executing from another Perl program. I try:

  D> do "program.plx data1";

  D> It doesn't work. It doesn't do anything that I can see.

that is trying to load the file "program.plx data1". you don't have one
by that name.

  D> do "program.plx";

  D> works fine, but doesn't accomplish what I want.

what do you want to do?

  D> Can you pass arguements in with the "do" command?

no. do is not a sub call. it loads and evaluates a single perl file. it
is basically equivilent to this:

	$result = do {
		open( DO, $file ) || die "you lose $!" ;
		my $text = do { local $/ ; <DO> } ;
		eval $text ;
	}

  D> Is there a simple way to accomplish this otherwise?

sure, either make it a real script on its own, or have it just load subs
that you then call in your code. why would you want to use do 'file'?
there is almost no need for it anymore. one problem is that it will load
the file EACH time you call it which is a big waste. for that reason
require and use only load a file once.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 21 Mar 2001 11:54:46 -0800
From: Murali Gudala <mmb12@yahoo.com>
Subject: How to insert comma seperated txt file into Excel
Message-Id: <3AB90705.3294E7E9@yahoo.com>

Hi ,
 Does anyone know how to insert a comma seperated txt file into an Excel
Spreadsheet. I am running the app on Solaris box..

Any help is greatly appreciated.

Thanks
-Murali



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

Date: 21 Mar 2001 22:59:46 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: How to insert comma seperated txt file into Excel
Message-Id: <slrn9bicib.29c.damian@puma.qimr.edu.au>

Murali Gudala chose Wed, 21 Mar 2001 11:54:46 -0800 to say this:
>Hi ,
> Does anyone know how to insert a comma seperated txt file into an Excel
>Spreadsheet. I am running the app on Solaris box..
>
>Any help is greatly appreciated.
>

Well, you could always just rename the file with a .xls extension. Excel
should open it and import the data appropriately. Likewise, if it's going
out via cgi, you could specify a content type of application/msexcel (or
whatever).

Otherwise I suggest you search CPAN for modules relating to:

	- parsing CSV files
	- parsing/generating Excel files

both of which exist in abundance. 

HTH,

Cheers,
Damian
-- 
@;=0..23;@;{@;}=split//,<DATA>;while(@;){for($;=@;;--$;;){next if($:=rand($;
+1))==0+$;;@;[$;,$:]=@;[$:,$;]}print map{$;{$_}}(@| ,@;);push@|,shift@;if$;[
0]==@|;$|=1;select$&,$&,$&,1/80;print"\b"x(@;+@|)}print"\n"__END__
Just another Perl Hacker


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

Date: Wed, 21 Mar 2001 22:24:04 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: How to sort ?
Message-Id: <slrn9biag4.jif.tjla@thislove.dyndns.org>

I was shocked! How could Uri Guttman <uri@sysarch.com>
say such a terrible thing:
>a GRT is similar to the ST in that it uses a map/sort/map but the main
>difference is that the first map generates a sortable string which has
>the keys in front and the record at the end. so it doesn't have a sort
>callback function which is where its speedup comes from.

The point I was trying to make was that the keys were already at the
front. I probably have missed the whole point of the technique though.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
"Infidelity is liberty; all religion is slavery."
   [Robert G. Ingersoll, "Thomas Paine", 1870]
  Atheism/Freethought fortune cookie file


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

Date: Wed, 21 Mar 2001 19:22:50 -0000
From: "Martin J Steven" <mart@markel.demon.co.uk>
Subject: Newbie : Can I open a file from another web server ?
Message-Id: <985202571.4466.0.nnrp-13.c1ed7cd4@news.demon.co.uk>

This may seem a strange question but can I open a file that's not located on
the server where the script runs - ie instead of opening it from the local
cgi-bin folder give it a full path to another site (eg
http://www.anothersite.com/folder/filename.txt).  I only want to read the
file.

Thanks !




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

Date: Wed, 21 Mar 2001 19:35:10 +0000
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Newbie : Can I open a file from another web server ?
Message-Id: <hi0ibtor0f7am8nie842haih4pduqlhncn@4ax.com>

On Wed, 21 Mar 2001 19:22:50 -0000, "Martin J Steven"
<mart@markel.demon.co.uk> wrote:

>This may seem a strange question but can I open a file that's not located on
>the server where the script runs - ie instead of opening it from the local
>cgi-bin folder give it a full path to another site (eg
>http://www.anothersite.com/folder/filename.txt).  I only want to read the
>file.

Look at the libwww bundle of modeule on CPAN - specifically
LWP::Simple.

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
<http://www.manning.com/cross/>


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

Date: Wed, 21 Mar 2001 21:56:19 GMT
From: "Frank" <f.b.scholten-10@student.utwente.nl>
Subject: Perl & CGI N00b - CGI troubleshooting
Message-Id: <7s9u6.55815$JN3.1042374@nlnews00.chello.com>

Hello,

I'm a Perl n00b and I have a problem.
I just wrote a simple CGI script and wanted to load it in IE.
The problem is that the window just shows the code on the screen, just plain
text instead of HMTL.

Here is the script :

#!usr/bin/perl

print "Content-type:text/html\n\n";

print "<html><head><title>First CGI Script</title></head>\n" ;
print "<body\n" ;
print "<h2>Welcome to my first CGI Script!</h2>\n" ;
print "</body></html>\n" ;

But nothing happens. The window just shows the code on the screen, just
plain text instead of HMTL.

Can you help me with this? I use Perl under Win 98 and the Visual Cafe
programming environment.

Thanks in advance =)

Frank




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

Date: 21 Mar 2001 22:51:38 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Perl & CGI N00b - CGI troubleshooting
Message-Id: <slrn9bic32.29c.damian@puma.qimr.edu.au>

Frank chose Wed, 21 Mar 2001 21:56:19 GMT to say this:
>Hello,
>
>I'm a Perl n00b and I have a problem.
>

Welcome to Perl, and I hope you grow to like it as much as I do. One
stylistic note that you may wish to keep in mind -- I'm afraid munging 
your English like the above isn't going to win you any friends here. Also,
a lot of people read the term 'newbie' to mean "I want you to read the docs
for me". If you keep that in mind, you'll have better luck when you have a
Perl question.

>I just wrote a simple CGI script and wanted to load it in IE.
>The problem is that the window just shows the code on the screen, just plain
>text instead of HMTL.
>
> [code snipped]
>
>But nothing happens. The window just shows the code on the screen, just
>plain text instead of HMTL.
>

You have a web server configuration issue, bot a Perl problem. As such, it
is OT in this newsgroup. Your best bet is to try:

	comp.infosystems.www.aithoring.cgi

or some newsgroup related to the web server you are running.

>Can you help me with this? I use Perl under Win 98 and the Visual Cafe
>programming environment.
>

OK, I must admit I've never heard of the latter. To get an answer (from
anyone), you really need to say what webserver you are running. You ARE
running a webserver, aren't you? You do know that CGI involves an interface 
between a browser and an executable program (eg, one written in Perl), with a
web server in the middle?

If the answer to either of these is 'no', you probably want to check out
IndigoPerl:

	http://www.indigostar.com/indigoperl.htm

HTH

Cheers,
Damian
-- 
@;=0..23;@;{@;}=split//,<DATA>;while(@;){for($;=@;;--$;;){next if($:=rand($;
+1))==0+$;;@;[$;,$:]=@;[$:,$;]}print map{$;{$_}}(@| ,@;);push@|,shift@;if$;[
0]==@|;$|=1;select$&,$&,$&,1/80;print"\b"x(@;+@|)}print"\n"__END__
Just another Perl Hacker


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

Date: 21 Mar 2001 20:23:37 GMT
From: rich@bofh.concordia.ca (Rich Lafferty)
Subject: Re: Perl 5.6 - Spinning cursor routine?
Message-Id: <slrn9bi3e9.j3b.rich@bofh.concordia.ca>

In comp.lang.perl.misc,
dennis <dennis.moreno@pop.safetran.com> wrote:
> Does anyone know wher to get a routine that would display
> a stationary spinning cursor while a program is processing?

Remember, everything that can be written has already been
written -- it's just that some of it is easier to find.

   http://www.phreeow.net/bjm/Status-Indicator-1.1.tar.gz
 
  -Rich

-- 
Rich Lafferty ----------------------------------------
 Nocturnal Aviation Division, IITS Computing Services
 Concordia University, Montreal, QC
rich@bofh.concordia.ca -------------------------------


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 543
**************************************


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