[14010] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1420 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 18 18:21:25 1999

Date: Thu, 18 Nov 1999 15:20:58 -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: <942967257-v9-i1420@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 18 Nov 1999     Volume: 9 Number: 1420

Today's topics:
        getpwnam for NIS? pkey@sghms.ac.uk
    Re: getpwnam for NIS? <tony_curtis32@yahoo.com>
        hash value ends up being NULL <otis@my-deja.com>
    Re: hash value ends up being NULL (Kragen Sitaker)
    Re: hash value ends up being NULL <rootbeer@redcat.com>
    Re: Help with understanding syntax <gellyfish@gellyfish.com>
        Help! - grep for x then echo y from a line in a logfile <jnedham@hotmail.com>
        HELP! <chris@chrismail.connectfree.co.uk>
    Re: How do I get a list of users in an NT domain? <carvdawg@patriot.net>
        how to do multiple search and replaces <ben@smooth.co.uk>
        How to know the space occuped by a directory?? <abel.almazan@ogilvyinteractive.es>
    Re: How to know the space occuped by a directory?? <gellyfish@gellyfish.com>
    Re: how to make perl executable (Brett W. McCoy)
    Re: How to make the comparable also hashable? (Martien Verbruggen)
    Re: How to sort lines of plain text db file ? <factory@factory.co.kr>
    Re: How to sort lines of plain text db file ? <factory@factory.co.kr>
    Re: How to sort lines of plain text db file ? <gellyfish@gellyfish.com>
    Re: How to sort lines of plain text db file ? (Martien Verbruggen)
    Re: How to use LWP::UserAgent through firewall/proxy <Thomas@Baetzler.de>
    Re: html via perl <gellyfish@gellyfish.com>
    Re: html via perl <c4jgurney@my-deja.com>
    Re: Is $$variable allowed like in PHP ? <bene@chiark.greenend.org.uk>
    Re: Is $$variable allowed like in PHP ? <bene@chiark.greenend.org.uk>
    Re: Is $$variable allowed like in PHP ? (Simon Cozens)
    Re: Is $$variable allowed like in PHP ? <bene@chiark.greenend.org.uk>
        Is there anyone out there with experience setting up Mi <ray_g@netcom.ca>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 18 Nov 1999 16:53:39 GMT
From: pkey@sghms.ac.uk
Subject: getpwnam for NIS?
Message-Id: <38342ed1.5918074@news.sghms.ac.uk>

Is there a Perl command that does "getpwnam" for NIS instead of the
local password file?

Thanks for any help.

Paul


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

Date: 18 Nov 1999 18:39:00 +0100
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: getpwnam for NIS?
Message-Id: <83vh6zitsb.fsf@vcpc.univie.ac.at>

Re: getpwnam for NIS?, pkey <pkey@sghms.ac.uk> said:

pkey> Is there a Perl command that does "getpwnam"
pkey> for NIS instead of the local password file?

Isn't the point of things like getpwnam() that it
hides the underlying implementation?

Anyway, I'd suggest 2 ways forward:

1. doesn't the machine you're running on have a
   passwd policy (like nsswitch under Solaris) which
   makes this question moot?

2. if you really want to talk to the YP server
   directly, go to CPAN and look at:

   http://cpan.valueclick.com/modules/by-module/Net/

hth,
tony


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

Date: Thu, 18 Nov 1999 20:35:17 GMT
From: Otis Gospodnetic <otis@my-deja.com>
Subject: hash value ends up being NULL
Message-Id: <811nu8$akt$1@nnrp1.deja.com>

Hello,

I can't figure out this problem:

nb: $q is the CGI.pm object (this is not a CGI question though)

This works fine (all keys/values set properly):
my $uid = $q->param('user_id');
my $tid = $q->param('topic_id');
$data{'user_id'} = $uid;
$data{'user_topic_id'} = $tid;

This does not (one key/value always ends up blank):
$data{'user_id'} = $q->param('user_id');
$data{'user_topic_id'} = $q->param('topic_id');

foreach my $k (keys %data) { print "$k: $data{$k}\n" };

This should prints something like this:

user_topic_id:     <-- one value always stays blank (?)
user_id: 1

