[10775] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4376 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 7 20:07:17 1998

Date: Mon, 7 Dec 98 17:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 7 Dec 1998     Volume: 8 Number: 4376

Today's topics:
    Re: 80 column conversion <ebohlman@netcom.com>
    Re: Checking on NT printers... (Rob Greenbank)
    Re: Code Bash: File Include (Larry Rosler)
    Re: Code Bash: File Include <merlyn@stonehenge.com>
    Re: Code Bash: File Include <uri@sysarch.com>
    Re: Conditional statements in control structures (Andrew Allen)
    Re: Conditional statements in control structures <alexis@danae.demon.co.uk>
    Re: Conditional statements in control structures (Larry Rosler)
    Re: Conditional statements in control structures <rick.delaney@home.com>
    Re: Conditional statements in control structures <r28629@email.sps.mot.com>
    Re: deleting line in a textfile? <aqumsieh@matrox.com>
        Indexing with apache <Alex@acky.net>
    Re: Indexing with apache (Martien Verbruggen)
        Newbie question (NJPin)
    Re: Newbie question <rick.delaney@home.com>
    Re: Perl and Btrieve Support (Jeffrey Drumm)
    Re: Perl examples <gellyfish@btinternet.com>
        Perl script to pass data to a remote CGI cdtoad@hotmail.com
    Re: Perl script to pass data to a remote CGI (Martien Verbruggen)
    Re: perl zip (Martien Verbruggen)
    Re: perl zip <gellyfish@btinternet.com>
    Re: SSI from Perl on IIS (Martien Verbruggen)
    Re: Wanted:  Win32 GetGroups function <george.kuetemeyer@mail.tju.edu>
        weird @_ and sprintf behavior <kin@symmetrycomm.com>
    Re: weird @_ and sprintf behavior (Ilya Zakharevich)
    Re: Which modules to use <monkey@chisp.net>
    Re: Which modules to use <ebohlman@netcom.com>
        Why i can't "localize through a reference" in perl vers <feng_xian@mitel.com>
    Re: Why i can't "localize through a reference" in perl  (Martien Verbruggen)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 7 Dec 1998 23:06:49 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: 80 column conversion
Message-Id: <ebohlmanF3MAvD.3IC@netcom.com>

I.J. Garlick <ijg@csc.liv.ac.uk> wrote:
: Don't like Text::Wrap, does screwy things with lines of characters greater
: than the max column width when there are no spaces in the line. :-( Anbody
: else come across this problem?

IIRC, the author of Text::Format did, and it was a major part of why he 
wrote it.


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

Date: Mon, 07 Dec 1998 23:09:11 GMT
From: rob@frii.com (Rob Greenbank)
Subject: Re: Checking on NT printers...
Message-Id: <366d5fcc.257385437@news.frii.com>

Whoops, should have been more specific.

These will be printers on NT print servers (some are actually IP
printers, but the NT shares need to be checked).


On Mon, 07 Dec 1998 22:48:17 GMT, rob@frii.com (Rob Greenbank) wrote:

>I need to implement a printer monitor to keep an eye on quite a few
>network printers.  If there is a handy perl module to help me out, it
>would be a great solution.  Even if it's not that handy, I'd be
>interested in any solution.
>
>I've searched DejaNews (both perl and NT newsgroups) and didn't come
>up with anything.  I also looked through the modules that seemed to be
>the most likely candidate.  Came up with nothing.
>
>Anyone?
>
>	Thanks,
>	Rob Greenbank (rob.greenbank@janus.com)



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

Date: Mon, 7 Dec 1998 15:25:33 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Code Bash: File Include
Message-Id: <MPG.10d603c54b13f15d9898ad@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <MPG.10d5f7dfaab9a0a39896b1@news.sonic.net> on Mon, 7 Dec 
1998 14:34:47 -0800, Sam Curren <samc@empirewest.com> says...
> > >     unless(open IFILE, $file) { print("Can't open $file: $!\n"); return; 
> > > }    
> > 
> LR> This is a praiseworthy diagnostic.  It might be written more 
> LR> conventionally as:
> LR> 
> LR>       open IFILE, $file or die "Can't open '$file': $!\n";
> 
> I was using the print statement so that it would be printed to STDOUT, 
> making debugging easy. Is there a better way to do this? Perhaps 
> redirecting the output of die() to STDOUT?

I didn't think about that 'return;' in your subroutine.  One 
characteristic of die() is that by default the program dies. :-)