For some reason that user_topic_id stays empty if I assign it value of
$q->param('user_topic_id');
If I do it indirectly (like in the first example above) then it works.
Bizarre!
Anyone has any idea why this is happening?

Also, perl complains about the foreach loop:
  "Use of uninitialized value at....."
Probably because one of the values of the hash somehow ends up being
''/undef/null instead of the value I assigned them.

Any help would be appreciated.
Thanks!

Otis


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 18 Nov 1999 22:39:21 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: hash value ends up being NULL
Message-Id: <te%Y3.26131$YI2.1173505@typ11.nn.bcandid.com>

In article <811nu8$akt$1@nnrp1.deja.com>,
Otis Gospodnetic  <otis@my-deja.com> wrote:
>This works fine (all keys/values set properly):
>my $tid = $q->param('topic_id');
>$data{'user_topic_id'} = $tid;

>This does not (one key/value always ends up blank):
>$data{'user_topic_id'} = $q->param('topic_id');

>For some reason that user_topic_id stays empty if I assign it value of
>$q->param('user_topic_id');
>If I do it indirectly (like in the first example above) then it works.

Are you assigning it $q->param{'topic_id'), as in your example, or
$q->param('user_topic_id'), as in your sentence?  The latter will not work.

>Also, perl complains about the foreach loop:
>  "Use of uninitialized value at....."
>Probably because one of the values of the hash somehow ends up being
>''/undef/null instead of the value I assigned them.

'' does not cause that warning.  null in other languages corresponds to
undef in Perl.  I think you are correct, and the undef value is
$data{'user_topic_id'}.

As a way of preventing this in the future: if you really must have
separate sets of variables (or hash entries) that all hold the same
information, which should be avoided if at all possible, *name them the
same*!
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Thu, 18 Nov 1999 14:53:51 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: hash value ends up being NULL
Message-Id: <Pine.GSO.4.10.9911181452020.16575-100000@user2.teleport.com>

On Thu, 18 Nov 1999, Otis Gospodnetic wrote:

> This does not (one key/value always ends up blank):

Can you make a small, stand-alone program which illustrates this anomalous
behavior? Ideally it should use no more than a dozen or so lines, and
should be able to run without a webserver. (The CGI module normally makes
this possible.)

Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 18 Nov 1999 10:16:00 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help with understanding syntax
Message-Id: <3833d1e0_2@newsread3.dircon.co.uk>

marius_13@my-deja.com wrote:
> I am a c/c++ developer, and i'm just don't understand the sections in
> the2 books that I've read concerning "switch" syntax (case statement).
> 
> how would the following c statement be written in perl:
> 
> switch(foo)

You will find a discussion of 'switch statements' in perlfaq7 -

       How do I create a switch or case statement?

/J\
-- 
"Buzz Aldrin was the second man to walk on the moon and the first to
fill his pants" - Violet Berlin, The Big Bang


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

Date: Thu, 18 Nov 1999 14:03:08 +0000
From: James Nedham <jnedham@hotmail.com>
Subject: Help! - grep for x then echo y from a line in a logfile
Message-Id: <3834071C.125675D1@hotmail.com>

Hi,

I would really like to know how to do this.  It is driving me up the
wall!

I have a script which scans a log file for a specific value (2124499062)

if this value is found it mails me.

What I want my perl script to do is from the line where 2124499062 is on

tell me whatever machineb is on that line, it could be anything.

This is the line in the log file...


commsvr_bridge [544] machinea (Mon Nov 15 07:15:23 1999) ERROR: can't
send to remote host machineb on program 2124499062
pattern ABCDEFGHIJKLMNOPQPing (Permission denied)


Below is my script, feel free to use it but please help!!!


#! /usr/local/bin/perl -w
##########
# Define variables
my @command = qw(audioplay -v 60 /usr/demo/SOUND/sounds/touchtone.0.au);

my $logfile = "/var/adm";
my $partial = '';
my $hit;
my $hostname = `hostname`;
chomp($hostname);
my $mail = "/bin/mailx";
my $recipient = 'my@mail.address';


##########
# Check the log file can be opened
#
open (LOG, "< $logfile") || die ("Cannot read $logfile: $!\n");


##########
# Scan the log file the check every 5 seconds if a port number has been
added. Play the sound and send mail
#
while (<LOG>){}
while (1) {
  $hit = 0;
  while (defined($_ = <LOG>)) {
    $_ = $partial . $_;
    $partial = '';
    unless (/\n/) {
        $partial = $_;
        last;
    }
    /2124499062/ and ++$hit;
  }
  if ($hit) {
       system @command;
        &Send_Mail();
  }
  sleep 5;
  seek LOG, 0, 1;
}


##########
# Sub function to send mail to the mailing list
#
sub Send_Mail{
        open (MAIL,"|$mail -s '$hostname cannot contact machineb'
$recipient");
        print MAIL "machineb may be down.\n Check both machines
imediately!\n";
        close(MAIL)
}






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

Date: Thu, 18 Nov 1999 19:08:52 -0000
From: "Chris" <chris@chrismail.connectfree.co.uk>
Subject: HELP!
Message-Id: <38345cc2.0@news2.cluster1.telinco.net>

Well here goes the full story!
I started off on other newsgroups who helped me with cirtain probs I've been
changing the scripts around a little too.  Now I'm on this help newsgroup
and you've helped me a bit.  The final product now is:

sign_up.cgi --

#!/usr/local/bin/perl -w
use strict;
use CGI qw(:standard);
use Fcntl qw(:flock);
@ENV{qw(PATH IFS)} = '' x 2;
print "Content-type: text/html\n\n";
my $url = param('url');
my $forward = param('forward');
my $email = param('email');
my $success;
if(open(SUCCESS,"success.fil"))
{
flock(SUCCESS,LOCK_SH) || die "Can't lock 'success.fil - $!\n";
    $success = do { local $/; <SUCCESS>;
};
    close(SUCCESS);
}
my $unavailible;
if(open(TAKEN,"taken.fil"))
{
    flock(TAKEN,LOCK_SH) || die "Can't lock 'taken.fil - $!\n";
    $unavailible= do { local $/; <TAKEN>;
};
    close(TAKEN);
};
my $message;
if(open(MESSAGE,"message.fil"))
  {
    flock(MESSAGE,LOCK_SH) || die "Can't lock 'fils/$url.fil - $!\n";
    $message= do { local $/; <MESSAGE> };
    close(MESSAGE);
   };
if ( open(UINFO,"fils/$url.fil") )
  {
    flock(UINFO,LOCK_SH) || die "Can't lock 'fils/$url.fil - $!\n";
    my $test= do { local $/; <UINFO>;
close(UINFO);
};
    if ($test eq "")
      {
    open(URLS,">fils/$url.fil") || die "Can't open 'fils/$url.fil - $!\n";
    flock(URLS,LOCK_EX) || die "Can't flock 'fils/$url.fil - $!\n";
    print URLS "$forward";
    close(URLS);
    my $from = 'kieran@bl-soft.com';
    my $sub  = 'Your Exclamation website is up and running';
   email($email,$from,$sub,$message);
 print "$success";
  };
  }
else {
            print"$unavailible";
 };
sub email
 {
   my($to,$from,$sub,$message) = @_;
   open(MAIL, "|/var/qmail/bin/qmail-inject -t") || die;
   print MAIL "To: $to\n";
 print MAIL "From: $from\n";
 print MAIL "Subject: $sub\n";
 print MAIL "$message\n";
   return close(MAIL);
  }

forward.cgi --

#!/usr/local/bin/perl - wT
use strict;
use CGI qw(:standard);
use Fcntl qw(:flock);
@ENV{qw(PATH IFS)} = '' x 2;
my $forsite = param('url');
if(open(BOOK,"/fils/$forsite.fil"))
{
flock(BOOK,LOCK_SH) || die "Can't flock $forsite.fil - $\n";
my $redir=<BOOK>;
close(BOOK);
print redirect($redir);
}
else
{
print <<EOMESS;
<HTML>
<HEAD>
<TITLE>EXCLAMATION!</TITLE>
</HEAD>
<BODY BGCOLOR="BLACK">
<center>
<FONT COLOR="ORANGE">
EXCLAMATION!<p>
<H1>Sorry page not found</H1><p>
To register this domain with EXCLAMATION
<AHREF="http://blsoftpart.hypermart.net/sign_up.html">Click Here</A><p>
<A HREF="exclamation.html">Click Here</A> to go to exclamations main
site.<p>
<A HREF="http://www.bl-soft.com/">Click Here</A> to visit Bl-Soft (The
company who made this).<p>
<A HREF="http://www.free-address.com/">Click Here</A> to visit free-address
(Another part of the company).
</FONT>
</BODY>
</HTML>
EOMESS
};

The error now is told to me by my debugger (for both files) is and I quote
main::(sign_up.cgi:5):  @ENV{qw(PATH IFS)} = '' x 2;
and they are two single quotes!

and if you're wondering why I've taken out the -T from sign_up.cgi it's
because my debugger says and I quote again
too late for -T

Hope this clears up your questions so you can clear up mine!  Send help soon
please

--
 Chris
 chris@chrismail.connectfree.co.uk
 www.bl-soft.com/chrissite






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

Date: Thu, 18 Nov 1999 06:02:41 -0500
From: wintermute <carvdawg@patriot.net>
Subject: Re: How do I get a list of users in an NT domain?
Message-Id: <3833DCD1.5BAF29C4@patriot.net>


Use the Win32::Lanman module.  Version 1.04 fixed some minor bugs, but this will

meet your needs beautifully...


Tim Westlake wrote:

> Hi
>
>   How can I get a list of users in an NT domain? There is a
> LocalGroupGetMember function in Win32::NetAdmin but not a similar one
> for global groups (in the documentation I have anyway). If there was
> then I could query the Domain Users global group.
>
>   Help appreciated
>
>   thanks
>
> Tim
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Thu, 18 Nov 1999 19:08:34 -0000
From: Ben Osman <ben@smooth.co.uk>
Subject: how to do multiple search and replaces
Message-Id: <MPG.129e5ef7d4c33579989682@news.ukonline.co.uk>

hello all 

thanks for the help on my searching flatfile with a hash proble - it is 
now working v. well!

I am now trying to search multiple strings and replace them with a 
corresponding string,

the following matches any any of string1,string2,string3 

$line =~ s/(string1|string2|string3)/g;

how do I replace string1 with replace1, string2 with replace2 and so on.

line =~ s/(string1|..)/I_want_to_replace_the_matching_string/g;

I have put all queries into a hash with stringx/replacex key/value pairs,

how do i get it to replace the corresponding string without using a for 
loop.

if any one could shed some light or point me in the right direction I 
will be once again very grateful.

thanks

Ben


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

Date: Thu, 18 Nov 1999 11:44:19 +0100
From: Abel =?iso-8859-1?Q?Almaz=E1n?= <abel.almazan@ogilvyinteractive.es>
Subject: How to know the space occuped by a directory??
Message-Id: <3833D883.A2D5829F@ogilvyinteractive.es>

I want to know how many kbytes are stored on a directory, that have
subdirectories.

What kind of instructions or code is necessary for this purpose??

Thanx.



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

Date: 18 Nov 1999 11:43:03 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to know the space occuped by a directory??
Message-Id: <3833e647_1@newsread3.dircon.co.uk>

Abel Almazán <abel.almazan@ogilvyinteractive.es> wrote:
> I want to know how many kbytes are stored on a directory, that have
> subdirectories.
> 
> What kind of instructions or code is necessary for this purpose??
> 

The unix command du will do it ...

/J\
-- 
"As usual I'm the price you have to pay for the funny bits" - Denis Norden


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

Date: Thu, 18 Nov 1999 21:39:31 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: how to make perl executable
Message-Id: <slrn838sku.e6g.bmccoy@moebius.foiservices.com>

Also Sprach David J. Ritchie <ritchie@fnal.gov>:

>I wish there were something for this as simple and straight-forward in the Active
>State implementation as in the Mac Perl implementation.  Ditto for the nice way
>that the MacPerl has an integrated editor, compiler (if that's the right word),
>and execution environment.

There is -- perl2bat and perl2exe are tools to make Perl executable
without explicitly having to run the interpreter.

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: 18 Nov 1999 11:58:59 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: How to make the comparable also hashable?
Message-Id: <slrn837qh3.1qp.mgjv@wobbie.heliotrope.home>

On Thu, 18 Nov 1999 11:33:05 +0800,
	John Lin <johnlin@chttl.com.tw> wrote:
> Just like in C++ (STL), we can use map<A>, set<A>
> if A::operator<() is defined (overloaded).
> 
> In Perl, I have a package A.  I can define their comparison
> (overload the '<=>' and 'cmp') but it is difficult to define
> string-ifying ('""').  How can I use them as hash keys?
> 
> For example:
> 
> my $a=new A($foo);  # 'cmp' is overloaded in package A
> my $b=new A($bar);  # but '""' is not (because it is difficult)
> my %hash;
> $hash{$a}=1;      # use object as hash key, not string-ified
> $hash{$b}=2;      # suppose $a eq $b
> print $hash{$a};  # I need to get '2' here
> 
> Thank you.
> 
> John Lin
> 
> P.S.
>     perldoc -q "reference as a hash key"
> directed me to Tie::RefHash.  I studied its source code.
> It merely stores string-ified references like 'A=SCALAR(0x10c22bc)'.
> It is not related to comparison, so it is not suitable here.
> 
> I also checked CPAN.  None of the Tie::* module is suitable, either.

It is not clear to me what you want. You can use any reference as a hash
key. It will be stringified, and unique. What you can't do, is get that
hash key back, and start using it as a reference again. Is that what you
want? Because then Tie::RefHash is the solution. Otherwise, just store
the reference itself somewhere in the value of the hash.

Are you trying to do something like:

foreach (sort keys %hash) {}

where those keys are the references? if so, maybe you should just write
a simple sort routine that does something sensible, instead of trying to
accomplish this with ties, overloading and other things.

But I'm still not clear what it is you want.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | What's another word for Thesaurus?
NSW, Australia                  | 


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

Date: Thu, 18 Nov 1999 17:47:49 +0900
From: "Moltimer" <factory@factory.co.kr>
Subject: Re: How to sort lines of plain text db file ?
Message-Id: <e7C#N$ZM$GA.223@news.thrunet.com>

Sorry. guys.

I lost yesterday's massages.
I can not see any answers even my own post.
Our news server may have problem.

Will someone please give me answer again ?

Sorry again and thank you

Larry Rosler ÀÌ(°¡) ¸Þ½ÃÁö¿¡¼­ ÀÛ¼ºÇÏ¿´½À´Ï´Ù...
>In article <XjevjMYM$GA.219@news.thrunet.com> on Thu, 18 Nov 1999
>14:22:39 +0900, Moltimer <factory@factory.co.kr> says...
>> Hi,
>>
>> I'm trying to print out a html page.
>> and it works well with something like following code.
>> it prints all lines which has "sample" on second value($ex1).
>>
>> How can I sort all lines according to "$ex3" and print them in a html
>> page with correct order ?
>
>You asked this same question yesterday, and got several answers.  Is
>there anything about the answers that would have caused you to post the
>question again?
>
>--
>(Just Another Larry) Rosler
>Hewlett-Packard Laboratories
>http://www.hpl.hp.com/personal/Larry_Rosler/
>lr@hpl.hp.com




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

Date: Thu, 18 Nov 1999 18:11:25 +0900
From: "Moltimer" <factory@factory.co.kr>
Subject: Re: How to sort lines of plain text db file ?
Message-Id: <$BKhYMaM$GA.53@news.thrunet.com>

Thanks averyone.
I got the massages of yesterday from dejanews.

Thanks again.


Moltimer ÀÌ(°¡) ¸Þ½ÃÁö¿¡¼­ ÀÛ¼ºÇÏ¿´½À´Ï´Ù...
>Sorry. guys.
>
>I lost yesterday's massages.
>I can not see any answers even my own post.
>Our news server may have problem.
>
>Will someone please give me answer again ?
>
>Sorry again and thank you
>
>Larry Rosler ÀÌ(°¡) ¸Þ½ÃÁö¿¡¼­ ÀÛ¼ºÇÏ¿´½À´Ï´Ù...
>>In article <XjevjMYM$GA.219@news.thrunet.com> on Thu, 18 Nov 1999
>>14:22:39 +0900, Moltimer <factory@factory.co.kr> says...
>>> Hi,
>>>
>>> I'm trying to print out a html page.
>>> and it works well with something like following code.
>>> it prints all lines which has "sample" on second value($ex1).
>>>
>>> How can I sort all lines according to "$ex3" and print them in a html
>>> page with correct order ?
>>
>>You asked this same question yesterday, and got several answers.  Is
>>there anything about the answers that would have caused you to post the
>>question again?
>>
>>--
>>(Just Another Larry) Rosler
>>Hewlett-Packard Laboratories
>>http://www.hpl.hp.com/personal/Larry_Rosler/
>>lr@hpl.hp.com
>
>




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

Date: 18 Nov 1999 10:02:52 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to sort lines of plain text db file ?
Message-Id: <3833cecc_2@newsread3.dircon.co.uk>

Moltimer <factory@factory.co.kr> wrote:
> Scott Lanning ÀÌ(°¡) ¸Þ½ÃÁö¿¡¼­ ÀÛ¼ºÇÏ¿´½À´Ï´Ù...
>>"Moltimer" <factory@factory.co.kr> writes:
>>> How can I sort all lines according to "$ex3" and print them in a html
>>> page with correct order ?
>>
>>perldoc perlfaq4
>>"How do I sort an array by (anything)?"
>>
> I'm not talking about array but lines.

You are talking about an array but you just dont know it yet.

/j\
-- 
"Over the years I've always had Max Factor in my box" - Tina Earnshaw,
Chief Make-Up Artist, Titanic


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

Date: 18 Nov 1999 11:23:17 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: How to sort lines of plain text db file ?
Message-Id: <slrn837oe4.1qp.mgjv@wobbie.heliotrope.home>

[Your machine has a chronology problem, your reply came before the text
you replied to. Please reset your clock]
[We do not customarily address each other with 'Dear' here, but schwa
:)]

On Thu, 18 Nov 1999 15:10:03 +0900,
	Moltimer <factory@factory.co.kr> wrote:
> Scott Lanning ÀÌ(°¡) ¸Þ½ÃÁö¿¡¼­ ÀÛ¼ºÇÏ¿´½À´Ï´Ù...
> >"Moltimer" <factory@factory.co.kr> writes:
> >> How can I sort all lines according to "$ex3" and print them in a html
> >> page with correct order ?
> >
> >perldoc perlfaq4
> >"How do I sort an array by (anything)?"
>
> Dear,
> I'm not talking about array but lines.

What's the difference? If you want to sort the file without first
reading it into memory, then you probably would be better off using your
system's command line sort. or you could implement a filesystem assisted
merge sort yourself, but you still, at some point in time, would need to
read the lines into an array.

Let me rephrase that: You do not have to read them into an array. I
could probabably come up with other ways, but trust me, you _do_ want an
array. And if I recall your original post correctly (or was that another
thread?) you want to display this stuff in a web page. Nothing that
legitimately can be displayed in a web page is too large to just slurp
into an array and sort.

Now, next time someone gives you correct advice, please think about it a
while before you tell them they're wrong.

Thank you,
Martien
-- 
Martien Verbruggen                      |
Interactive Media Division              | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Thu, 18 Nov 1999 14:54:35 +0100
From: Thomas Bätzler <Thomas@Baetzler.de>
Subject: Re: How to use LWP::UserAgent through firewall/proxy
Message-Id: <k5183sgf4rq5j7gdohkrh9pe8gt3j273gd@4ax.com>

Hi,

Brad Warkentin <bradw@newbridge.com> wrote:

>I am trying to use LWP::UserAgent to fetch webpages. Works fine on our
>intranet but I whenever I try and get anything from outside I get a
>"403 Forbidden" error.
[...]
>Why does the following not work
>
>$ua->proxy(http => 'http://bob.ca.newbridge.com:80');
>$ua->no_proxy('ca.newbridge.com','uk.newbridge.com','us.newbridge.com');

Check your syntax - it looks different from what's on the man page:

-snip-
$ua->proxy(...)

     Set/retrieve proxy URL for a scheme: 

      $ua->proxy(['http', 'ftp'], 'http://proxy.sn.no:8001/');
      $ua->proxy('gopher', 'http://proxy.sn.no:8001/');

     The first form specifies that the URL is to be used for proxying
of access methods listed in the list in the
     first method argument, i.e. 'http' and 'ftp'. 

     The second form shows a shorthand form for specifying proxy URL
for a single access scheme. 
-snip-

HTH,
-- 
Thomas Baetzler - http://baetzler.de/ - Clan LOL http://lavabackflips.de
"I see a lot of people walkin' round here with tombstones in their eyes"


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

Date: 18 Nov 1999 09:44:18 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: html via perl
Message-Id: <3833ca72_2@newsread3.dircon.co.uk>

Bryan Doyle <bdoyle@wiannoassociates.com> wrote:
> Hi,
> 
> I need to open the url which is defined by the variable $guestbookurl as a
> full window in the browser (ie5), rather than in the frame that the script
> is called from.  The relevant area of code in question is below.  Inserting
> TARGET="_top"    after      print "<a href=\"$guestbookurl\"     obviously
> does not work.  Any advice or reference would be truly appreciated.
> 

This then is a question about HTML - I have set the followups to a possibly
appropriate group ...

/J\
-- 
"What is the future for beef? Curtains?" - Graham Norton


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

Date: Thu, 18 Nov 1999 10:10:39 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: html via perl
Message-Id: <810jau$ekj$1@nnrp1.deja.com>

In article <810al6$oqt$1@autumn.news.rcn.net>,
  "Bryan Doyle" <bdoyle@wiannoassociates.com> wrote:
> Hi,
<Snip>
> Inserting
> TARGET="_top" after print "<a href=\"$guestbookurl\" obviously
> does not work.

Why not?

print "<a href=\"$guestbookurl\" TARGET=\"_top\">Proceed to the
Registered Users' Page!</a>";


Jeremy Gurney
SAS Programmer  |  Proteus Molecular Design Ltd.
"If at first you don't succeed - use a bigger hammer"


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 18 Nov 1999 12:05:44 +0000 (GMT)
From: Ben Evans <bene@chiark.greenend.org.uk>
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <Wvh*MRpdo@news.chiark.greenend.org.uk>

In article <x7so24sshu.fsf@home.sysarch.com>,
Uri Guttman  <uri@sysarch.com> wrote:
>>>>>> "BE" == Ben Evans <bene@chiark.greenend.org.uk> writes:
>
>  >> well, you got answers. are you going to do the right thing or wimp out
>  >> and teach evil black magic to a bunch of perl newbies?
>
>  BE> So, let me get this straight... you're asking me to make a direct
>  BE> choice between Good and Evil, with the "Good" option requiring extra
>  BE> mental discipline on my part?
>
>  BE> Symref::Lightsaber::DoubleHeaded , anyone?
>
>look, make your own choice. i don't really care. you are asking for help
>here and we tell you not to use symrefs. you can use them. perl and this
>group won't stop you. but don't you or any of your "students" ask for
>any help here as we are giving you good advice and you seem to be
>ignoring it. we say not to use symrefs for very good reasons and you
>don't grok them. your loss.

People learn in different ways. Personally, I've never reacted well
to the macho "do exactly what I say, and if you ask questions or
don't understand then you're at fault". I've only ever learned anything
by being wrong, and I've learned the most by being wrong, thinking about it
and taking another step, and being wrong again, and iterating. I also
tend to be fairly laid-back and fluffy about the way I learn.

*shrug*, basically.

Kitty
--
Ben Evans (bene@chiark.greenend.org.uk)
Just Another Evil-Policy Wielding Politely Frivolous High Density Random
Blonde Perl-Hacking Dilated-Eyed Gonzo Nancy Geek Kitten-Boy


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

Date: 18 Nov 1999 12:10:51 +0000 (GMT)
From: Ben Evans <bene@chiark.greenend.org.uk>
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <VKh*YSpdo@news.chiark.greenend.org.uk>
Keywords: cavalier deferral impose it'll

In article <80vdh5$f79$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>In article <FDn*U3ado@news.chiark.greenend.org.uk>,

[snip]

[emailed to self for redistribution to non-Usenet reading members of team]

Thanks. That's great.

IIWY, I'd put that up on the same page as the other articles, as it's
a lot clearer and has a lot more explanation than the other two pieces.

Kitty
--
Ben Evans (bene@chiark.greenend.org.uk)
Just Another Evil-Policy Wielding Politely Frivolous High Density Random
Blonde Perl-Hacking Dilated-Eyed Gonzo Nancy Geek Kitten-Boy


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

Date: 18 Nov 1999 12:18:06 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <slrn837rju.ksp.simon@othersideofthe.earth.li>

Ben Evans (comp.lang.perl.misc):
>>look, make your own choice. i don't really care. you are asking for help
>>here and we tell you not to use symrefs. you can use them. 
> I've only ever learned anything
>by being wrong, and I've learned the most by being wrong, thinking
>about it and taking another step, and being wrong again, and iterating.
>I also tend to be fairly laid-back and fluffy about the way I learn.

I have no problems with you being wrong, but I beg you not to encourage
other people to be wrong as well, especially while telling them it's
right. Kitty, I know you, and I know where you live. Be careful. :)