Your use of print() may be appropriate for your purposes.  Another way 
is to implement your own handler for die():

    $SIG{__DIE__} = sub { ... };

but 'return' in there takes you back to the die() that raised the 
exception, and it dies anyway.  I usually use an explicit 'exit;'.

>From perlvar:

The routine indicated by $SIG{__DIE__} is called when a fatal exception 
is about to be thrown. The error message is passed as the first     
argument. When a __DIE__ hook routine returns, the exception processing 
continues as it would have in the absence of the hook, unless the hook     
routine itself exits via a goto, a loop exit, or a die(). The __DIE__ 
handler is explicitly disabled during the call, so that you can die from 
a __DIE__ handler. Similarly for __WARN__. 

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 07 Dec 1998 23:49:49 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Code Bash: File Include
Message-Id: <8cg1ar3436.fsf@gadget.cscaper.com>

>>>>> "Sam" == Sam Curren <samc@empirewest.com> writes:

Sam> Here is a subroutine I wrote to include other files in output, mostly for 
Sam> preformatted html, but also for non-cgi purposes. Rip it to shreds, that 
Sam> I might learn better coding practices. Thanks!

Sam> calling method:

Sam> ifile("include.txt");

Sam> subroutine:

Sam> sub ifile {
Sam>   foreach $file (@_) {
Sam>     unless(open IFILE, $file) { print("Can't open $file: $!\n"); return; 
Sam> }    
Sam>     while($line = <IFILE>) { print $line; }
Sam>     close IFILE;
Sam>   }
Sam> }

I usually don't do that as a subroutine.  I just do this:

  { local @ARGV = @yourlist; print while <>; }

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 07 Dec 1998 19:07:38 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Code Bash: File Include
Message-Id: <x767bnwl6d.fsf@sysarch.com>

>>>>> "RS" == Randal Schwartz <merlyn@stonehenge.com> writes:

>>>>> "Sam" == Sam Curren <samc@empirewest.com> writes:
  Sam> unless(open IFILE, $file) { print("Can't open $file: $!\n"); return; 
                                                                    ^^^^^^

  RS>   { local @ARGV = @yourlist; print while <>; }

randal,

notice if the open fails, he has a return, not just a warning. yours
prints a warning but goes onto the next file. maybe he wasn't sure of
his desired behavior, but your example doesn't follow his example to the
letter.

so a challenge for you would be a one liner that would also exit the
@ARGV loop with an error message.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 7 Dec 1998 22:51:31 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Conditional statements in control structures
Message-Id: <74hm5j$gtd@fcnews.fc.hp.com>

Jeff Beard (jeffbremovethis@mcguckin.com) wrote:
: Hello,

: I've got an array that I want to loop through and when I am at the first
: value (regardless of the value) I want to do one thing but for the rest
: do something different. What I have is:

(some obviously broken code)

: my @array = qw(apples oranges pears);

: my $i = @array1[0];
          ^^^^^^^^^^ 
should be '$array[0]' (it's always a good idea to use '-w' and 'use
strict')

: foreach (@array) {
:     if ($_ = $i) {
             ^
should be 'eq' (you want a string comparison, not numeric comparison)

: 	print "$_\n";
:     } else {
: 	print "$_\n";

missing a '}'

: }

: This, of course, doesn't work. 

or even compile!

: I've also tried something similar with a
: while loop. Could you help please?

You could use an array slice:

  my @array = qw(apples oranges pears);
  print "first element:$array[0]\n";
  foreach (@array[1..$#array])
  {
    print "after first element:$_\n";
  }

or index the array:

  my @array = qw(apples oranges pears);
  for(my $i=0;$i<=$#array;$i++)
  {
    my $a=$array[$i];
    if($i==0) {
      print "first element:$a\n";
    }
    else {
      print "after first element:$a\n";
    }
  }

or keep track of loop count:

  my @array = qw(apples oranges pears);
  my $first=0;
  foreach(@array)
  {
    unless($first++) {
      print "first element:$_\n";
    }
    else {
      print "after first element:$_\n";
    }
  }

: Jeff Beard
: Systems Administrator

really?!?  This seems like a very simple problem, compared to those an
sysadmin would see every day.

Andrew Allen


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

Date: 07 Dec 1998 23:17:32 GMT
From: Alexis Huxley <alexis@danae.demon.co.uk>
Subject: Re: Conditional statements in control structures
Message-Id: <f3mbd8.8qi@danae.demon.co.uk>

In <366C4619.D34E7000@mcguckin.com> Jeff Beard <jeffbremovethis@mcguckin.com> writes:

> I've got an array that I want to loop through and when I am at the first
> value (regardless of the value) I want to do one thing but for the rest
> do something different. What I have is:

> my @array = qw(apples oranges pears);

> my $i = @array1[0];

I presume that's a typo and that it should be:

my $i = $array[0];

But there's no need to remember the value into a different variable anyway.

> foreach (@array) {

Don't compare the values, compare the indexes. Use a 'for' loop:

my ($x);
for ($x=0; $x<$#array; $x++) {

>     if ($_ = $i) {

Then you can test the index, instead of the value:

if ($x == 0) {

> 	print "$_\n";

This'll need changing:

        print "$array[$x]\n";

>     } else {
> 	print "$_\n";
> }

> This, of course, doesn't work. I've also tried something similar with a
> while loop. Could you help please?

This is a 'philosophical' programming problem, it's not Perl specific. I
recommend a good book on programming such as "Algorithms + Data Structures 
= Programs" by Niklaus Wirth.

Also '$i' is for 'for' loop indexes! :-)))) Actually, seriously, I bet using
'$i' *does* improve scanability.

Good luck.

Alexis
-- 
Alexis Huxley
alexis@danae.demon.co.uk
email key: 549812


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

Date: Mon, 7 Dec 1998 15:35:05 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Conditional statements in control structures
Message-Id: <MPG.10d606055a4bde619898ae@nntp.hpl.hp.com>

In article <366C4619.D34E7000@mcguckin.com> on Mon, 07 Dec 1998 14:18:17 
-0700, Jeff Beard <jeffbremovethis@mcguckin.com> says...
 ...
> foreach (@array) {
>     if ($_ = $i) {
> 	print "$_\n";
>     } else {
> 	print "$_\n";
> }

So far, no one has observed that the two consequents of this decision 
are identical.  Even if the test is corrected.  :-)

Of course, there is also a missing '}', so I presume this isn't the 
original code.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 07 Dec 1998 23:51:53 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Conditional statements in control structures
Message-Id: <366C6BD0.926C937D@home.com>

Rick Delaney wrote:
> 
>     foreach my $element (1..$#array) {
>         do_something_else_with($element);
>     }

Obviously wrong!

   do_something_else_with($array1[$element]);

>     for(my $i = 1;$i < @array1;$i++) {
>         do_something_else_with($element);
>     }
>

And again!

   do_something_else_with($array1[$element]);
 
1 out of 3, ugh.  I will cancel, butI fear it is already too late.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Mon, 07 Dec 1998 17:44:45 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Greg Bacon <gbacon@cs.uah.edu>
Subject: Re: Conditional statements in control structures
Message-Id: <366C686D.AD6046B6@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]
 
Greg Bacon wrote:
> 
> In article <366C4619.D34E7000@mcguckin.com>,
>         Jeff Beard <jeffbremovethis@mcguckin.com> writes:
> : I've got an array that I want to loop through and when I am at the first
> : value (regardless of the value) I want to do one thing but for the rest
> : do something different. What I have is:
> :
> : my @array = qw(apples oranges pears);
> :
> : my $i = @array1[0];
> 
> Should be
> 
>   my $i = $array1[0];
> 
> : foreach (@array) {
> :     if ($_ = $i) {
> 
> Should be
> 
>       if ($_ == $i) {
               ^^
er.. you probable need 'eq'.

-TK


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

Date: Mon, 7 Dec 1998 13:26:32 -0500 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: deleting line in a textfile?
Message-Id: <x3yyaojke3a.fsf@tigre.matrox.com>


Remo Goetschi <remo.goetschi@bigfoot.com> writes:

> 
> Now I need a little perl programm that deletes the line matching to the
> string "Eddie Miller;4587;eddie.miller@entreprise.com" from the
> textfile.
> Who can help me?

The beautifully written FAQs are your best friend.
>From perlfaq5

     How do I change one line in a file/delete a line in a
     file/insert a line in the middle of a file/append to the
     beginning of a file?


Read it.



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

Date: 7 Dec 1998 18:50:09 -0600
From: "Alex Osipov" <Alex@acky.net>
Subject: Indexing with apache
Message-Id: <FI_a2.13341$Wv1.3233633@newscene.newscene.com>

This is a multi-part message in MIME format.

------=_NextPart_000_00D4_01BE221B.38D1FDA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,
I am trying to do indexed site with apache, but is there anyway to make =
apache automatically load the same index in every directory instead of =
loading the index in there?  So I wouldn't have to put index.pl in every =
single directory I create?  Reply to ack@asan.com

Sincerely,
Alex Osipov.

------=_NextPart_000_00D4_01BE221B.38D1FDA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hi,</FONT></DIV>
<DIV><FONT size=3D2>I am trying to do indexed site with apache, but is =
there=20
anyway to make apache automatically load the same index in every =
directory=20
instead of loading the index in there?&nbsp; So I wouldn't have to put =
index.pl=20
in every single directory I create?&nbsp; Reply to <A=20
href=3D"mailto:ack@asan.com">ack@asan.com</A></FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Sincerely,</FONT></DIV>
<DIV><FONT size=3D2>Alex Osipov.</FONT></DIV></BODY></HTML>

------=_NextPart_000_00D4_01BE221B.38D1FDA0--



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

Date: Tue, 08 Dec 1998 00:53:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Indexing with apache
Message-Id: <BM_a2.116$884.117@nsw.nnrp.telstra.net>

In article <FI_a2.13341$Wv1.3233633@newscene.newscene.com>,
	"Alex Osipov" <Alex@acky.net> writes:
> This is a multi-part message in MIME format.

Please don't do that. Usenet is a plain text mdium. It is not the WWW.

> I am trying to do indexed site with apache, but is there anyway to make =
> apache automatically load the same index in every directory instead of =
> loading the index in there?  So I wouldn't have to put index.pl in every =
> single directory I create?  

And your perl problem is what? Why don't you read the manual that came
with your web server? And if you really feel like annoying someone
with questions like this, please ask them in a newsgroup that talks
about web servers, and possibly about the one you use:
comp.infosystems.www.*

> Reply to ack@asan.com

No. Post here, read here. People who are too lazy to check followups
to their own posts don't deserve an email copy.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.       | you come to the end; then stop.
NSW, Australia                      | 


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

Date: 7 Dec 1998 23:44:26 GMT
From: njpin@aol.com (NJPin)
Subject: Newbie question
Message-Id: <19981207184426.12649.00003864@ng-cc1.aol.com>

I want to read a text file line by line (the text file is space delimited) and
store each of the text values of that line in variables labelled according to
the line #

eg.  text file reads something like this:

id     numeric     1     1     5
q1    single        1    20   20
etc....

I'd like to store 'id' in $str1_line1, 'numeric' in $str2_line1, '1' in
$str3_line1 etc...

any suggestions?  I am a real green newbie with experience in cshell scripting,
awk, etc, but haven't been able to find an answer in perldoc/man pages...

Thanks - 
Pinney


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

Date: Tue, 08 Dec 1998 00:04:12 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Newbie question
Message-Id: <366C6EB4.4C7A1647@home.com>

[posted & mailed]

NJPin wrote:
> 
> I want to read a text file line by line (the text file is space 
> delimited) and store each of the text values of that line in variables 
> labelled according to the line #
                            ^^^^^^
Are you sure?

> 
> eg.  text file reads something like this:
> 
> id     numeric     1     1     5
> q1    single        1    20   20
> etc....
> 
> I'd like to store 'id' in $str1_line1, 'numeric' in $str2_line1, '1' 
> in $str3_line1 etc...
> 

Those look like _field_ numbers to me.  Either way, you want to use an
array, not a bunch of similarly named scalars.

while(<>){
    chomp; 
    @array = split;
    print "$array[1]\n"
}

Using the above data will give:
numeric
single

HTH.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Tue, 08 Dec 1998 00:05:16 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Perl and Btrieve Support
Message-Id: <366c6ac1.344535869@news.mmc.org>

[posted and mailed]

(snip)

>pardon me for stupid question, but is it possible (with or without DBD::ODBC)
>to connect to Btrieve DB on Netware server by perl from Linux box?
>
>Thank

There are vendors that make ODBC drivers for the Unix platform, but I
somehow doubt they've done anything for Btrieve.

You could, however, write a service that runs on an NT box connected to
your Netware server that would handle database requests from your Linux box
and make the requisite ODBC requests. Not for the faint of heart, but
possible.

-- 
                           Jeffrey R. Drumm, Systems Integration Specialist
                                  Maine Medical Center Information Services
                                     420 Cumberland Ave, Portland, ME 04101
                                                        drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me


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

Date: 7 Dec 1998 20:15:25 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perl examples
Message-Id: <74hd0t$ie$1@gellyfish.btinternet.com>

On Mon, 07 Dec 1998 19:13:32 +0100 Pep Mico <pep_mico@hp.com> wrote:
> Where can I found Perl Examples? I only found sites that only contais
> CGI scripts and I'm interested to found other examples, more helpful for
> a system admin.

You could do worse than lurking in this group for a while - quite a lot of
example code gets posted and the majority is most definitely not CGI stuff.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 07 Dec 1998 23:52:44 GMT
From: cdtoad@hotmail.com
Subject: Perl script to pass data to a remote CGI
Message-Id: <74hpob$gvj$1@nnrp1.dejanews.com>

Hello,

I am working on a project now which involves fill out forms and a perl script
which validates the data and a firewall.  The form is being served up from
one server and (I would like) the data to be sent to a second server sitting
behind my firewall.  Can someone point me in the direction of how to make
Perl pass CGI data to ANOTHER remote CGI.  The catch here is that the machine
behind the firewall is not running perl and can not run anything other than
Data21's IpServer for CICS.

Thanks

Dave
cdtoad@hotmail.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 08 Dec 1998 00:49:06 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl script to pass data to a remote CGI
Message-Id: <6I_a2.115$884.117@nsw.nnrp.telstra.net>

In article <74hpob$gvj$1@nnrp1.dejanews.com>,
	cdtoad@hotmail.com writes:

> I am working on a project now which involves fill out forms and a
> perl script which validates the data and a firewall.  The form is
> being served up from one server and (I would like) the data to be
> sent to a second server sitting behind my firewall.  

You have just given about 3/4 of the security experts a heart attack.
The other 1/4 is chuckling.

For firewall issues: refer to your firewall software documentation.
For CGI issues: Refer to the CGI documentation, and talk to the people
in the comp.infosystems.www.* groups.

> Can someone
> point me in the direction of how to make Perl pass CGI data to
> ANOTHER remote CGI.  The catch here is that the machine behind the
> firewall is not running perl and can not run anything other than
> Data21's IpServer for CICS.

Make up your mind. Does the one CGI 'contact another cgi' or does it
need to talk to your data21 IPServer directly (whatever that is). Also
note, that you cannot talk to another CGI process directly. You will
need a web server to run it.

First, let's get some things straight. You have a client (CGI process,
written in perl?) that needs to talk to a server (data21's IpServer
for CICS, whatever that is). You cannot contact a CGI process
remotely. There is no such thing. Besides, you say that that remote
server can only run that IpServer thing. Is that maybe a web server?
if so, contact the web server on the appropriate port, and request the
appropriate URL. You may use the LWP routines for that.

Your site administrator will most likely tell you to figure out
another way though. Normally it's not a done thing to poke holes in
firewalls to allow CGI processes to contact things. 

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | 'I hate gramaticle errors!' 'Me to!'
NSW, Australia                      | 


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

Date: Mon, 07 Dec 1998 23:10:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: perl zip
Message-Id: <AfZa2.104$884.122@nsw.nnrp.telstra.net>

In article <74h7ge$eug$1@news.indigo.ie>,
	"Mary O Mahony" <omahonym@indigo.ie> writes:
> Could anyone please send me an up to date copy of perl in the zip format?

You don't mention which platform. Your insistence on zip points in the
direction of some DOS derived system, or maybe OS/2. Try one of the
following:

http://www.perl.com/
http://www.activestate.com/

I don't think either has zip format, but a self-extracting,
self-installing copy is fine as well, I suppose?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.       | password?
NSW, Australia                      | 


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

Date: 7 Dec 1998 20:22:38 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: perl zip
Message-Id: <74hdee$ik$1@gellyfish.btinternet.com>

On Mon, 7 Dec 1998 18:41:23 -0000 Mary O Mahony <omahonym@indigo.ie> wrote:
> Could anyone please send me an up to date copy of perl in the zip format?
> 

Er no but (assuming you are on Win32) then just slide on over to :
http://www.activestate.com and grab the most recent version for that platform
as a self installing executable.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 07 Dec 1998 23:15:17 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: SSI from Perl on IIS
Message-Id: <9kZa2.106$884.122@nsw.nnrp.telstra.net>

In article <74hkgp$unn$1@ligarius.ultra.net>,
	"Mark Polakow" <mpolakow@emergemarketing.com> writes:
> DOntcha love acronyms?

no.

> My question is for Win32 Perl Users:

There's nothing win32 specific about it. There is not even anything
perl specific about it.

> I am running Perl on win32 on MS IIS and generally it runs great. However I
> am trying to do SSI calls from inside Perl scripts and am not able to do
> this because IIS is interpreting the pl files with Perl and not the SSI .dll
> that it needs to process it. Has anyone out there done ssi from withion a
> perl with IIS or even at all????

You can't 'call' an SSI. If you mean that your CGI script (note how I
avoid using the term perl) outputs a line that you expect to be parsed
by the server in that way, then you are not calling a SSI. You are
merely outputting stuff.

To find out why what you want doesn't work, you should read up on CGI,
web servers, and SSI. None of these are discussed here. Try in one of
the groups in the comp.infosystems.www.* groups. Heck, maybe there is
some server-specific thing that you can do to make it work. How would
we know? This is not comp.lang.perl.ssi.iis.cgi.programming

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: Mon, 07 Dec 1998 19:12:55 -0500
From: George Kuetemeyer <george.kuetemeyer@mail.tju.edu>
Subject: Re: Wanted:  Win32 GetGroups function
Message-Id: <366C6F07.BA456404@mail.tju.edu>



Pete Keefe wrote:

> Neither Win32::NetAdmin or Win32::AdminMisc have a function for list the
> groups that have been setup in an NT domain or on a local machine.  Can
> someone tell me if this is possible to do and if so point me in the right
> direction?

To get a global group list, try out Win32::DomainAdmin:

      $result = Win32::DomainAdmin::GetGroups($server,\%groups);

To get a local group list, you may want to try parsing out the output from a
back-ticked 'net localgroup' command. The only problem with this approach is
that there doesn't appear to be a way to get local groups from a server other
than the one you're running the "net localgroup" on.:

    my $command = "$ENV{'SYSTEMROOT'}\\system32\\net localgroup";
    my (@output,@tmp);

    @output = `$command`;
    foreach (@output) {
        chomp;
        ($_ =~ /\*/) || next;
        $_ =~ s/^\*//;
        @tmp = split /\s+\*/,$_;
        push @groups, @tmp;
    }

    # trim leading/trailing white space
    foreach(@groups) {
        $_ =~ s/^\s+ | \s+$//;
    }




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

Date: 07 Dec 1998 14:11:01 +0000
From: Kin Cho <kin@symmetrycomm.com>
Subject: weird @_ and sprintf behavior
Message-Id: <uyaokjb4a.fsf@server3.symmetrycomm.com>

Consider the following code:

&pf1("Hello %s\n","world");
&pf2("Hello %s\n","world");
sub pf1 {
   print sprintf(@_);
}

sub pf2 {
   my $fmt = shift;
   print sprintf($fmt,@_);
}
exit;

The output is "2" and "Hello world".
Looks like sprintf in pf1 considered @_ a scalar.
Any idea why?

-kin



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

Date: 7 Dec 1998 23:19:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: weird @_ and sprintf behavior
Message-Id: <74hnqi$ri9$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Kin Cho 
<kin@symmetrycomm.com>],
who wrote in article <uyaokjb4a.fsf@server3.symmetrycomm.com>:
> Consider the following code:
> 
> &pf1("Hello %s\n","world");
> &pf2("Hello %s\n","world");
> sub pf1 {
>    print sprintf(@_);
> }
> 
> sub pf2 {
>    my $fmt = shift;
>    print sprintf($fmt,@_);
> }
> exit;
> 
> The output is "2" and "Hello world".
> Looks like sprintf in pf1 considered @_ a scalar.
> Any idea why?

Since the first argument of sprintf() is defined to be a scalar?

Ilya


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

Date: 7 Dec 1998 21:02:44 GMT
From: "John Hankey" <monkey@chisp.net>
Subject: Re: Which modules to use
Message-Id: <01be2224$eab5c2a0$231faecf@loglady.owlscreech.com>

> > (2) Reading in HTML pages
> 
> IO::File? :-) Of course it depends on what does it actually mean to read
> in a HTML page.

Thank you!

	For "reading in" a HTML page I mean from a URL, similar to as in Java.

		John


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

Date: Mon, 7 Dec 1998 23:42:30 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Which modules to use
Message-Id: <ebohlmanF3MCIu.5JI@netcom.com>

John Hankey <monkey@chisp.net> wrote:
: > > (2) Reading in HTML pages
: > 
: > IO::File? :-) Of course it depends on what does it actually mean to read
: > in a HTML page.

: Thank you!

: 	For "reading in" a HTML page I mean from a URL, similar to as in Java.

LWP



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

Date: Mon, 07 Dec 1998 10:39:38 -0500
From: "FENG XIAN, ALEX" <feng_xian@mitel.com>
Subject: Why i can't "localize through a reference" in perl version 5.005_02
Message-Id: <366BF6BA.92DF1908@mitel.com>


hi, all,

i have a piece of perl script that ran fine under 5.004 version but
after i moved to perl 5.005_02, i got an error message when the perl
compile the code,

	Can't localize through a reference at perlscript.pl line 271.

the code is like this,

foreach $i (...) {
      $min_group_name = "min_group$i";
271=> local @{$min_group_name} = ();
	...
}

i am creating a local symbolic array. maybe perl doesn't suggest to use
symblic variables, but sometime the symbolic variable is really flexible
and very useful.

i am not sure this is a new feature to restrict the use of symoblic
variables in the perl 5.005 or something wrong in the new version.

please reply me also to my email address, because i seldom check the
news group.

thanks a lot.

/Alex

-- 
 _    _  _ _____ ___ _ 
| \  / || |_   _| __| |    FENG XIAN (Alex)
| |\/| || | | | | _|| |__  
|_|  |_||_| |_| |___|____| Tel: (613) 592-2122 x 6882
_________________________  Fax: (613) 592-4784
                           mailto:feng_xian@mitel.com
S E M I C O N D U C T O R  http://www.semicon.mitel.com


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

Date: Tue, 08 Dec 1998 00:39:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Why i can't "localize through a reference" in perl version 5.005_02
Message-Id: <Fy_a2.113$884.117@nsw.nnrp.telstra.net>

[comp.lang.perl does not exist. It has been long dead. Inform your
news admin]

In article <366BF6BA.92DF1908@mitel.com>,
	"FENG XIAN, ALEX" <feng_xian@mitel.com> writes:
> 
> hi, all,
> 
> i have a piece of perl script that ran fine under 5.004 version but
> after i moved to perl 5.005_02, i got an error message when the perl
> compile the code,
> 
> 	Can't localize through a reference at perlscript.pl line 271.

# perldoc perldiag
[SNIP]
     Can't localize through a reference
         (F) You said something like local $$ref, which Perl
         can't currently handle, because when it goes to restore
         the old value of whatever $ref pointed to after the
         scope of the local() is finished, it can't be sure that
         $ref will still be a reference.
[SNIP]

learn to use the documentation. I can't be bothered to write more
about this, because of:

> please reply me also to my email address, because i seldom check the
> news group.

Learn to read the newsgroup, especially after you post a question. if
you read the newsgroup more often, you might accidentaly learn a thing
or two.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I'm desperately trying to figure out
Commercial Dynamics Pty. Ltd.       | why kamikaze pilots wore helmets - Dave
NSW, Australia                      | Edison 


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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