-- 
Intel engineering seem to have misheard Intel marketing strategy. The phrase
was "Divide and conquer" not "Divide and cock up"
(By iialan@www.linux.org.uk, Alan Cox)


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

Date: 18 Nov 1999 14:42:26 +0000 (GMT)
From: Ben Evans <bene@chiark.greenend.org.uk>
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <I-u*uqqdo@news.chiark.greenend.org.uk>

In article <slrn837rju.ksp.simon@othersideofthe.earth.li>,
Simon Cozens <simon@brecon.co.uk> wrote:
>Ben Evans (comp.lang.perl.misc):
>>Some other guy wrote:
>>>look, make your own choice. i don't really care. you are asking for help
>>>here and we tell you not to use symrefs. you can use them. 
>> I've only ever learned anything
>>by being wrong, and I've learned the most by being wrong, thinking
>>about it and taking another step, and being wrong again, and iterating.
>>I also tend to be fairly laid-back and fluffy about the way I learn.
>
>I have no problems with you being wrong, but I beg you not to encourage
>other people to be wrong as well, especially while telling them it's
>right. 

Well, at worse, all I could have done was fail to encourage people
to be right. I suppose that could have been constructed as a kind
of silent consent to wrongness, bu there we are.

Still, it's just as well that you didn't s/wrong/bad/g.[1]

>Kitty, I know you, and I know where you live. Be careful. :)

I always am.[2]

Kitty
[1] All things being equal.
[2] As me dear old mum always used to say: "Be good. And if you can't be
    good, be careful."
--
Ben Evans (bene@chiark.greenend.org.uk)
Just Another Evil-Policy Wielding Politely Frivolous High Density Random
Blonde Perl-Hacking Dilated-Eyed Gonzo Nancy Geek Kitten-Boy


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

Date: Thu, 18 Nov 1999 17:27:43 -0500
From: "Raymond Gordon" <ray_g@netcom.ca>
Subject: Is there anyone out there with experience setting up Microsoft's Personal Web Server to run perl/CGI scripts?
Message-Id: <I4%Y3.191605$5r2.439199@tor-nn1.netcom.ca>

I would like to learn CGI programming with perl and get som practical
experience too.  I have Windows98 (second edition) and have installed the
Personal Web Server software which came with it.  The browser being used is
IE v5.0.  I am not connected to any LAN.  I have internet access via a modem
and telephone line.  When I choose a link to launch a perl script using the
CGI module, I get a DOS window with text informing me that the I am working
offline and requesting me for the input parameters.  This happens whether or
not  I am connected to the internet.  The Personal Web Server instructions
for configuring the browser to access a web site not connected to a network
do not work for IE v/5.0.  I have experimented a couple of days now without
getting anywhere.  Have not tried anything really drastic which may cause me
to irrevocably loose my present IE configuration, though, because I still
need to access the internet on a regular basis.  Would appreciate any help I
can get.  --raymond




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

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 V9 Issue 1420
**************************************


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